ad3r Posted November 3, 2020 Share Posted November 3, 2020 Hi, I would add field into class SpecificPriceRuleCore i create the file SpecificPriceRule.php in the path /override/classes/ how can we add a field in the static $definition I see the new field on the Backoffice but I cannot save the value entered here is my code: class SpecificPriceRule extends SpecificPriceRuleCore { public $lang_shop; SpecificPriceRule::$definition['lang_shop'] = array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isInt'); } I have this error please check attached file screenshot thank you. Link to comment Share on other sites More sharing options...
rrataj Posted November 3, 2020 Share Posted November 3, 2020 Please try: class SpecificPriceRule extends SpecificPriceRuleCore { public $lang_shop; public function __construct($id = null, $id_lang = null) { self::$definition['fields']['lang_shop'] = array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isInt'); parent::__construct($id, $id_lang); } } Link to comment Share on other sites More sharing options...
ad3r Posted November 3, 2020 Author Share Posted November 3, 2020 it works perfectly thank you. Link to comment Share on other sites More sharing options...
rrataj Posted November 4, 2020 Share Posted November 4, 2020 You're welcome 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