Good morning.
I Wear weeks Desiring to provide an percentage increase in between attributes and given the dilemmas that are in the "solutions" that I have researched ... there will be future problems on the day that you upgrade to newer versions of PS. So I try to touch as little as possible the core.
Thanks to this trick, rescued of the "kitchendraw" user from the generator of combinations you can add a percentage of the base price using values of 0.01 to 0.99. The problem comes when one of the attributes does not take price (usually the first), and therefore, the price ends up leaving of those combinations to 0. Someone could give me an example of how to add the base price for this formula only when one of the attributes is 0??
Pardon my english.
Thank you very much beforehand.
File: /controllers/admin/AdminAttributeGeneratorController.php (Prestashop 1.5.6.X)
{
$myprice = (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
if (($myprice <= 1) && ($myprice > 0))
{
$price = (($price * $myprice) + $price);
}
else
{
$price += $myprice;
}
$weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact'.(int)$attribute)));
}