JTimmer Posted November 3, 2024 Share Posted November 3, 2024 We have a relatively new shop. We discounted some products with end date and there was at the top of our frontpage a list of discounted products. The discounts expired 2 days ago but the products were still on the FP. When you clicked them you saw normal price. When I manually emptied the cache they disappeared from FP as one would expect. I expect this to work automatically. What can be wrong? V8.2 on Vimexx hosting (php 8.1, directadmin) Link to comment Share on other sites More sharing options...
endriu107 Posted November 3, 2024 Share Posted November 3, 2024 This is cache related issue. Module on home page probably caching it's configuration (products and other data) that why changes are visible after remove manually cache. Link to comment Share on other sites More sharing options...
JTimmer Posted November 3, 2024 Author Share Posted November 3, 2024 I checked it, it seems to be the ps_specials module. It's a native module right? Is this a bug? Link to comment Share on other sites More sharing options...
endriu107 Posted November 3, 2024 Share Posted November 3, 2024 It's hard to tell it is this module bug or other issue. Just for test you can change in this module method renderWidget to something like this: public function renderWidget($hookName = null, array $configuration = []) { $variables = $this->getWidgetVariables($hookName, $configuration); if (empty($variables)) { return false; } $this->smarty->assign($variables); return $this->fetch($this->templateFile); } Link to comment Share on other sites More sharing options...
JTimmer Posted November 4, 2024 Author Share Posted November 4, 2024 I'm not sure what to do with that code or how to test it after replacing some part. I just need to refresh the cache every now and then I guess. Can this be automated? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 5, 2024 Share Posted November 5, 2024 How discounts are made (cart rules, specific prices...)? Link to comment Share on other sites More sharing options...
JTimmer Posted November 5, 2024 Author Share Posted November 5, 2024 It's a Dutch shop, it's a specific price on the product page in the admin, with an end date. Maybe the English term is different? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 5, 2024 Share Posted November 5, 2024 il y a 17 minutes, JTimmer a dit : It's a Dutch shop, it's a specific price on the product page in the admin, with an end date. Maybe the English term is different? It's not really a bug, either a not implemented feature. When you add end date in a rule (cart or specific price) there is no hook to notify core/modules expiration arrived. According to me you have 3 solutions: As @endriu107 suggested you change module code to avoid caching (bad performances) You open and save every day module ps_specials, this delete cache (no vacations, no we, no disease... 😉) You develop a module that in cron task check for end of time rules and delete template cache of ps_specials module and index Link to comment Share on other sites More sharing options...
JTimmer Posted November 5, 2024 Author Share Posted November 5, 2024 Is there a supported way of adding temporary discounts? 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