Vqmod problem
Posted: Wed Aug 14, 2019 1:23 am
Hi all. Can anyone help please. I'm using the OC Bootstrop Pro theme on a 1.5.6.5 based site running VQMOD 2.6.1. I'm trying to write a Vqmod that removes the price on the product page if the item is set to zero price. I'm almost there but can't get it to work. Can any of the clever ones of you point out my error please.
Here's the block of code on the product page I need to hide if the price is zero.
This is my Vqmod code:
I think it might have something to do with this bit:
It's driving me nuts and hopefully one of you can see my mistake. Thank you in advance. 
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) { ?>
