1. Home
  2. Knowledge Base
  3. WooCommerce Discount Manager
  4. Advanced Usage

How does caching affect the discounts?

When you use the WooCommerce Discount Manager plugin, it's important to consider how caching might affect the way in which discounts are displayed to users - for example, if your host provides caching or you are using a plugin like WP Rocket.

Most of the discounts in the plugin are calculated on the cart page, and do not affect how prices are displayed on product pages. This means that caching will not be a problem because cart pages should never be cached, whereas product pages are likely to be cached.

The exception is the "Simple" discount type, which gives either a fixed or percentage discount off the main product page. If you have set up a simple discount to charge different amounts to different users (for example because the discount is only available to certain user roles), then there could potentially be a problem if your site has a static page cache on the product page. Static page caches prevent any dynamic functionality from being loaded for each individual user, including the way in which prices are displayed.

If this is affecting your store then the only solution is to load prices via AJAX after the rest of the page has loaded. This would require some custom development work because overwriting the HTML output of prices could cause issues with certain themes, and needs to be done uniquely for each site. If you don't know how to do this then we recommend switching to a different type of discount or posting a job on Codeable to find a developer who can do it for you:

We've partnered with Codeable to provide our customers with expert help if required.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.