删除字符“”$";从产品的角度来看


Remove the character "$" from product view

我正在使用OpenCart 1.5.1.3.1,有一个快速问题。查看产品时,在产品页面上,我希望删除金额旁边的字符"$",例如"$20.00"到"20.00"。

提前感谢大家!

您可以使用trim()函数。

因此,您的值将被修剪为:trim($value, "$");

如何首先修复发送到视图的字符串:

/catalog/controllers/product/product.php中找到以下行(v1.5.6.4中的315行):

$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));

替换为:

$this->data['price'] = $this->currency->format($this->tax->calculate(6, $product_info['tax_class_id'], $this->config->get('config_tax')), '', '', false);

您可以将相同的参数, '', '', false添加到对$this->currency的其他调用的末尾,以从其他项目(例如税务)中删除前缀/后缀