删除字符" $"从产品视图

时间:2014-10-22 11:38:51

标签: javascript php jquery css3 opencart

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

提前感谢一大堆!

2 个答案:

答案 0 :(得分:1)

您可以使用trim()功能。

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

希望它有所帮助!

继续编码!

答案 1 :(得分:-1)

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

/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,以从其他项目中删除前缀/后缀(例如税)