Error calculating the price of the product PrestaShop

prestashop

The current version of PrestaShop 1.6.1.8 does not show the price of the product properly when we change the value of an attribute that affects the price change. Until PrestaShop developers do not publish a new version with this bug fixed, we at Doowebs have applied the following solution:

First I explained the good practices we will make an override of controller products, by copying the file:

/controllers/front/ProductController.php

in

/override/controllers/front/ProductController.php

Once we have prepared to modify the file, open the file and look ProductController.php the following code:

$combinations[$row[‘id_product_attribute’]][‘price’] = (float)Tools::convertPriceFull($row[‘price’], null, Context::getContext()->currency);

This replace it with:

$combinations[$row['id_product_attribute']]['price'] = (float)$row['price'];

Once this change we climb the file /override/controllers/front/ProductController.php

Now it works correctly calculating the price when we change the value of the attribute.

ps-combinacion-producto

Llamar a Doowebs Teléfono de Doowebs 653836347