WordPress.org

Forums

WooCommerce - excelling eCommerce
[Plugin: WooCommerce] Change 'Continue Shopping' URL (4 posts)

  1. JRiley21
    Member
    Posted 1 year ago #

    Hi all,

    I'm trying to do something I thought would be fairly simple, but I haven't been able to figure it out yet.

    When an item is added to the cart, the user sees a message that says: [Product] was successfully added to the cart. Next to that is a button that says Continue Shopping.

    Right now, that Continue Shopping button redirects the user back to the last product they looked at. I'm trying to change that so the user is redirected back to the Storefront instead.

    I've found the output in the woocommerce-functions.php, but I'm not sure how to alter, or maybe add a filter, that accomplishes this.

    Any help would be greatly appreciated!

    Thanks!

    http://wordpress.org/plugins/woocommerce/

  2. harishshk
    Member
    Posted 1 year ago #

    Hi JRiley,

    I am not sure if this would help you. But this worked for me.

    I don't have individual products, I use pricing grid. When clicked on "Buy this plan" it used to take to individual product page and then from there to add to cart. And when "clicked on continue shopping" it was taking me back to the single product page.

    SOLUTION:

    I added checkout/?add-to-cart=ID this code to my "Get this Plan" url, so when clicked on "Buy this plan it directly took them to cart page and when clicked on continue shopping it came back to the main page(store front) in your case. Replaced "ID" with my product ID.

    Hope you might find this somewhat helpful.

  3. minkender
    Member
    Posted 1 year ago #

    OK - the way I've fixed this is as follows:

    In woocommerce-functions.php change the function woocommerce_add_to_cart_message and replace the variable $return_to with the following:

    $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
    
    		$return_to 	= apply_filters( 'woocommerce_continue_shopping_redirect', $shop_page_url );

    This works with woocommerce / WPML

  4. joha5033
    Member
    Posted 1 year ago #

    Hi!
    Does anyone know how to rename the "Continue shopping" button?

    Best regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic