I've made some modifications to Magento's swatches via a custom module to display out of stock options on the product page (as non-selectable deactivated swatches, so the user will know that the option exists but isn't currently available.) I'm adding quantity information to the page through a Javascript variable, but I've discovered a problem with that approach. The page gets cached, so of course, when an item's quantity drops to zero after the last item in stock is ordered, that change isn't reflected on the product page until I manually clear the cache.

Is there any way I can make this data immediately available via Javascript that will bypass the cache? I'm averse to making an ajax request for this. I'd like the data to be available when the page loads, if that's possible.

Your Answer

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

Browse other questions tagged or ask your own question.