如何使货币显示在opencart的产品页面上? [英] How to get currency to show on product page in opencart?
问题描述
我想在产品描述页面上显示货币列表.我该怎么办?
I want to display the currency list on the product description page. How can I do that?
我从header.tpl()复制了代码,并将其粘贴到product.tpl中,但出现错误:
I copied the code from header.tpl () and pasted it in the product.tpl but I get an error:
注意:未定义的变量:第60行的C:\ xampp \ htdocs \ mysite.com \ catalog \ view \ theme \ mytheme \ template \ product \ product.tpl中的货币.
Notice: Undefined variable: currency in C:\xampp\htdocs\mysite.com\catalog\view\theme\mytheme\template\product\product.tpl on line 60.
我尝试在product.tpl中添加以下代码.
I tried adding the following code in product.tpl.
<?php include(DIR_APPLICATION.'\view\theme\mytheme\template\module\currency.tpl');
但是那也不起作用.请帮忙,因为我想让它正常工作.
but that did not work either. Please help as I want to get this working.
推荐答案
controller/common/header.php函数index()添加到:
controller/common/header.php function index() add in to:
$this->data['mygetcurrency'] = $this->currency->getCode();
catalog \ view \ theme \ default \ template \ common \ header.tpl添加到:
catalog\view\theme\default\template\common\header.tpl add in to:
<?php echo $mygetcurrency; ?>
//EUR
这篇关于如何使货币显示在opencart的产品页面上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!