Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Update cart button/javascript

Home / Forums / Virtue Theme / Update cart button/javascript

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
January 25, 2018 at 6:34 am

Hi,
I want to automatically update the cart when the plus/minus button is used, so that the customer does not manually have to press the “update cart” button. I added this:

add_action( 'wp_footer', 'custom_cart_refresh_update_qty' );

function custom_cart_refresh_update_qty() {
if (is_cart()) {
?>
<script type="text/javascript">
jQuery('div.woocommerce').on('change', 'input.qty', function(){
jQuery("[name='update_cart']").trigger("click");
});
</script>
<?php
}
}

and this works well with 2017, but when I use Virtue the code does not work well, either not at all or just very delayed. Are there any ways to make the cart update automatically with Virtue?

  • The forum ‘Virtue Theme’ is closed to new topics and replies.