Magento2 在刷新后的结帐付款步骤应用优惠券代码按钮
Magento2 apply coupon code button at checkout payment step after refresh
我正在使用 Magento2 EE 2.1.3。
在其中,当我在付款步骤的结帐页面应用优惠券代码时,它运行完美,按钮文本从 'Apply Discount' 更改为 'Cancel Coupon'。但是当我再次刷新页面按钮时,更改为 'Apply Discount'.
我不确定这是 Magento2 EE 2.1.3 问题还是自定义主题问题。所以首先,我将相关的 js 文件 vendor/magento/module-sales-rule/view/frontend/web/js/view/payment/discount.js 复制到相关位置的自定义主题中,然后在第 18 行
处进行更改
来自
couponCode = ko.observable(null)
到
couponCode = ko.observable(totals()['coupon_code'])
我正在使用 Magento2 EE 2.1.3。
在其中,当我在付款步骤的结帐页面应用优惠券代码时,它运行完美,按钮文本从 'Apply Discount' 更改为 'Cancel Coupon'。但是当我再次刷新页面按钮时,更改为 'Apply Discount'.
我不确定这是 Magento2 EE 2.1.3 问题还是自定义主题问题。所以首先,我将相关的 js 文件 vendor/magento/module-sales-rule/view/frontend/web/js/view/payment/discount.js 复制到相关位置的自定义主题中,然后在第 18 行
处进行更改来自
couponCode = ko.observable(null)
到
couponCode = ko.observable(totals()['coupon_code'])