【问题标题】:Custom price for cart item not converting based on currency Magento 2购物车商品的自定义价格未根据货币 Magento 2 转换
【发布时间】: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


【解决方案1】:

请看这个:

https://github.com/magento/magento2/issues/12493#issuecomment-352038477

好像只在管理区使用自定义价格,没有考虑货币变化。

您可以尝试thisthis(对我的经验没有帮助,并且编辑核心文件不是我们最好的)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-21
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多