View Categories

Speed Up Price Updates When Changing Quantity

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 #

  1. Test with no optimization

    1. 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.

  2. Exclude plugin scripts from deferral

    1. 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.

  3. Check console errors

    1. Open Dev Tools Console to ensure no JS errors interrupt execution. Fix errors from other scripts (they can halt subsequent scripts).

  4. Reduce heavy scripts where possible

    1. Defer or optimize other non-essential scripts, but keep the plugin’s UI scripts loaded early.

  5. If plugin has a debounce setting, reduce delay

    1. 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

  6. Contact host if server is slow

    1. 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.