-
Notifications
You must be signed in to change notification settings - Fork 9.4k
ISSUE-20004: Refactoring minimum order amount including tax value in the calculate #33327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Changes from 7 commits
6438a06
f7a3b09
535a60c
1b476be
3529fbd
c100ffc
7710b5e
77600ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="StorefrontVerifyGuestCartMinimumAmountTest"> | ||
<annotations> | ||
<features value="Checkout"/> | ||
<stories value="Minimum amount order on checkout page"/> | ||
<title value="Verify minimum amount on checkout page"/> | ||
<description value="When the minimum order amount is set it must consider the tax value"/> | ||
<severity value="BLOCKER"/> | ||
<testCaseId value="MC-28285"/> | ||
<group value="checkout"/> | ||
<group value="tax"/> | ||
</annotations> | ||
<before> | ||
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> | ||
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> | ||
<magentoCLI command="config:set sales/minimum_order/active 1" stepKey="enableMinimumOrderAmount"/> | ||
<magentoCLI command="config:set sales/minimum_order/amount 100" stepKey="setMinimumOrderAmount100"/> | ||
<createData entity="taxRate_US_NY_8_1" stepKey="createTaxRateUSNY"/> | ||
<createData entity="DefaultTaxRuleWithCustomTaxRate" stepKey="createTaxRuleUSNY"> | ||
<requiredEntity createDataKey="createTaxRateUSNY" /> | ||
</createData> | ||
<createData entity="ApiCategory" stepKey="createCategory"/> | ||
<createData entity="defaultSimpleProduct" stepKey="simpleProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
<field key="price">93.00</field> | ||
</createData> | ||
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> | ||
<argument name="tags" value="config full_page"/> | ||
</actionGroup> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> | ||
<deleteData createDataKey="createTaxRuleUSNY" stepKey="deleteTaxRuleUSNY"/> | ||
<deleteData createDataKey="createTaxRateUSNY" stepKey="deleteTaxRateUSNY"/> | ||
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> | ||
<createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> | ||
</after> | ||
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> | ||
<argument name="product" value="$simpleProduct$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSimpleProductToTheCart"> | ||
<argument name="productQty" value="1"/> | ||
</actionGroup> | ||
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> | ||
<waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckoutDisabled}}" stepKey="goToCheckoutDisabled"/> | ||
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertMinimumAmountOrderMessage"> | ||
<argument name="message" value="Minimum order amount is $100.00"/> | ||
<argument name="messageType" value="notice"/> | ||
</actionGroup> | ||
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"> | ||
<argument name="address" value="US_Address_NY_Default_Shipping"/> | ||
</actionGroup> | ||
<click selector="{{CheckoutCartSummarySection.shippingMethodElementId('freeshipping', 'freeshipping')}}" stepKey="selectShippingMethod"/> | ||
<scrollTo selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="scrollToProceedToCheckout" /> | ||
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> | ||
<comment userInput="Adding the comment to replace waitForPageToLoad action for preserving Backward Compatibility" stepKey="waitForPageToLoad"/> | ||
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> | ||
</test> | ||
</tests> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,7 +475,7 @@ public function getTotalSegments(); | |
* @return $this | ||
*/ | ||
public function setTotalSegments($totals = []); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rollback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
/** | ||
* Retrieve existing extension attributes object or create a new one. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2298,6 +2298,8 @@ public function validateMinimumAmount($multishipping = false) | |
$storeId | ||
); | ||
|
||
$this->collectTotals()->save(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that triggering recollect totals in this method is good solution. @ihor-sviziev what do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @viniciusbord9 Could you pay attention to this comment? Extending of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was waiting for an answer from @ihor-sviziev to whom you asked for sooner. I am going to try to implement your idea and check if it is viable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Den4ik I think it's a good idea There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was developing the new repository extending the The class I have only change the line 61 from I have finished the implementation of the |
||
|
||
$addresses = $this->getAllAddresses(); | ||
|
||
if (!$multishipping) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment block used on refactored mftf tests to preserve backward compatibility and don't needed in new mftf tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please review again when you have a chance.