jose@myeasygest Posted November 11, 2016 Share Posted November 11, 2016 Hello: I have a problem with a new class of its own that the prestashop system does not copy in its override directory from the system root, this file is located in the override / classes / Myclass.php directory of my module. I use this new class to access by webservice and I have another WebserviceRequest.php file in override / classes / webservice / WebserviceRequest.php and this file if I copy it well. At this point the new class appears as an option in the webservice configuration list to give permissions on it, but when you try to access the webservice it gives an error because it can not find the class. If I manually copy the override / classes / Myclass.php file into the root override this works fine. My question is how to run the override from the modules with new classes? MyClass.php: class MyClass extends ObjectModel { public $id_My_Class; public $action; public $status; public function __construct($full = false, $id_lang = null, $id_shop = null, Context $context = null) { $this->webserviceParameters['My_Class'] = array('fields' => array('action' => array('required' => true),'status' => array('required' => false) )); parent::__construct($full, $id_lang, $id_shop, $context); } protected $webserviceParameters = array(); public static $definition = array( 'table' => 'My_Class', 'primary' => 'id_My_Class', 'fields' => array( 'action' => array('type' => self::TYPE_STRING, 'required' =>true), 'status' => array('type' => self::TYPE_STRING, 'required' =>false) ) ); } Link to comment Share on other sites More sharing options...
jose@myeasygest Posted November 14, 2016 Author Share Posted November 14, 2016 When you create a new override file, do you also remove the file /class/cache_index.php every time in order to generate a new class index? Thanks mdekker, I know it and I do it but prestashop does not overrride of with my new class. Link to comment Share on other sites More sharing options...
jose@myeasygest Posted November 14, 2016 Author Share Posted November 14, 2016 Ok thanks that was my question, can I make override on new classes or do I have to do only existing ones? It seems that if you do not exiting classes does not do well. I will try to rewrite the class extending from another existing as customer. 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