问题描述
当我要通过 checkout_cart_product_add_after Observer 中的以下方法将自定义价格添加到购物车项目时,它工作正常,但是当我要从购物车更改货币时,价值不会按汇率转换,因此任何其他方式添加自定义购物车项目购物车价格。
$customPrice = $getSlectedAttrOptions['current_price'];
$item->setCustomPrice($origCustomPrice);
$item->setoriginalCustomPrice($origCustomPrice);
$item->getProduct()->setIsSuperMode(true);
解决方法
请看这个:
https://github.com/magento/magento2/issues/12493#issuecomment-352038477
似乎自定义价格仅用于管理区域,不考虑货币变化。