Price Changed in Database not Showing in Store

When you update a product price directly in the databasem the price change may not display in the store's frontend. Here's how to fix that.

Magento 1 stores have access to some special extensions or scripts that will update the database directly instead of using Magento's built-in methods. When product price is updated through a direct database change instead of the Magento Admin Panel, the cached frontend page is not updated, and the old price continues to be displayed.

On the other hand, when using the built-in method to update a price, Magento will send out proper events that LiteMage can capture. Under these circumstances, LiteMage can notify LiteSpeed Server to purge the related tags, resulting in an up-to-date fronted. In the direct database update case, there's no event triggered, so LiteMage will not be notified of such change and there will be no way to tell the server to purge those pages.

So, how do you trigger a price update in this situation?

You might consider excluding the price from the cache, but that's not a good idea. LiteMage is not designed to exclude the price block. It would slow down every page and make it unusable. Instead, for your data feed, you can include magento_dir/shell/litemage_purge.php to trigger a purge for the related products in the existing price change script. This script can purge any particular product IDs, category_IDs, store_IDs, or raw tags.

magento_dir/shell/litemage_purge.php
Usage:  php litemage_purge.php -- [options]

  --products <product IDs>    Comma delimited list of product IDs.
  --skus <SKU_IDs>            Comma delimited list of SKU IDs.
  --related                   When used with "products" and "skus" options, will purge their related products (configurable/bundled) and related categories.
  --cats <category_IDs>       Comma delimited list of category IDs.
  --stores <store_IDs>        Comma delimited list of store IDs.
  --tags <raw tags>           Comma delimited list of raw tags. Advanced: must understand LiteMage internals to use this option.
  --all                       Flush all cached files in LiteSpeed Web Server.
  • Admin
  • Last modified: 2018/11/02 19:35
  • by Lisa Clarke