The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Go back to URL
ApoMarn
post Jan 12 2017, 03:53 PM
Post #1





Group: Members
Posts: 6
Joined: 12-January 17
Member No.: 26,262



Is it possible to store the URL of the previous page, and how would you use this with a button?

I have an online shop and when someone puts something in the cart it takes them to 'cart.php' and onward to checkout.

I have added a 'Continue shopping' button which takes the customer back a page. So far so good.

However as the customer goes through the various stages, the php page keeps refreshing itself and the 'continue shopping' button only takes them back one stage. If fact if they empty the cart and then click the button, they return to the page with something in the cart.

What I need is a button that contains the URL of the page they were on before cart.php.

Can someone help please.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 12 2017, 04:49 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Hard to say, since any solution needs to work with the existing store script. Doesn't the shopping cart already contain the URL of the page the added product was taken from?

QUOTE
If fact if they empty the cart and then click the button, they return to the page with something in the cart.

That sounds odd, like if the old page is cached in the user's browser (which it shouldn't be).

If you don't mind modifying the PHP scripts, you could perhaps add the most recent product page's URL as a querystring when the user goes to cart.php, like "cart.php?previouspage=productpage10.php". When the cart page is loaded, its PHP script might then generate a Continue Shopping button that when clicked will load "productpage10.php".

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 10:47 AM