Jump to content

Using Browser Back Button Returns Emptied Products to Basket


onebrowncow

Recommended Posts

CC6.0.6 After emptying the basket on the view cart or checkout pages using the browser back button in a browser can / will return emptied products to the mini basket.

This occurs frequently in Firefox, occasionally in Chrome and in IE returns you to the previously full version of the view basket page!

Surely these pages should not reload using a back button

The more I test the basket the more problems I seem to encounter!

Link to comment
Share on other sites

Are you saying that your browser will fetch a fresh page from your store when clicking the back button? Mine doesn't.

Clicking the back button will have my browser re-display the prior page as it was cached in the browser's local cache.

If I then have the browser fetch a fresh page from the store, the mini-basket shows the correct contents.

I think what you are wanting is for the skin to include a header that tells the browser to not locally cache any pages from your store, or to have some javascript zero-out the browser's history array.

Link to comment
Share on other sites

I think what you are wanting is for the skin to include a header that tells the browser to not locally cache any pages from your store, or to have some javascript zero-out the browser's history array.

This would be the response I would prefer from the browser with a modern e-commerce site, cart pages not cached, force a fetch and re-load after emptying the cart to avoid any confusion.

This was raised as a point with one of my friends testing our development site and until now I'd never noticed that this can also occur with our current live store so maybe this should be suggested as a feature request rather than me implying it may be a bug

Edited by onebrowncow
Link to comment
Share on other sites

Case in point: these forums will re-fetch from the web server the prior URL.

 

Try this. In /index.php:

Find:
require dirname(__FILE__).DIRECTORY_SEPARATOR.'ini.inc.php';
define('CC_IN_ADMIN', false);

Add After:
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header("Expires: -1");
header('Pragma: no-cache');

I have no idea if this breaks anything else.

This was copied from /admin.php.

Link to comment
Share on other sites

That stands to reason. But no more impact than if the customer hit the HomePage link (on the checkout pages, it is the store's logo - not very evident).

Yes in group testing this is something that has been pointed out, where do you go after emptying the basket? We are already giving consideration to the lack of anywhere to go from an empty cart. We have already added a home icon next the the hamburger icon in mobile view. Current thinking for desktop size Foundation favours a button which appears on the empty cart page saying continue shopping but this may be a permanent button which appears on all cart pages below empty and update as I don't think I have enough coding skills to make a button dynamically appear on the emptied cart page after it has been emptied.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...