Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Prevent Refresh of "Thank You" page


dangermouse1981

Recommended Posts

Hi there,

 

How would I go about preventing access to the "checkout_success.php" after a transaction has been completed? I realise that if you attempt to access the page prior to a transaction then you are redirected to the shopping cart page, however I would like similar functionality to prevent that page from refreshing once a purchase has been made?

 

The idea is to prevent duplication of GA transaction tracking - hitting the back button or refresh button causes the page to be reloaded and thus the JavaScript to be executed again.

 

I'm familiar with PHP but to be frank the code soup that is OSCommerce scares me (I tend to be an OO coder), would it be safe just to add a marker in the session variable?

 

Are there any situations where a reload of the "checkout_success.php" page is valid?

 

Any suggestions / advice appreciated.

 

Cheers,

 

Steve

Link to comment
Share on other sites

Well, you can't stop someone from refreshing the page or hitting the back button in the browser - those buttons are out of your scope of control.

 

I think your best bet would be to create a session variable and use it to run or skip over the GA script.

 

Not all that complicated.

:)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...