Table of Contents
Problem Description #
When customers change the quantity on a product page, the displayed price (or price table highlight) updates slowly (2–3 seconds) or the client sees a lag.
Common symptoms:
- Noticeable delay after adding/removing quantity before the price or total refreshes.
- Customers report “laggy” UX.
Cause:
Delay often caused by heavy frontend scripts, deferred JS execution, asset optimization (defer/async), or conflicts with other scripts that throttle UI updates. In some cases the plugin may rely on a debounced event to avoid excessive calculations which causes small delays.
Solution – step-by-step #
- Test with no optimization
- Temporarily disable JS optimization/minification/deferral provided by caching plugins (e.g., WP Rocket, Autoptimize) and test the quantity change. If delay disappears, optimization was the cause.
- Exclude plugin scripts from deferral
- In your performance plugin settings, exclude the plugin’s JS assets (look for file names mentioning price-by-quantity, wpfactory, or similar) from deferral/minification.
- Check console errors
- Open Dev Tools Console to ensure no JS errors interrupt execution. Fix errors from other scripts (they can halt subsequent scripts).
- Reduce heavy scripts where possible
- Defer or optimize other non-essential scripts, but keep the plugin’s UI scripts loaded early.
- If plugin has a debounce setting, reduce delay
- Some plugins include settings controlling the debounce interval for quantity recalculation. Check plugin settings and reduce interval if available. If not, ask WPFactory for a setting. WPFactory
- Contact host if server is slow
- If AJAX requests are slow, check server response times. Use Network tab to inspect time for AJAX calls; if server responds slowly, discuss with hosting provider.
- If AJAX requests are slow, check server response times. Use Network tab to inspect time for AJAX calls; if server responds slowly, discuss with hosting provider.
Prerequisites #
- Access to caching/performance plugin settings.
- Ability to test in incognito or staging.
Additional notes / prevention tips #
- Prefer excluding critical UI assets from aggressive optimization.
- Test on mobile too, because mobile CPUs can make delays more noticeable.