无法让这个 ocmod 工作。我什至付钱让某人让它工作,但我开始认为他并不像他所说的那样了解 opencart/php。
解析错误:语法错误,意外的 '{',在第 367 行的 public_html/vqmod/vqcache/vq2-system_modification_catalog_controller_product_product.php 中期待 '('
第 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>