-1

We're having a bizarre issue with our checkout process. Lets say that: -

  • User adds a few products to their basket
  • Clicks to view basket and then removes these products Then uses the browsers <- back button to navigate to a previous product page
  • Then they add another product to the basket, this causes the layout of the entire site to crumble, it's as if none of the code to load the menus or product listings is being fired off e.g.

enter image description here

I think it may be related to us using AJAX on the basket so i tried the suggestion posted here adding a hidden form element to the page which actually resolved the issue in chrome but in firefox the page gets stuck in an infinite loop,

Has anyone encountered similar issues with user navigating back to a previous state? I'm completely lost as to what to try next

Thanks for any help

Community
  • 1
  • 1
DGibbs
  • 14,316
  • 7
  • 44
  • 83

1 Answers1

0

Well i managed to fix this. The issue was that when the user navigated back via history to a previous product page, it was being treated as a postback and so none of the code to populate the controls on the page was being fired as it was inside a !Page.IsPostBack block...

Since I couldn't find anything better to use to determine when the page was broken I simply read in the navigation tabs and check if any of them are empty which is an indication of the page not loading right and then we refresh e.g.

  <script type="text/javascript">
    $(function() {
        $("#tabs-nav ul li").each(function() {
            if (!$(this).children().text() || /^\s*$/.test($(this).children().text())) {
                location.reload();
            }
        });
    });
</script>

It's not pretty but it does the job

Thanks

DGibbs
  • 14,316
  • 7
  • 44
  • 83