• Hello, I just bought the plugin and so far it’s been great to work with, but I haven’t been able to add the “xoo-wsc-cart-trigger” class to the default woocommerce shopping cart icon.

    My idea is to keep the default hover display, and activate side cart if the user clicks the cart icon.

    Any ideas on how to do this?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xootix

    (@xootix)

    Hello @dylansaga

    Please add this to your functions.php

    add_action( 'wp_footer', function(){
    	?>
    	<script type="text/javascript">
    		jQuery(document).ready(function($){
    
    			$('body .builder-item--header_cart_icon').addClass('xoo-wsc-cart-trigger');
    
    			$('body').on('click', '.builder-item--header_cart_icon', function(e){
    				e.preventDefault();
    				e.stopImmediatePropagation();
    			});
    		})
    	</script>
    	<?php
    } );
    • This reply was modified 3 years, 4 months ago by xootix.
    Thread Starter dylansaga

    (@dylansaga)

    It worked perfectly, thank you!

    Edit: it works, but I need to click the cart icon twice for it to show me the side cart.
    The first click doesn’t do anything, you can try it out on my website, is live right now.

    Edit 2: I deleted “e.stopImmediatePropagation();” and it seems to be working now. Thank you.

    • This reply was modified 3 years, 4 months ago by dylansaga.
    • This reply was modified 3 years, 4 months ago by dylansaga.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add trigger class to woocommerce default icon cart’ is closed to new replies.