Can anyone help me to solve the problem! Used with Opencart 2.0.0.0. What is wrong in thic code.
Code: Select all
<file path="catalog/controller/product/product.php">
<operation info="Add Free Shipping Controller">
<search position="after" offset="2"><![CDATA[$data['special'] = false;]]></search>
<add><![CDATA[$freeshipping = false;
if ((float)$product_info['special']) {
if ($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')) > 60) {
$freeshipping = true;
}
} else {
if ($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')) > 60) {
$freeshipping = true;
}
}
$data['freeshipping'] = $freeshipping;]]></add>
</operation>
</file>
<file path="catalog/view/theme/default/template/product/product.tpl">
<operation info="Add Free Ship Flag To Product.tpl">
<search position="after" offset="8"><![CDATA[<h2><?php echo $price; ?>]]></search>
<add><![CDATA[<div id="freeship-flag">
<?php if ($freeshipping) { ?>
<img src="http://www.reef-shop.eu/image/free-shipping-flag.jpg" alt="Free Shipping"></div>
<?php } else { ?>
<?php } ?></h2>]]></add>
</operation>
</file>
Code: Select all
Notice: Undefined variable: freeshipping in /var/zpanel/hostdata/zadmin/public_html/reefshop_eu/vqmod/vqcache/vq2-catalog_view_theme_default_template_product_product.tpl on line 184
Bojan