当我要通过 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
似乎自定义价格仅在管理区域使用,并且不考虑货币变化。