Jump to content

Constant price per unit


Recommended Posts

Hello!

 

First of all, sorry for my english. I hope you will understand my question :P

 

So, I want to set a constant price per unit for each product in my shop. Now I have to calculate impact on price per unit for each product. That's big problem because prestashop is not supporting upgrading this value from CSV file. Now I have got about 2000 products in shop and I dont know what to do.

 

Is there any way to disable prestashop's calculations on price per unit? Just to force this variable to became constant?

Link to comment
Share on other sites

Hello,

 

This is a way to solve this problem. Maybe someone will be happy with that:

{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
{*
{math equation="pprice / punit_price" pprice=$productPrice  punit_price=$product->unit_price_ratio assign=unit_price}
<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_pricee}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p>
*}
{$unit_price = $product->base_price / $product->unit_price_ratio}
<p class="unit-price">{convertPrice price=$unit_price} {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p>
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}

Now, if I set price per Unit for product, it's constant also for all of combinations.

Link to comment
Share on other sites

×
×
  • Create New...