action after add to cart
-
Hello,
I want to take a particular action when adding a product to the cart, whether from the product or product.
After clicking on “add to cart”, I have a right column that opens with the basket in a sidebar but it is necessary that the product is add and increment also in the counter next to the cart icon in my topbar. For now I can show my sidebar. But the product does not add to the basket.
How to do ?My jquery code :
jQuery(document).ready(function (){ recalculatePageHeight(); jQuery(window).resize(recalculatePageHeight); function recalculatePageHeight() { var width_wrap = jQuery('.wrap').width(); var width_window = jQuery(window).width(); var width_total = width_window - width_wrap; var margin_cart = (width_window - width_wrap) / 2; jQuery('#cart-topbar').css('right',margin_cart); }; jQuery('.single_add_to_cart_button').click(function(){ var action = jQuery('#taille').val(); if( action === ""){ jQuery('.variations .value').append('<span id="info-option">Veuillez sélectionner une taille</span>'); } else{ jQuery('#info-option').css('display','none'); } if (action != ""){ jQuery('body').addClass('oc-sidebar-opned'); return false; } jQuery('.oc-close').click(function(){ jQuery('body').removeClass('oc-sidebar-opned'); }); }); jQuery('.woocommerce-ordering select option').addClass('filter-option'); });
The page I need help with: [log in to see the link]
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘action after add to cart’ is closed to new replies.