【发布时间】:2021-02-04 07:34:10
【问题描述】:
当我要通过 checkout_cart_product_add_after 观察者中的以下方法将自定义价格添加到购物车项目时,它工作正常,但是当我要从购物车更改货币时,价值不会按照汇率转换,所以任何其他方式添加自定义购物车项目价格到购物车。
$customPrice = $getSlectedAttrOptions['current_price'];
$item->setCustomPrice($origCustomPrice);
$item->setOriginalCustomPrice($origCustomPrice);
$item->getProduct()->setIsSuperMode(true);
【问题讨论】:
-
$customPrice = $getSlectedAttrOptions['current_price'];在设置为产品之前,您必须转换为自定义价格以期望货币
-
喜欢这个 $origCustomPrice = $this->_customizationHelper->convertPrice($customPrice,$currentCurrency,$baseCurrency);?
-
是的@Tarunmodi。
-
所有货币的显示仍然相同
标签: php product customization cart magento-2.3