Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:cache:litemage:troubleshooting:price-not-update-when-changes-mad-through-db [2018/06/15 15:33]
Jackson Zhang created
litespeed_wiki:cache:litemage:troubleshooting:price-not-update-when-changes-mad-through-db [2018/11/02 19:35] (current)
Lisa Clarke [How to Trigger a Price Update] Added new script options
Line 1: Line 1:
-====== Price doesn'​t change at front end when I update product price through db directly, How to fix it? ======+====== Price Changed in Database not Showing in Store ======
  
-For user's Magento 1 store, it has some special scripts to update product price through database change ​directly ​instead of Magento Admin Panel. ​ The front end is cached and the price doesn'​t show the updated figure+When you update ​product price directly ​in the databasem ​the price change may not display in the store'​s frontend. Here's how to fix that.
  
-While, when a user updates anything through ​Magento ​Admin Panel, LiteMage ​will identify the changes and initiate the purge event to update the related pagesIf the prices are updated in Database directlyLiteMage has no way to detect such changes hence there is no purge event triggered during the price changed in DB. If the front pages were cached ​and cache TTL is not expired, the front pages will probably still show the out of date figures instead of new figures in the database  ​+Magento ​1 stores have access to some special extensions or scripts that will update the database directly instead of using Magento'​s built-in methodsWhen product price is updated through a direct database change instead of the Magento Admin Panel, the cached ​frontend page is not updatedand the old price continues to be displayed.
  
-How to trigger price update in this situation?+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. ​  
 + 
 +===== How to Trigger a Price Update ===== 
 +So, how do you trigger ​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.  
 + 
 +<​code>​ 
 +magento_dir/​shell/​litemage_purge.php 
 +</​code><​code>​ 
 +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. 
 +</​code>​
  
-The user might think how to exclude the price from the cache? No, not that way. LiteMage is not designed to exclude price block, which will slow down every page and make it not usable. Instead, for user's data feed, he can use "​lsws/​admin/​misc/​cleanlitemage.sh"​ to do purge for the related productions in his existing price change script. It can purge any particular product IDs, category_IDs,​ store_IDs, or raw tags. Please check [[litespeed_wiki:​cache:​litemage:​troubleshooting:​auto-flush|this wiki]] on how to use it.  
  
  
  • Admin
  • Last modified: 2018/06/15 15:33
  • by Jackson Zhang