How to prevent Woocommerce to jump after redirection?
-
Hi, I created a product archive template where all users can click on the “Buy Now” button. I managed to prevent Woocommerce to redirect when the user click on the button. If the user want to buy several products without going to the single product page he/she can do that.
It is a time consuming process if the customer need to go back and forth within the product archive page/single product page to do the shopping. So I made it easy to do the process from the archive page only. I also added a quantity box to make it easier to shop several of the same items.
So I used this code to prevent the redirection to another page (the user will stay at the same page):
// Change form action to avoid redirect. add_filter( 'woocommerce_add_to_cart_form_action', '__return_empty_string' );
… and it worked… BUT there is a problem: if the customer make some shopping at the bottom of the page it jumps to the top of the page (after the click action).. so they have to scroll down again if they need to. How to prevent that? It’s annoying.
Thank you
/Andy
- The topic ‘How to prevent Woocommerce to jump after redirection?’ is closed to new replies.