Overview
This article would help in making Wise Cart more compatible with your theme in order to give a consistent user experience to your website visitors. We have covered some commonly occurring problems that you might face while setting up Wise Cart with your theme.
Theme’s native cart is being shown behind Wise Cart
In some themes, your theme's native cart would be shown to the end user behind the Wise Cart. Therefore you'll notice that sometimes when you close Wise Cart, your native cart is still there.
To solve this problem, we can add a custom JavaScript code to your theme code or in tag managers (like Google Tag Manager) to close your theme's native cart when Wise Cart is shown to users.
Follow this video for steps
Here's an example of where this code can be added to the theme's code:
Here's a sample code for your reference:
<script>
window.addEventListener("DOMContentLoaded", (event) => {
window.addEventListener('wiseCartOpen', function updateCartCount(event) {
document.querySelector('button.drawer__close')?.click();
});
});
</script>
In the above code, you'll need to replace button.drawer__close
with the selector of your theme cart's close icon since the selector can vary from theme to theme.
Open up the developer tools (right-click, inspect element), and find the element of your theme's native cart close icon.
Here's an example of how to find the selector in the Dawn theme:
Note: The above code might have to be modified depending on how your theme shows the cart drawer. Please consult your theme developer or reach out to us at support@convertwise.com if you need more assistance with writing this code.
User is redirected to the cart page and is not able to see Wise Cart
This issue happens in some themes on click of the "add to cart" button from your Product page.
To resolve this, go to your theme's settings in the Shopify dashboard and change the cart type from "Page" to "Drawer". This will prevent the redirection to the cart page and allow Wise Cart to open instantly.
After changing this setting from "Page" to "Drawer", you might face the issue of your theme’s native cart being shown behind Wise Cart. We have provided a solution for that in the above section of this help article.