Here's the block of code on the product page I need to hide if the price is zero.
Code: Select all
<?php if ($price) { ?>
<div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php echo $text_price; ?>
<?php if (!$special) { ?>
<span itemprop="price"><?php echo $price; ?></span>
<?php } else { ?>
<span class="price-old"><?php echo $price; ?></span> <span class="price-new" itemprop="price"><?php echo $special; ?></span>
<?php } ?>
<br />
<?php if ($tax) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
<?php } ?>
<?php if ($points) { ?>
<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
<?php } ?>
<?php if ($discounts) { ?>
<br />
<div class="discount">
<?php foreach ($discounts as $discount) { ?>
<?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
Code: Select all
<file name="catalog/view/theme/oc-bootstrap-pro/template/product/product.tpl">
<operation error="skip">
<search position="replace"><![CDATA[
<?php if ($price) { ?>
]]></search>
<add><![CDATA[
<?php if ($price) != $this->currency->format(0)) { ?>
]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[
<div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
]]></search>
<add><![CDATA[
<?php if ($price) != $this->currency->format(0)) { ?>
<div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php } ?>
]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[
<?php if ($price) != $this->currency->format(0)) { ?>
<div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php ?>
]]></search>
<add><![CDATA[
<div class="price" style="display:none;" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
]]></add>
</operation>
</file>
Code: Select all
<?php if ($price) { ?>