Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Forced page refresh


dave thomas

Recommended Posts

My brother who has done a bit of coding for my osc store has run into a problem. Basically he has included a form into the checkout confirmation page which allows the user to enter details as to why they are exempt from paying vat (disabled persons) , when they do so there is a button where they click accept . When this is clicked , the page should refresh and ammended prices should appear . This all works fine except that a manual refresh (press f5) is required to make the information on the checkout page redisplay correctly .

Is there a way to refresh a page in the same way as pressing F5 or can someone point me in the right direction!

 

Thanks

Link to comment
Share on other sites

You can add the following piece of Javascript to make the page refresh automatically when the user clicks the button or ticks a box, for example:

 

onclick="window.location.reload();"

Just add it inside the tag of the element you want to call the action from. It's not excellent practice, but it will do the job.

Link to comment
Share on other sites

You can add the following piece of Javascript to make the page refresh automatically when the user clicks the button or ticks a box, for example:

 

onclick="window.location.reload();"

Just add it inside the tag of the element you want to call the action from. It's not excellent practice, but it will do the job.

This option might lose the data being collected from the customer. You might want to look at another javascript alternative. Maybe something along the lines of showing the prices after running through some checks.

Link to comment
Share on other sites

"This option might lose the data being collected from the customer."

This is true, but his original post says a manual refresh works and he simply wanted an automated refresh, which is what the code I provided does.

 

Really he shouldn't be putting this option on the checkout confirmation page, it should come beforehand - either at the shopping cart or on the billing page - but his post implies he has a working solution in place, so I wasn't going to address that.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...