Redirect add to cart
-
Hi, is it possible to redirect a link of the add to cart button depending on the product quantity?
The button works in ajax, which hook should I use?
I tried to use this code on the theme function, but it doesn’t work:function check_quantity() { $adult_number=$_POST['adult_number']; $child_number=$_POST['child_number']; $infant_number=$_POST['infant_number']; $total = $adult_number + $child_number + $infant_number; if ($total > 4){ wp_redirect( get_home_url().'/viaggi-gruppo/'); exit; } } add_filter('woocommerce_add_to_cart', 'check_quantity');
How can I do?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Redirect add to cart’ is closed to new replies.