Domin1992 Posted July 8, 2016 Share Posted July 8, 2016 Hi, I've created module and i put there override class Address. What i want is add new variable to class definition after i add manually column to database address table. File location is: /module/integrator/override/classes/Address.php. Address.php <?php class Address extends AddressCore{ public $id_integrator_address; public function __construct($id_address = null, $id_lang = null) { parent::__construct($id_address); $this->$definition = array_merge($this->definition['fields'], array('id_integrator_address' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'))); } } Error: Accessing static property Address::$definition as non static I have no idea how to merge my new variable with class definition. It needs to be in my module, i don't want to make any changes on core files. Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2016 Share Posted July 8, 2016 Try this: http://nemops.com/extending-prestashop-objects/#.V39kafn5jmgDefinition is static 1 Link to comment Share on other sites More sharing options...
Domin1992 Posted July 20, 2016 Author Share Posted July 20, 2016 It works well now, thank you 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