Skip Navigation

[Resolved] Adapt the "return to shop" button in WC cart

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Pat 7 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#426592

Pat

Hello,
I'm using Toolset with WC and have several cred form in the same apge. This means that users can order different products. So, all my creds are linked to a WC product and as soon as a cred is validated, the user is redirected to the cart.
I would like to add a button in the cart in order to gaive opportunity to the users to go back to the previews page in order to be able to continue shopping.
What do I need to use for the link of this specific button (to be placed in the WC template).

Regards
Pat

#426660

Dear Pat,

Could you describe the question with more details?
What is the preview page? is it woocommerce shop page?
Are you going to setup the link in woocommerce PHP template file?

#426681

Pat

Hello Luo,
I want to add a new button in the WC cart with the link to the previews page (the page where I have the different CREDs in) in order for the users to be able to come back quickly to this previews page if they have other products to buy.
Regards
Pat

#426923

I assume the preview page is a wordpress page, and you are going to setup the link in the wocommerce template file, I suggest you check the template file of Woocommerce plugin:
\woocommerce\templates\cart\cart.php

In this theme file, setup a link to the preview page, you can use wordpress function get_permalink() to get the page link:
https://developer.wordpress.org/reference/functions/get_permalink/

#427043

Pat

Hi Luo,

It's partially OK, but I'm not able to retreive the previous page visited. The permalink function gives you the current page, but not the previous one.
Any idea?
Thanks
Pat

#427248

I am not sure what is the previous page you mentioned above, but you can use Javascript to setup a link to redirect user to the previous page, see similar thread:
http://stackoverflow.com/questions/9756159/using-javascript-how-to-create-a-go-back-link-that-takes-the-user-to-a-link-i

#431172

Pat

Hi Luo,

I have found the way to go back to previews page with this link :

<a href="<?php echo (wp_get_referer()) ?>" class="btn btn-primary">RETOUR PAGE PRECEDENTE</a>

Regads
Pat

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.