Php 在OpenCart上使用vQmod计算并显示折扣价格

Php 在OpenCart上使用vQmod计算并显示折扣价格,php,opencart,vqmod,Php,Opencart,Vqmod,有一个php vqmod增加了一个人在数量上获得的折扣,但我还需要另一个“如果你与我们分享,可以享受15%的折扣,这里的新价格为美元” 我只需要修改PHP,使它采取正常的价格的项目,并计算出多少它的成本与15%的折扣,并显示折扣的价格。以下是phpvqmod的代码。有人能帮我吗 <?xml version="1.0" encoding="UTF-8"?> <modification> <code>you_save</code> &l

有一个
php vqmod
增加了一个人在数量上获得的折扣,但我还需要另一个
“如果你与我们分享,可以享受15%的折扣,这里的新价格为美元”

我只需要修改PHP,使它采取正常的价格的项目,并计算出多少它的成本与15%的折扣,并显示折扣的价格。以下是
phpvqmod
的代码。有人能帮我吗

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <code>you_save</code>
    <name>You Save OCMOD Product (edited red)</name>
    <version>1.1.0</version>
    <author>Sam custom</author>
    <link></link>
    <file path="catalog/controller/product/product.php">
        <operation>
            <search><![CDATA[
            $data['text_tags'] = $this->language->get('text_tags');
            ]]></search>
            <add position="after"><![CDATA[
            $data['text_you_save'] = $this->language->get('text_you_save');
            $data['text_you_save_or'] = $this->language->get('text_you_save_or');
            ]]></add>
        </operation>
        <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));
            ]]></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 { $you_save_or = round((($product_info['price'] - $discount['price']) / $product_info['price'] * 100)); }
            ]]></add>
        </operation>
        <operation>
            <search><![CDATA[
            'quantity' => $discount['quantity'],
            ]]></search>
            <add position="after"><![CDATA[
            'you_save' => $you_save,
            'you_save_or' => $you_save_or,
            ]]></add>
        </operation>
    </file>
    <file path="catalog/language/english/product/product.php">
        <operation>
            <search><![CDATA[
            // Entry
            ]]></search>
            <add position="before"><![CDATA[
            $_['text_you_save']     = 'You save:';
            $_['text_you_save_or']  = 'or';
            ]]></add>
        </operation>
    </file>
    <file path="catalog/view/theme/*/template/product/product.tpl">
        <operation>
            <search><![CDATA[
            <h2><?php echo $special; ?></h2>
            ]]></search>
            <add position="after"><![CDATA[
            </li><li><span style="font-size:12px;font-weight:600;color:red"><?php echo $text_you_save; ?></span> <span style="font-size:12px;font-weight:400"><?php echo $you_save; ?> <?php echo $text_you_save_or; ?> <?php echo $you_save_or; ?>%</span>
            ]]></add>
        </operation>
        <operation>
            <search><![CDATA[
            <li><?php echo $discount['quantity']; ?><?php echo $text_discount; ?><?php echo $discount['price']; ?></li>
            ]]></search>
            <add position="after"><![CDATA[
            <li><span style="font-size:12px;font-weight:600;color:red"><?php echo $text_you_save; ?></span> <span style="font-size:12px;font-weight:400"><?php echo $discount['you_save']; ?> <?php echo $text_you_save_or; ?> <?php echo $discount['you_save_or']; ?>%</span></li>
            ]]></add>
        </operation>
    </file>
</modification>