PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, June 30, 2022

[FIXED] How to reset cache and override in a PrestaShop custom module?

 June 30, 2022     php, prestashop, prestashop-1.7     No comments   

Issue

I am developping a PrestaShop (1.7.6) module that uses an override for the ps_emailsubscription native module.

However, as I am upgrading the module to a new version, I changed the override function and I know that when there is an override in a module, this override is only copied to the root override folder during the installation of the module.

Is there a way to specify that a new version of the override exist and forcing the update?

Also, in the same process, is there a way to force clear the cache during an upgrade?


Solution

You'll have to write your "override checking" routine and call it inside the upgrade.php file of your new module version release.

If you need to clear all cache you can call those core methods :

Tools::clearSmartyCache();
Tools::clearXMLCache();
Media::clearCache();

But this can be very time consuming, depending on the store's cache size.

If you just need to refresh overrides, I would suggest you to just remove the class_index.php file inside /var/cache/prod.



Answered By - user3256843
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing