WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » [Plugin: WooCommerce] Change 'Continue Shopping' URL

[Plugin: WooCommerce] Change 'Continue Shopping' URL

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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

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

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WooCommerce] Change 'Continue Shopping' URL’ is closed to new replies.
Skip to toolbar