Case study: Fixing dealer pricing display errors in WooCommerce

At Freshy, we frequently encounter complex WooCommerce configuration challenges. In this case, we successfully diagnosed and resolved a persistent issue where dealer pricing on a WooCommerce website was not displaying correctly, despite backend settings appearing accurate.

Issue background

The client reported that dealer-specific pricing on their WooCommerce site was incorrectly displayed. Specifically:

  • The “Your Price” field was showing outdated dealer prices.
  • Dealer/distributor prices were removed from the product backend, but the prices were still sticking on the front end.
  • This discrepancy appeared only when logged in as a Distributor user role.

Diagnosis

Our investigation revealed two key factors contributing to the issue:

  1. Faulty distributor price reset function: The WooCommerce function responsible for resetting distributor prices on variable products was not set up properly. It even triggered a fatal error during product saves.
  2. Outdated “From-To” price range values: When distributor pricing was removed, the “From-To” price range did not update. This was because the function that recalculates these values only fires upon product save, meaning previously saved products still displayed outdated values.

Resolution steps

  1. Initial code fix: We corrected the function that resets distributor pricing for variable products. This fix eliminated the fatal error and ensured that saving a product properly recalculated dealer pricing data.
  2. Product re-save & bulk update: After the initial fix, we identified that every product needed to be re-saved to trigger the recalculation. To expedite the process, we created a custom PHP script to bulk re-save products and update their pricing in the database.
  3. Further troubleshooting (variable products): We discovered that variable products required an extra step. WooCommerce only updated dealer pricing if the Variations tab was opened and saved manually. As a result:
    • We manually opened and saved each variable product.
    • Verified the pricing was now accurate across the entire catalog.
  4. Cache clearance & testing: We cleared all caching layers (Edge Cache, Object Cache, CDN, WP Rocket, etc.) and tested both logged-in and incognito views to confirm the fix.

Final outcome

After extensive debugging, bulk updates, and manual intervention for variable products, the dealer pricing display issue was fully resolved. The client confirmed that prices were now displaying correctly for both simple and variable WooCommerce products when logged in as a dealer.

Key technical takeaways

  • WooCommerce pricing data: WooCommerce handles variation pricing differently than simple products; variable product prices are controlled at the variation level.
  • Programmatic limitations: Some WooCommerce behaviors (like recalculating variation prices) require manual backend interaction and cannot be scripted easily.
  • PHP fatal errors: Always check for your logs for hidden fatal errors in functions affecting product data.
  • Cache conflicts: Front-end display issues are often complicated by cached data; clearing cache is a vital troubleshooting step.

Is your WooCommerce site showing incorrect pricing, or behaving unpredictably?
Freshy can help you diagnose and resolve complex WordPress and WooCommerce issues efficiently.
Contact Freshy for expert WordPress support