Custom Drawer Cart Plugin

These code for Custom Drawer Plugin by @Michael

#1. Click link – trigger Custom Drawer Cart Popup

<!-- Trigger Cart popup on clicking Cart link -->
<script>
window.addEventListener('load', function() {
    setTimeout(function() {
        var customCartLinks = document.querySelectorAll('.html-block a[href="/cart"]');
        var mainCartIcon = document.querySelector('#floatingCart a[href="/cart"]');
        
        if (mainCartIcon) {
            customCartLinks.forEach(function(link) {
                link.addEventListener('click', function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    mainCartIcon.click();
                    
                    return false;
                }, true);
            });
        }
    }, 1000);
});
</script>
<style>
div#floatingCart {
   display: flex !important;
  visibility: hidden !important;
}
</style>
You need to login to see the full content. Or send me an email to [email protected], I will send you code.
Buy me a coffee