Before you ask please READ THIS

Add "Go back to shop" button on single product page

in FatMoon Posts: 248

When I click on a product on my shop page I miss a "back to shop" button. Is there an easy way to add this to my single products.

Thanks, Pascal
Bildschirmfoto 2016-11-09 um 12.34.04.png
1606 x 1247 - 329K


  • AirAir
    Posts: 10,138
    Hello there:-)

    You can try solution from woocommerce support

    With kind regards.
  • edited November 2016 Posts: 248

    Thanks for the Link.. I actually found something even better (I wanted a button :)) and I'm almost happy now... the only problem I have is placing the button in the right place!

    I used this code
    //add back to store button after cart
    add_action('woocommerce_single_product_summary', 'themeprefix_back_to_store');
    function themeprefix_back_to_store() { ?>
    <a class="button wc-backward" href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>"><?php _e( 'Return to Store', 'woocommerce' ) ?></a>
    Maybe putting it where I want is an easy thing for you? (see screenshot)

    Using a textlink for that puts it in the right place:
    add_action( 'woocommerce_single_product_summary', create_function( '', 'echo "<a href=\"YOUR_SHOP_PAGE_URL\">Continue Shopping</a>";' ), 35 );

    Thank you
    Bildschirmfoto 2016-11-10 um 12.32.28.png
    1435 x 1114 - 253K
    Post edited by Air on
  • AirAir
    Posts: 10,138
    Sorry for late reply, I must have missed your answer :-S

    Change this code from your original code
    add_action('woocommerce_single_product_summary', 'themeprefix_back_to_store');
    add_action('woocommerce_single_product_summary', 'themeprefix_back_to_store', 35);

    It should work ;-)

    With kind regards.
  • Posts: 248
    Hi there

    Thanks.. that worked like a charm :))
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!