Jump to content

Prestashop Validator Issue in Prestashop Module Development


NishantVadgama

Recommended Posts

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 ..??

  • Like 1
Link to comment
Share on other sites

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. 

  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...