Jump to content

Edit History

taniacr

taniacr


Edited sugested code

On 12/13/2018 at 1:51 PM, antoine184 said:

Hello,

PS 1.7.4.4, theme classic, PHP version: 7.2.12, MySQL version: 5.7.21

I know that the subject has been treated several times but not on version 1.7 (or I did not find it and I'm sorry) but when I try to follow the subject that is on another version, either the code does not work, either the files no longer exists or the content is empty

On this version, I assumed that the file product-prices.tpl should be used in / shop / themes / classic / templates / catalog / _partials, I tried to put a if price! = 0 but that does not work (I tried enclosing the whole file or enclosing it

{block name = 'product_unit_price'} {if $ displayUnitPrice}
             <p class = "product-unit-price sub"> {ls = '(% unit_price%)' d = 'Shop.Theme.Catalog' sprintf = ['% unit_price%' => $ product.unit_price_full]} </ p>
           {/ If}
         {/ Block}

and it does not work)

Do you have an idea?

Thank you

Regards

Hi,

How about like this:

{if $product.price_amount eq "0"} 
<p> </p>
{else}
{block name='product_prices'}
   {include file='catalog/_partials/product-prices.tpl'}
{/block}
{/if}

 

taniacr

taniacr

On 12/13/2018 at 1:51 PM, antoine184 said:

Hello,

PS 1.7.4.4, theme classic, PHP version: 7.2.12, MySQL version: 5.7.21

I know that the subject has been treated several times but not on version 1.7 (or I did not find it and I'm sorry) but when I try to follow the subject that is on another version, either the code does not work, either the files no longer exists or the content is empty

On this version, I assumed that the file product-prices.tpl should be used in / shop / themes / classic / templates / catalog / _partials, I tried to put a if price! = 0 but that does not work (I tried enclosing the whole file or enclosing it

{block name = 'product_unit_price'} {if $ displayUnitPrice}
             <p class = "product-unit-price sub"> {ls = '(% unit_price%)' d = 'Shop.Theme.Catalog' sprintf = ['% unit_price%' => $ product.unit_price_full]} </ p>
           {/ If}
         {/ Block}

and it does not work)

Do you have an idea?

Thank you

Regards

Hi,

How about like this:

{if $product.price_amount eq "0"} 
<p>&nbsp;</p>
{else}
{block name = 'product_unit_price'} 
{if $ displayUnitPrice}
<p class = "product-unit-price sub"> {ls = '(% unit_price%)' d = 'Shop.Theme.Catalog' sprintf = ['% unit_price%' => $ product.unit_price_full]}</ p>
{/ If}
{/ Block}
{/if}

 

×
×
  • Create New...