• Hi,
    I just want to add a continue shopping button in my product page just near Add to cart, could you help me ?
    Thanks in advance,
    Best
    Sandra

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is in my functions.php file:

    /*add return to store on single product summary*/
    function addlink(){
       if(is_product()){
       ?>
    <a>"><?php _e( 'Return to Store', 'woocommerce' ) ?></a>
    <?php
    }
    }
    add_action('woocommerce_single_product_summary', 'addlink', 35);

    Instead of ‘Return to Store’ you can use ‘Continue Shopping’. Hope this is what you were looking for.

    • This reply was modified 7 years, 11 months ago by carver1g.
    • This reply was modified 7 years, 11 months ago by Marius L. J.. Reason: Added code tags
    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi Sandra!

    The following code also works:

    add_action( 'woocommerce_after_add_to_cart_button', 'wc_continue_shopping_button' );
    function wc_continue_shopping_button() {
     $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
     
     echo '<div class="">';
     echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping →</a>';
     echo '</div>';
    }

    You can add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added – such as My Custom Functions or Code Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    I hope this helps.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add continue shopping in product page’ is closed to new replies.