Jump to content

[Solved] Overriding class in Prestashop 1.5.5


Recommended Posts

Steps:

1- First copy the class file from classes/class file name to override/classes/class file name

2- Remove the cache/class_index.php file

3 Then refresh the home page (Press CTRL + F5), now new file of class_index.php will be automatically created

 

So customized override class file will now work :)

  • Like 3
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 2 months later...
  • 3 weeks later...
  • 1 year later...

Hello  :)

 

How can you override module default PHP file behavior, for example for "cashondelivery.php"? Because if i copy this file into "override/modules/cashondelivery/cashondelivery.php" and make some changes within one function, i get fatal error below.

 

What am i doing wrong? What is the proper way to override a specific class function for modules?

 

Thank you and best regards,

Housy

 

 

Fatal error: Cannot redeclare class CashOnDelivery in /home/myusername/public_html/TESTSHOP1714/override/modules/cashondelivery/cashondelivery.php on line 147

 

Link to comment
Share on other sites

I renamed overrided class to something else and i don't get this error anymore.

 

Hello  :)

 

How can you override module default PHP file behavior, for example for "cashondelivery.php"? Because if i copy this file into "override/modules/cashondelivery/cashondelivery.php" and make some changes within one function, i get fatal error below.

 

What am i doing wrong? What is the proper way to override a specific class function for modules?

 

Thank you and best regards,

Housy

Edited by Housy (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...