Post by Bojanrihta » Sun Jan 11, 2015 1:55 am

Hi,
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>
For price show the baner but by special I have This Error!

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	
Thanks
Bojan

Newbie

Posts

Joined
Fri Aug 30, 2013 2:46 am

Post by Qphoria » Thu Jan 15, 2015 2:32 am

check the vqmod/logs folder. My guess is the controller change is failing but the tpl change is working

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 5 guests