Woocommerce MiniCart won't update

Hello,

I’ve created a custom element that is very similar to the woocommerce Add to cart form. I have it all working essentially. My only issue is the client wants the mini cart to refresh when the product is added from this element. The element will only be present on the home page. I’ve tried working with cart fragments but don’t seem to be having much luck.
I have enqueued the following in my child theme: wp_enqueue_script( 'wc-cart-fragments' );
And have the following in it as well.

I believe what I’m trying to reference in the $fragments[] is incorrect but I’m not sure. Is there something I should be referencing for it or that I’m missing. I have slight workaround by adding in a location.reload() after a successful Ajax call but it’s not ideal.

The custom element itself is mostly built through cornerstone and using the code above. The cart modal is just the default one provided through Cornerstone Pro.
If you need more info please let me know! Thank you.

Hi @getabsolute,

Thanks for reaching out.
The custom coding-related questions are beyond the scope of our Theme Support. I would suggest you hire a developer who can assist you with the customization or you can avail of our newly launched service called One, where we answer the questions beyond normal theme support.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.