Back button / Return button to category
-
Hi,
I want to add a back button to the view cart notification. I think this is better for UX. Please check this video to see why the current process is less user friendly: https://www.loom.com/share/4a7759900a85489594933d10470e7a69
Abrasives is the parent category where there are 3 child categories. When the visitor ads some belts to the cart I would like a back button so it’s easy to go back to the child category. The button should be next to the view cart button notification. The text should be ‘ALL (CHILD CATEGORY)’ for example ‘ALL ABRASIVE BELTS’
I already found this topic but didn’t do exactly what I want: https://www.ads-software.com/support/topic/back-button-return-button/
I have added this PHP snippet after product meta for testing:
add_action( 'woocommerce_product_meta_end', 'my_function_sample', 10 ); function my_function_sample() { global $product; echo ' <button type="button" onclick="history.back();"> All [previous category] </button> '; }
Now the button works as a back button. So when I added the belts to cart and press the button the visitor goes back to the same page before adding to cart.
Thanks in advance for your help!
The page I need help with: [log in to see the link]
- The topic ‘Back button / Return button to category’ is closed to new replies.