GroundSurfer Posted Saturday at 07:12 PM Share Posted Saturday at 07:12 PM Hello, I am still using PS 1.7.7.3 (sorry). I am adding a special price with "Db::getInstance()->insert('specific_price', $data);". Database entry looks perfect/ Admin-backend entry, too. The problem: There is no price change in the shop front. If I add a (second) special price with the admin site, save and delete this, then the first manually added special price is correctly shown in the frontend. I guess it's a cache problem? So I tried: Product::flushCache($id_product); Product::updatePrice($id_product); Product::clearProductCache($id_product); ... but no luck. Can anyone help me what to do? Thank you very much! Best regards, Holger Link to comment Share on other sites More sharing options...
cocos.codes Posted Sunday at 10:25 AM Share Posted Sunday at 10:25 AM Use the SpecificPrice class instead of pure SQL Let me know if it helped. $sp = new SpecificPrice(); $sp->id_product = (int)$id_product; $sp->id_shop = 0; $sp->id_shop_group = 0; $sp->id_currency = 0; $sp->id_country = 0; $sp->id_group = 0; $sp->id_customer = 0; $sp->price = -1; // -1 = does not overwrite the base price $sp->reduction_type = 'amount'; // or 'percentage' $sp->reduction = 10; // ex. -10 zł $sp->from = '2025-09-14 00:00:00'; $sp->to = '2025-12-31 23:59:59'; $sp->add(); Link to comment Share on other sites More sharing options...
Knowband Plugins Posted 22 hours ago Share Posted 22 hours ago Try this to clear the static price cache. SpecificPrice::flushCache(); Link to comment Share on other sites More sharing options...
GroundSurfer Posted 19 hours ago Author Share Posted 19 hours ago Hello, thank you "Know Band" and "cocos.codes" for helping me! Adding "SpecificPrice::flushCache();" to my existing code worked and also the code provided by "cocos.codes". Best regards, Holger Link to comment Share on other sites More sharing options...
Tivimadaim Posted 16 hours ago Share Posted 16 hours ago (edited) Directly adding to the specific_price table does not update the cache, so prices are not displayed. Using the SpecificPrice class and clearing the cache via SpecificPrice::flushCache() should help. Edited 16 hours ago by Tivimadaim (see edit history) Link to comment Share on other sites More sharing options...
cocos.codes Posted 14 hours ago Share Posted 14 hours ago I'm glad the problem has been solved. If you need anything else, I'm here to help 🙂 You can mark the topic as [SOLVED]. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now