NishantVadgama Posted October 11, 2014 Share Posted October 11, 2014 Hello Dear All Prestashop Experts I want to ask you all that before upload module in http://addons.prestashop.com/en/. I must have to validate my module in https://validator.prestashop.com but when I am validating my module prestashop validator gives me some prestashop parent class or controller that I have been overrided in my module's error like in my module some requirement of overriding cart.php class file in that only two methods named "getProducts()" and "getOrderTotal()". in that prestashop validator gives me following errors in standards Standards /override/classes/Cart.php Variable "->_taxCalculationMethod" have not right syntax. Should be: "->tax_calculation_method" 165: if ($this->_taxCalculationMethod == PS_TAX_EXC) 427: if ($this->_taxCalculationMethod == PS_TAX_EXC) Variable "$_attributesLists" have not right syntax. Should be : "$attributes_lists" 312: if (array_key_exists($row['id_product_attribute'].'-'.$this->id_lang, self::$_attributesLists)) 313: $row = array_merge($row, self::$_attributesLists[$row['id_product_attribute'].'-'.$this->id_lang]); as we know that we cant change base class or parent class member variables name so How can I resolve this ..?? 1 Link to comment Share on other sites More sharing options...
PascalVG Posted October 11, 2014 Share Posted October 11, 2014 Can you show the overriding class - contents you created? Link to comment Share on other sites More sharing options...
NemoPS Posted October 11, 2014 Share Posted October 11, 2014 In your override, did you try changing this $this->_taxCalculationMethod to $this->tax_calculation_method ? Link to comment Share on other sites More sharing options...
bellini13 Posted October 11, 2014 Share Posted October 11, 2014 Nemo, I think you are missing the point. He is trying to override the parent class variable which is named _taxCalculationMethod 1 Link to comment Share on other sites More sharing options...
NemoPS Posted October 11, 2014 Share Posted October 11, 2014 Ok, but then I don't get this error: Variable "->_taxCalculationMethod" have not right syntax. Should be: "->tax_calculation_method" Is the validator non accepting camelcase anymore? Link to comment Share on other sites More sharing options...
bellini13 Posted October 11, 2014 Share Posted October 11, 2014 apparently so, since that is the issue the user is reporting Link to comment Share on other sites More sharing options...
NishantVadgama Posted October 13, 2014 Author Share Posted October 13, 2014 In your override, did you try changing this $this->_taxCalculationMethod to $this->tax_calculation_method ? but how can I change this parent class's member variable and if I change to "$this->tax_calculation_method". if I do so then may it will not work as default or gives error also. 1 Link to comment Share on other sites More sharing options...
bellini13 Posted October 13, 2014 Share Posted October 13, 2014 Your only recourse is to reply to the decline message, or resubmit your module and provide a message to the addons team. Tell them it is not possible to change the variable name. Explain you are trying to override the Cart class which contains the 'invalid variable name' and that you have to use the same name in order for your function to work properly. They do not like overrides to begin with, and they generally are blind to exceptions to their validations, so good luck 1 Link to comment Share on other sites More sharing options...
NishantVadgama Posted October 14, 2014 Author Share Posted October 14, 2014 Your only recourse is to reply to the decline message, or resubmit your module and provide a message to the addons team. Tell them it is not possible to change the variable name. Explain you are trying to override the Cart class which contains the 'invalid variable name' and that you have to use the same name in order for your function to work properly. They do not like overrides to begin with, and they generally are blind to exceptions to their validations, so good luck thank you so much for this guide. 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