Skip to content

Commit 851f811

Browse files
committed
ACP2E-1290: Cart Rule discount issue on shipping price
1 parent 9ef43a5 commit 851f811

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

app/code/Magento/SalesRule/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,4 @@ Apply,Apply
168168
"Trigger recollect totals for quotes by rule ID %1","Trigger recollect totals for quotes by rule ID %1"
169169
"Sorry, something went wrong while triggering recollect totals for affected quotes. Please see log for details.","Sorry, something went wrong while triggering recollect totals for affected quotes. Please see log for details."
170170
"When coupon quantity exceeds %1, the coupon code length must be minimum %2", "When coupon quantity exceeds %1, the coupon code length must be minimum %2"
171+
"Discount amount is distributed among subtotal and shipping amount. Cases when multiple discounts applied to shipping amount are not supported. The option is going to be removed in future releases.ly","Discount amount is distributed among subtotal and shipping amount. Cases when multiple discounts applied to shipping amount are not supported. The option is going to be removed in future releases."

app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@
472472
<item name="0" xsi:type="string" translate="true">Discount amount is applied to subtotal only</item>
473473
<item name="1" xsi:type="string" translate="true">Discount amount is applied to subtotal and shipping amount separately</item>
474474
</item>
475+
<item name="noticePerSimpleAction" xsi:type="array">
476+
<item name="cart_fixed" xsi:type="string" translate="true">Discount amount is distributed among subtotal and shipping amount. Cases when multiple discounts applied to shipping amount are not supported. The option is going to be removed in future releases.</item>
477+
</item>
475478
</item>
476479
</argument>
477480
<settings>

app/code/Magento/SalesRule/view/adminhtml/web/js/form/element/apply_to_shipping.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ define([
1212
defaults: {
1313
imports: {
1414
toggleDisabled: '${ $.parentName }.simple_action:value'
15-
}
15+
},
16+
noticePerSimpleAction: {},
17+
selectedSimpleAction: ''
1618
},
1719

1820
/**
@@ -29,6 +31,21 @@ define([
2931
if (this.disabled()) {
3032
this.checked(false);
3133
}
34+
this.selectedSimpleAction = action;
35+
this.chooseNotice();
36+
},
37+
38+
/**
39+
* @inheritdoc
40+
*/
41+
chooseNotice: function () {
42+
var checkedNoticeNumber = Number(this.checked());
43+
44+
if (checkedNoticeNumber === 1 && this.noticePerSimpleAction.hasOwnProperty(this.selectedSimpleAction)) {
45+
this.notice = this.noticePerSimpleAction[this.selectedSimpleAction];
46+
} else {
47+
this._super();
48+
}
3249
}
3350
});
3451
});

0 commit comments

Comments
 (0)