你可以在这里找到代码:
/catalog/model/checkout/order.php
这是:
// Order Totals
$order_total_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total` WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order ASC");
foreach ($order_total_query->rows as $total) {
$data['totals'][] = array(
'title' => $total['title'],
'text' => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),
);
}
只需使用 VQmod 将值索引添加到数组中。
转到 VQmod 文件夹中的 xml 文件夹
创建一个文件,将其命名为您想要的名称并在其中写入以下行:
<modification>
<id>Get Value Without Formatting</id>
<version>OC 2</version>
<vqmver>1.0.0</vqmver>
<author>Your Name</author>
<file name="catalog/model/checkout/order.php">
<operation>
<search position="before"><![CDATA['text' => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),]]></search>
<add><![CDATA[
'value' => $order_info['currency_value'] ? ((float)$total['value'] * $order_info['currency_value']) : $total['value'],
]]></add>
</operation>
</file>