简体   繁体   中英

Prestashop override Shop class

I override the Shop class and i put in mymodule/override/classes

class Shop extends ShopCore
{
   public function __construct($id = null, $id_lang = null, $id_shop = null)
   {
       parent::__construct($id, $id_lang, $id_shop);
   }

   public static function someMethod()
   {

   }

}

When i call someMethod in front controller i get the error :

Call to undefined method Shop::someMethod()

Its possible in prestashop to add a static method to override class?

Thanks.

The installation of the module should copy the /mymodule/override/classes/Shop.php to /override/classes but it doesnt.

The correct location of the override is in /mymodule/override/classes/shop/Shop.php instead of /mymodule/override/classes/Shop.php

Now the installation of module copies the file to the correct directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM