Skip to content

Commit 18b319c

Browse files
committed
MC-19515: Cart price rule based on payment methods not applied in checkout
- Fix static
1 parent c8f7654 commit 18b319c

File tree

7 files changed

+7
-45
lines changed

7 files changed

+7
-45
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.enabled}}" stepKey="enableFreeShippingMethod" />
2525
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.hundred}}" stepKey="setFreeShippingMethodMinimumOrderAmountToBe100" />
2626

27-
<!--Set Fedex configs data-->
28-
<magentoCLI command="config:set {{AdminFedexEnableForCheckoutConfigData.path}} {{AdminFedexEnableForCheckoutConfigData.value}}" stepKey="enableCheckout"/>
29-
<magentoCLI command="config:set {{AdminFedexEnableSandboxModeConfigData.path}} {{AdminFedexEnableSandboxModeConfigData.value}}" stepKey="enableSandbox"/>
30-
<magentoCLI command="config:set {{AdminFedexEnableDebugConfigData.path}} {{AdminFedexEnableDebugConfigData.value}}" stepKey="enableDebug"/>
31-
<magentoCLI command="config:set {{AdminFedexEnableShowMethodConfigData.path}} {{AdminFedexEnableShowMethodConfigData.value}}" stepKey="enableShowMethod"/>
32-
3327
<!--Set StoreInformation configs data-->
3428
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{AdminGeneralSetStoreNameConfigData.value}}'" stepKey="setStoreInformationName"/>
3529
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.telephone}}" stepKey="setStoreInformationPhone"/>
@@ -72,10 +66,6 @@
7266
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.default}}" stepKey="setFreeShippingMethodMinimumOrderAmountAsDefault" />
7367
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.disabled}}" stepKey="disableFreeShippingMethod" />
7468
<!--Reset configs-->
75-
<magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableCheckout"/>
76-
<magentoCLI command="config:set {{AdminFedexDisableSandboxModeConfigData.path}} {{AdminFedexDisableSandboxModeConfigData.value}}" stepKey="disableSandbox"/>
77-
<magentoCLI command="config:set {{AdminFedexDisableDebugConfigData.path}} {{AdminFedexDisableDebugConfigData.value}}" stepKey="disableDebug"/>
78-
<magentoCLI command="config:set {{AdminFedexDisableShowMethodConfigData.path}} {{AdminFedexDisableShowMethodConfigData.value}}" stepKey="disableShowMethod"/>
7969
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} ''" stepKey="setStoreInformationName"/>
8070
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} ''" stepKey="setStoreInformationPhone"/>
8171
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} ''" stepKey="setStoreInformationCity"/>
@@ -184,7 +174,7 @@
184174
<!-- Assert Shipping total is not yet calculated -->
185175
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated2"/>
186176

187-
<!-- Assert order cannot be placed and error message will shown. -->
177+
<!-- Assert order cannot be placed and error message will shown. -->
188178
<actionGroup ref="AssertStorefrontOrderCannotBePlacedActionGroup" stepKey="assertOrderCannotBePlaced2">
189179
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
190180
</actionGroup>

app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
196196
)->setRenderer(
197197
$this->_conditions
198198
);
199-
$this->addComment($model, $fieldset);
200199

201200
$form->setValues($model->getData());
202201
$this->setConditionFormName($model->getConditions(), $formName);
@@ -219,22 +218,4 @@ private function setConditionFormName(\Magento\Rule\Model\Condition\AbstractCond
219218
}
220219
}
221220
}
222-
223-
/**
224-
* Adding comment if using specific sales rule.
225-
*
226-
* @param Rule $rule
227-
* @param Fieldset $fieldset
228-
* @return void
229-
*/
230-
private function addComment(Rule $rule, Fieldset $fieldset): void
231-
{
232-
foreach ($rule->getConditions()->getConditions() as $condition) {
233-
if ($condition->getAttribute() === 'payment_method') {
234-
$fieldset->setComment(
235-
__('Adding "Payment Method" condition to Checkout pages may increase load time on the storefront.')
236-
);
237-
}
238-
}
239-
}
240221
}

app/code/Magento/SalesRule/Model/Quote/Discount.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function __construct(
8585
* @param \Magento\Quote\Model\Quote\Address\Total $total
8686
* @return $this
8787
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
88+
* @SuppressWarnings(PHPMD.NPathComplexity)
8889
*/
8990
public function collect(
9091
\Magento\Quote\Model\Quote $quote,

app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<click selector="{{DiscountSection.DiscountTab}}" stepKey="clickToAddDiscount"/>
1616
<fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{discountCode}}" stepKey="fillFieldDiscountCode"/>
1717
<click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/>
18-
<waitForPageLoad stepKey="waitForDiscountToBeAdded"/>
18+
<waitForElement selector="{{DiscountSection.DiscountVerificationMsg}}" time="30" stepKey="waitForDiscountToBeAdded"/>
1919
<see selector="{{DiscountSection.DiscountVerificationMsg}}" userInput="Your coupon was successfully applied" stepKey="assertDiscountApplyMessage"/>
2020
</actionGroup>
2121
</actionGroups>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,3 @@ Apply,Apply
164164
"Apply to Shipping Amount","Apply to Shipping Amount"
165165
"Discard subsequent rules","Discard subsequent rules"
166166
"Default Rule Label for All Store Views","Default Rule Label for All Store Views"
167-
"Adding ""Payment Method"" condition to Checkout pages may increase load time on the storefront.","Adding ""Payment Method"" condition to Checkout pages may increase load time on the storefront."

app/code/Magento/SalesRule/view/frontend/web/js/action/set-coupon-code.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ define([
1818
'Magento_Checkout/js/action/get-payment-information',
1919
'Magento_Checkout/js/model/totals',
2020
'Magento_Checkout/js/model/full-screen-loader',
21-
'Magento_Checkout/js/action/recollect-shipping-rates',
22-
'Magento_Checkout/js/action/set-payment-information'
21+
'Magento_Checkout/js/action/recollect-shipping-rates'
2322
], function (ko, $, quote, urlManager, errorProcessor, messageContainer, storage, $t, getPaymentInformationAction,
24-
totals, fullScreenLoader, recollectShippingRates, setPaymentInformationAction
23+
totals, fullScreenLoader, recollectShippingRates
2524
) {
2625
'use strict';
2726

@@ -50,15 +49,6 @@ define([
5049
});
5150
fullScreenLoader.startLoader();
5251

53-
if (quote.paymentMethod()) {
54-
setPaymentInformationAction(
55-
messageContainer,
56-
{
57-
method: quote.paymentMethod().method
58-
}
59-
);
60-
}
61-
6252
return storage.put(
6353
url,
6454
data,

dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,5 @@ Magento/Config/App/Config/Type
217217
Magento/InventoryReservationCli/Test/Integration
218218
Magento/InventoryAdminUi/Controller/Adminhtml
219219
Magento/Newsletter/Model/Queue
220-
Magento/Framework/Mail/Template
220+
Magento/Framework/Mail/Template
221+
Magento/CheckoutAgreements/Model/Checkout/Plugin

0 commit comments

Comments
 (0)