Pracuje nad sklepem internetowym na silniku PrestaShop™ 1.5.6.0. W pliku szablonu product.tpl, który wyświetla zdjęcie, opis, cenę przycisk do koszyka danego produktu, chciałbym wprowadzić jedną zmianę. To znaczy, chciałem dodać kod, dzięki któremu, jeśli cena = 0, to nie wyświetli się cena i przycisk dodaj do koszyka.
Poniżej załączam wycinek pliku tpl odpowiedzialny za wyswietlanie ceny i proszę o pomoc. Co i jak dodać, w razie czego cały plik wyślę jakoś na pw, bo tu nie moge wkleic (jest za długi)
  1. <div class="product_price">
  2. <!-- prices -->
  3. {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
  4.  
  5.  
  6. <p class="our_price_display" {if $enable_google_rich_snippets} itemtype="http://schema.org/Offer" itemscope="" itemprop="offers" {/if}>
  7. {if $priceDisplay >= 0 && $priceDisplay <= 2}
  8. <span id="our_price_display" {if $enable_google_rich_snippets} itemprop="price" {/if}>{convertPrice price=$productPrice}</span>
  9. {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label)) && (isset($sttheme.display_tax_label) && $sttheme.display_tax_label)}
  10. <span class="product_tax_label">{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}</span>
  11. {/if}
  12. {/if}
  13. </p>
  14.  
  15.  
  16. {if $priceDisplay == 2}
  17. <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
  18. {/if}
  19.  
  20. <p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display" class="sale_percentage">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p>
  21. <p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|intval ==0} style="display:none"{/if}>
  22. <span id="reduction_amount_display" class="sale_percentage">
  23. {if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' AND $product->specificPrice.reduction|intval !=0}
  24. -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
  25. {/if}
  26. </span>
  27. </p>
  28. <p id="old_price"{if !$product->specificPrice || !$product->specificPrice.reduction} class="hidden"{/if}>
  29. {if $priceDisplay >= 0 && $priceDisplay <= 2}
  30. <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
  31. <!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
  32. {/if}
  33. </p>
  34.  
  35. <div class="clearit mar_b10" ></div>
  36. {if $packItems|@count && $productPrice < $product->getNoPackPrice()}
  37. <p class="pack_price">{l s='Instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
  38. <br class="clear" />
  39. {/if}
  40. {if $product->ecotax != 0}
  41. <p class="price-ecotax">{l s='Include'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormat
    Price}{/if}</span> {l s='For green tax'}
  42. {if $product->specificPrice AND $product->specificPrice.reduction}
  43. <br />{l s='(not impacted by the discount)'}
  44. {/if}
  45. </p>
  46. {/if}
  47. {if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
  48. {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}
  49. <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}</p>
  50. {/if}
  51. {if $product->online_only}
  52. <p class="online_only">{l s='Online only'}</p>
  53. {/if}
  54. {*close if for show price*}
  55. {/if}
  56. </div>