Why is the cart drawer not updated?
If the cart drawer or slide cart is not updated after a bundle is built, the cart drawer cannot detect the add-bundle-to-cart activity. Currently, there is no unified way to manually update the cart drawer. This is because all cart drawers are developed by 3rd parties.
You can use our callback, afterBYOBAddtoCart to manually trigger a cart drawer update, e.g. This is the sample code to integrate with the Prestige theme by Maestrooo
<script> function afterBYOBAddtoCart(variants, variant_id) { console.log('refresh cart drawer in addVariantToBundle'); document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', { bubbles: true })); } </script>
You can add the code in a custom liquid section and put it via Change Design => byob product template => before the BYOB app blocks
Is it a bug of BYOB?
No, this is because other cart drawers don't integrate with us. We do offer various callback methods for integration. FYI Shopify doesn't offer an official way to work with cart drawers. At the same time, we have been integrating with various cart drawers.
Can BYOB support my cart drawer?
It depends on whether your cart drawer supports a way to refresh its status manually. Also, it depends on whether your cart drawer is updated frequently. Our integration code may work for a while and a code update may break the integration.
2 questions:
- Which cart drawer are you using?
- Is there any callback method to update the cart drawer?
Reference:
https://support.maestrooo.com/article/304-technical-javascript-events-exposed-by-the-theme