OCmod/VQmod OpenCart PHP ошибка синтаксического анализа: синтаксическая ошибка, неожиданный '{', ожидающий '('
Не могу заставить этот ocmod работать. Я даже заплатил кому-то, чтобы заставить это работать, но я начинаю думать, что он не знает так много об opencart / php, как он говорит.
Ошибка разбора: синтаксическая ошибка, неожиданное '{', ожидаемое '(' в public_html/vqmod/vqcache/vq2-system_modification_catalog_controller_product_product.php в строке 367
Строка 365-368 это код:
$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));}
Вот часть файла ocmod/vqmod, который я редактирую, но не могу заставить его работать:
<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>