1

Commerce Kickstart facets get temporarily disabled (showing reduced opacity) after selecting one of them until the new search downloads. This is a cool feature. However, if the user clicks the browser's back button after that, then the previous page is displayed without reloading and the facets are still disabled, therefore making a new search impossible unless the user manually reloads the page.

In order to reproduce this problem, just visit KickStart Demo (http://demo.commerceguys.com/products), select a facet term, wait until the search is loaded and then go back.

What's the easiest way to solve this? I've been thinking of forcing a page reload in search pages or to use jQuery to make sure that all facets are enabled. Neither of them sound very natural.

Thanks for you answers! David

0

This is an issue with how FireFox serves cached pages when you use the Back button.

There appears to be two ways of solving this:

1) Per the first answer here, set autocomplete="off" for all form elements that can be disabled. As that form likely isn't one you have direct control over (without hacking a module), you'll have to do this with a hook_form_alter().

2) The second answer in the question linked above provides some JavaScript that you can use to stop this from happening:

window.addEventListener('pageshow', PageShowHandler, false);
window.addEventListener('unload', UnloadHandler, false);

function PageShowHandler() {
    window.addEventListener('unload', UnloadHandler, false);
}

function UnloadHandler() {
    //enable button here
    window.removeEventListener('unload', UnloadHandler, false);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.