如何在magento中对货币选择事件执行操作?
我在标题中有一个货币选择选项,如果用户选择美元,我想显示一条消息。我不知道如何解读这个事件。 我对magento相当陌生,任何帮助都将不胜感激如何在magento中对货币选择事件执行操作?,magento,Magento,我在标题中有一个货币选择选项,如果用户选择美元,我想显示一条消息。我不知道如何解读这个事件。 我对magento相当陌生,任何帮助都将不胜感激 谢谢。更改文件magento\app\code\core\Mage\Directory\controllers\CurrencyController.php 功能变化 public function switchAction() { if ($curency = (string) $this->getReq
谢谢。更改文件
magento\app\code\core\Mage\Directory\controllers\CurrencyController.php
功能变化
public function switchAction()
{
if ($curency = (string) $this->getRequest()->getParam('currency')) {
// add message
if($curency=="USD")
Mage::getSingleton('core/session')->addSuccess("your message");
Mage::app()->getStore()->setCurrentCurrencyCode($curency);
}
$this->_redirectReferer(Mage::getBaseUrl());
}
谢谢。你救了我的命:-)你能帮我再问一个问题吗。我的网站根据地理位置(通过IP地址)自动以货币显示产品价格。我需要为美国客户禁用美元价格,并将英镑作为英国和美国客户的默认货币。