Can't get this ocmod to work. I even paid someone to get this to work but I'm beginning to think he doesn't know as much about opencart/php as he says.
Parse error: syntax error, unexpected '{', expecting '(' in public_html/vqmod/vqcache/vq2-system_modification_catalog_controller_product_product.php on line 367
Line 365-368 this is the code:
$you_save = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')) - $this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
if ($product_info['price'] == 0) { $you_save_or = 0; }
else if { $you_save_or = round((($product_info['price'] - $discount['price']) / $product_info['price'] * 100)); } else
{ $text_you_discount = round($product_info['price'] - ($product_info['price']* 0.15));}
Here is the part of the ocmod/vqmod file that I'm editing but can't get it to work:
<operation>
<search><![CDATA[
$data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
]]></search>
<add position="after"><![CDATA[
$data['you_save'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')) - $this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
$data['you_save_or'] = round((($product_info['price'] - $product_info['special']) / $product_info['price'] * 100));
$data['text_you_discount'] = round($product_info['price'] - ($product_info['price']* 0.15));
]]></add>
</operation>
<operation>
<search><![CDATA[
foreach ($discounts as $discount) {
]]></search>
<add position="after"><![CDATA[
$you_save = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')) - $this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
if ($product_info['price'] == 0) { $you_save_or = 0; }
else if { $you_save_or = round((($product_info['price'] - $discount['price']) / $product_info['price'] * 100)); } else
{ $text_you_discount = round($product_info['price'] - ($product_info['price']* 0.15));}
]]></add>
</operation>