maersk Posted March 6, 2018 Share Posted March 6, 2018 (edited) The prestashop module ps_categoryproducts doesn't refresh translations/currency when the shop/language is changed. If loaded in english it stays in english. When changing the language afterwards to e.g. german, it still displays in english. When i delete the modules cache it resets as it should. Why am i having this problem? Edited March 11, 2018 by maersk (see edit history) Link to comment Share on other sites More sharing options...
maersk Posted March 11, 2018 Author Share Posted March 11, 2018 To anyone looking for a solution, here it is: In the modules main file ps_categoryproducts.php search for the variable cache_id As you can see, the cache id for some reason doesn't take the current language/store into account. To fix this, simply add another dimension by adding the current shop id obtained with $this->context->shop->id Now every category product template is being cached for each shop. Link to comment Share on other sites More sharing options...
Impe-M Posted April 9, 2018 Share Posted April 9, 2018 Hi, i've the same problem with PS 1.7.2 and i've resolved in a different way. In file /themes/MYTHEME/modules/ps_categoryproducts/views/templates/hook/ps_categoryproducts.tpl i've changed this -> d='Modules.Categoryproducts.Shop' into this --> d='Shop.Theme.Catalog' In this way, I can tranlsate this word in my template translations. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted August 17, 2018 Share Posted August 17, 2018 Not working for me maersk :-( The solution for me was to use the language id $cache_id = 'ps_categoryproducts|'.$this->context->language->id.'|'.$id_product.'|'.$id_category; And don't forget to clear cache after changing ps_categoryproducts.php . Hope this help. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 1, 2018 Share Posted November 1, 2018 Finally the solution for all cases is : $cache_id = 'ps_categoryproducts|'.$this->context->shop->id.'|'.$this->context->language->id.'|'.$id_product.'|'.$id_category; Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 19, 2018 Share Posted November 19, 2018 After several tests the right fix is to use the native Prestashop cache method. So don't change like above. Juste change in file modules/ps_categoryproducts/ps_categoryproducts.php at line 349: 'cache_id' => $cache_id, by 'cache_id' => $this->getCacheId($cache_id), This solve all cache issues with this module. Don't forget to clear cache. 1 1 Link to comment Share on other sites More sharing options...
Henrik41 Posted August 31, 2021 Share Posted August 31, 2021 Didn't solve my issue infortunatly Link to comment Share on other sites More sharing options...
prestaowner20 Posted March 1, 2022 Share Posted March 1, 2022 (edited) Worked for me Edited March 1, 2022 by prestaowner20 (see edit history) 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