Hi, how can I add a new button to the product page that will go back to the shop page?
Hey DROR,
Please look into the following:
Best regards,
Jordan Shannon
Thats not what I need. I want to add a new button to the product page that goes back to the shop along site the “add to cart” button that is already existing in every product page.
Hi,
Please try adding this at the very end of your themes/child theme’s functions.php file:
You can change the button class name and button url in the below code.
// Button after add to cart
// Button after add to cart
function button_after_add_to_cart(){
?>
<script>
jQuery(window).load(function(){
jQuery(function($) {
jQuery('.single_add_to_cart_button.button').after('<a class="avia-button avia-icon_select-yes-left-icon avia-color-blue avia-size-large avia-position-left " style="margin-right: 10px;margin-left: 10px;" href="http://www.your-site.com/store/">Back to store</a>');
});
});
</script>
<?php
}
add_action('wp_footer', 'button_after_add_to_cart');
// End function
For more information about adding custom script please check this link.
Best regards,
Vinay