我正在尝试在 opencart.com 的购物车中创建一个您保存的选项。我已经使用 vqmod 完成了与您保存相同的功能以显示在产品页面中。但我发现购物车很难做到这一点。这是我的 vqmod 代码,用于在产品页面中添加您的保存选项。
<modification>
<id><![CDATA[@tik Savings Note]]></id>
<version><![CDATA[1.1]]></version>
<vqmver><![CDATA[2.1.7]]></vqmver>
<author><![CDATA[OC2PS]]></author>
<file name="catalog/view/theme/default/template/product/product.tpl">
<operation>
<search position="before" offset="2" error="log"><![CDATA[<?php if ($tax) { ?>]]></search>
<add><![CDATA[<br /><span class="you-save" style="color:red;"><?php echo $text_yousave; ?> <?php echo $yousave; ?></span>]]></add>
</operation>
</file>
<file name="catalog/language/english/product/product.php">
<operation>
<search position="replace" error="log"><![CDATA[// Entry]]></search>
<add><![CDATA[$_['text_yousave'] = 'You save:';// Entry]]></add>
</operation>
</file>
<file name="catalog/controller/product/product.php">
<operation>
<search position="replace" error="log"><![CDATA[$data['text_tax'] = $this->language->get('text_tax');]]></search>
<add><![CDATA[$data['text_tax'] = $this->language->get('text_tax');
$data['text_yousave'] = $this->language->get('text_yousave');]]></add>
</operation>
<operation>
<search position="replace" error="log"><![CDATA[$data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));]]></search>
<add><![CDATA[$data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
$data['yousave'] = $this->currency->format($this->tax->calculate($product_info['price']-$product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
$data['yousavepercent'] = round(($product_info['price']-$product_info['special'])*100/$product_info['price'],0);]]></add>
</operation>
<operation>
<search position="replace" error="log"><![CDATA[$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));]]></search>
<add><![CDATA[$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
$yousave = $this->currency->format($this->tax->calculate($result['price']-$result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
$yousavepercent = round(($result['price']-$result['special'])*100/$result['price'],0);]]></add>
</operation>
</file>
</modification>