Jump to content

PHP Warning: Missing argument 4 ProductControllerCore


thx2012

Recommended Posts

PS v.1.6.0.9

error_log displays pHp warning..

 

PHP Warning:  Missing argument 4 for ProductControllerCore::formatQuantityDiscounts(), called in /home/xxxxx/public_html/override/controllers/ProductController.php on line 141 and defined in /home/xxxxx/public_html/controllers/front/ProductController.php on line 690

 

Can someone please advise me on how to resolve these errors?

 

Link to comment
Share on other sites

The override is broken.

 

protected function formatQuantityDiscounts($specific_prices, $price, $tax_rate, $ecotax_amount)

 

You are missing the 4th parameter, ecotax amount

Reach that line of the override and add the proper number (0?) or variable ($ecotax_amount)

Link to comment
Share on other sites

Here are the codes for the two files..

line 690 seems to be as you mentioned..

line 141 has no mention of $ecotax, other than line 142. See bellow.

 
/override/controllers/ProductController.php on line 141

'quantity_discounts' => $this->formatQuantityDiscounts(SpecificPrice::getQuantityDiscounts((int)$this->product->id, (int)Shop::getCurrentShop(), (int)self::$cookie->id_currency, $id_country, $id_group), $this->product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, false), (float)$tax),

/override/controllers/ProductController.php on line 142 - 156

'product' => $this->product,
'ecotax_tax_inc' => $ecotaxTaxAmount,
'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2),
'ecotaxTax_rate' => $ecotax_rate,
'homeSize' => Image::getSize('home'),
'product_manufacturer' => new Manufacturer((int)$this->product->id_manufacturer, self::$cookie->id_lang),
'token' => Tools::getToken(false),
'productPriceWithoutEcoTax' => (float)($productPriceWithoutEcoTax),
'features' => $features,
'attachments' => $attachments,
'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)($this->product->out_of_stock)),
'last_qties' =>  (int)Configuration::get('PS_LAST_QTIES'),
'group_reduction' => (1 - $group_reduction),
'col_img_dir' => _PS_COL_IMG_DIR_,
));

/controllers/front/ProductController.php on line 690

protected function formatQuantityDiscounts($specific_prices, $price, $tax_rate, $ecotax_amount)

Thanks for your attention in this matter!

Link to comment
Share on other sites

×
×
  • Create New...