Skip to content

Commit 0853bf1

Browse files
committed
#AC3023-DHL Migration from V6.2 to V10: conflicts merged
2 parents e574b9b + bd97c6f commit 0853bf1

File tree

13 files changed

+300
-8
lines changed

13 files changed

+300
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontSelectionOfOutOfStockChildProductsOfConfigurableProductDisabledTest">
12+
<annotations>
13+
<features value="CatalogInventory"/>
14+
<stories value="Storefront selection of out of stock child products of configurable product"/>
15+
<title value="Storefront selection of out of stock child products of configurable Product disabled"/>
16+
<description value="Storefront selection of out of stock child products of configurable are disabled on storefront when display of out of stock options are enabled"/>
17+
<severity value="MAJOR"/>
18+
<group value="catalogInventory"/>
19+
</annotations>
20+
21+
<before>
22+
<!--Set Display out of stock product-->
23+
<magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 1" />
24+
<!-- Create category -->
25+
<createData entity="SimpleSubCategory" stepKey="simplecategory"/>
26+
<!-- Create configurable product with two options -->
27+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
28+
<requiredEntity createDataKey="simplecategory"/>
29+
</createData>
30+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
31+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
32+
<requiredEntity createDataKey="createConfigProductAttribute"/>
33+
</createData>
34+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
41+
<requiredEntity createDataKey="createConfigProductAttribute"/>
42+
</getData>
43+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
44+
<requiredEntity createDataKey="createConfigProductAttribute"/>
45+
</getData>
46+
<!-- Create child products -->
47+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
48+
<requiredEntity createDataKey="createConfigProductAttribute"/>
49+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
50+
</createData>
51+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
54+
</createData>
55+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
56+
<requiredEntity createDataKey="createConfigProduct"/>
57+
<requiredEntity createDataKey="createConfigProductAttribute"/>
58+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
59+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
60+
</createData>
61+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
62+
<requiredEntity createDataKey="createConfigProduct"/>
63+
<requiredEntity createDataKey="createConfigChildProduct1"/>
64+
</createData>
65+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
66+
<requiredEntity createDataKey="createConfigProduct"/>
67+
<requiredEntity createDataKey="createConfigChildProduct2"/>
68+
</createData>
69+
<magentoCron groups="index" stepKey="reindex"/>
70+
</before>
71+
72+
<after>
73+
<magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0" />
74+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
75+
<deleteData createDataKey="simplecategory" stepKey="deleteSimpleCategory"/>
76+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
77+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
78+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
79+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
80+
</after>
81+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
82+
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="openProductEditPageToSetStatus"/>
83+
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="selectOutOfStockStatus"/>
84+
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveProductWithSetOutOfStockStatus"/>
85+
<!-- Go to configurable product page -->
86+
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>
87+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
88+
<!-- Assert the out of stock child product option is disabled on storefront -->
89+
<seeElement selector="#product-options-wrapper .super-attribute-select option:disabled" stepKey="assertConfigAttributeOption1Disabled"/>
90+
</test>
91+
</tests>

app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private function deleteObsoleteRewrites(Product $product): void
144144
}
145145
$storesToRemove = array_unique($storesToRemove);
146146
}
147+
$storesToRemove = array_filter($storesToRemove);
147148
if ($storesToRemove) {
148149
$this->urlPersist->deleteByData(
149150
[

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
5757
*
5858
* @var string[]
5959
*/
60-
protected $_customizableContainerTypes = [self::DHL_CONTENT_TYPE_NON_DOC];
60+
protected $_customizableContainerTypes = [self::DHL_CONTENT_TYPE_NON_DOC, self::DHL_CONTENT_TYPE_DOC];
6161

6262
/**
6363
* Code of the carrier
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontMultishippingWithCartPriceRuleMatchingTotalItemsQtyTest">
12+
<annotations>
13+
<features value="Multi shipping and Cart Price Rule"/>
14+
<stories value="Checking cart price rule matching total items qty with multiple shipping addresses on storefront and place order"/>
15+
<title value="Checking cart price rule matching total items qty with multiple shipping addressecreateCategorys on storefront and place order"/>
16+
<description value="Cart Price Rules matching total items quantity not working and missing shipping method"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-2106"/>
19+
<group value="Multishipment"/>
20+
<group value="SalesRule"/>
21+
</annotations>
22+
<before>
23+
<!-- Login as Admin -->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
25+
<!-- Create simple products -->
26+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
27+
<createData entity="SimpleProduct" stepKey="firstProduct">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
<createData entity="SimpleProduct" stepKey="secondProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
<createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/>
34+
</before>
35+
<after>
36+
<!-- Delete created data -->
37+
<deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/>
38+
<deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/>
39+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
40+
<deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/>
41+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule">
42+
<argument name="ruleName" value="{{CartPriceRuleConditionNotApplied.name}}"/>
43+
</actionGroup>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
45+
</after>
46+
47+
<!-- Create a cart price rule -->
48+
<actionGroup ref="AdminOpenNewCartPriceRuleFormPageActionGroup" stepKey="createCartPriceRule"/>
49+
<actionGroup ref="AdminCartPriceRuleFillMainInfoActionGroup" stepKey="selectCustomCustomerGroup">
50+
<argument name="name" value="{{CartPriceRuleConditionNotApplied.name}}"/>
51+
<argument name="description" value="{{CartPriceRuleConditionNotApplied.description}}"/>
52+
</actionGroup>
53+
<selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="{{CartPriceRuleConditionNotApplied.coupon_type}}" stepKey="selectCouponType"/>
54+
<scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToConditionsHeader"/>
55+
<!-- Fill condition 1: Total Items Quantity -->
56+
<conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" visible="true" stepKey="expandConditions"/>
57+
<click selector="{{AdminCartPriceRulesFormSection.newCondition}}" stepKey="clickNewCondition"/>
58+
<selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="Total Items Quantity" stepKey="selectCondition"/>
59+
<waitForPageLoad stepKey="waitForConditionLoad"/>
60+
<click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" stepKey="clickEllipsis"/>
61+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="2" stepKey="fillTotalItemQuantity"/>
62+
<actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="createActiveCartPriceRuleActionsSection">
63+
<argument name="rule" value="CartPriceRuleConditionNotApplied"/>
64+
</actionGroup>
65+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="seeAssertCartPriceRuleSuccessSaveMessage"/>
66+
67+
<!-- Login to the Storefront as created customer -->
68+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
69+
<argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/>
70+
</actionGroup>
71+
<!-- Open the first product page -->
72+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToFirstProductPage">
73+
<argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/>
74+
</actionGroup>
75+
<!-- Add the first product to the Shopping Cart -->
76+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart">
77+
<argument name="productName" value="$$firstProduct.name$$"/>
78+
<argument name="productQty" value="2"/>
79+
</actionGroup>
80+
<!--Go to Cart -->
81+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
82+
<!--Check Out with Multiple Addresses -->
83+
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
84+
<!-- Select different addresses and click 'Go to Shipping Information' -->
85+
<actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectFirstAddress">
86+
<argument name="sequenceNumber" value="1"/>
87+
<argument name="option" value="John Doe, 368 Broadway St. 113, New York, New York 10001, United States"/>
88+
</actionGroup>
89+
<actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectSecondAddress">
90+
<argument name="sequenceNumber" value="2"/>
91+
<argument name="option" value="John Doe, Augsburger Strabe 41, Berlin, 10789, Germany"/>
92+
</actionGroup>
93+
<actionGroup ref="StorefrontSaveAddressActionGroup" stepKey="saveAddresses"/>
94+
<!-- Use Default Shipping Method -->
95+
<actionGroup ref="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup" stepKey="useDefaultShippingMethod"/>
96+
<!-- Click 'Go to Review Your Order' -->
97+
<actionGroup ref="SelectBillingInfoActionGroup" stepKey="useDefaultBillingMethod"/>
98+
<!-- Click 'Place Order' -->
99+
<actionGroup ref="PlaceOrderActionGroup" stepKey="placeOrder"/>
100+
</test>
101+
</tests>

app/code/Magento/Reports/Model/ResourceModel/Quote/Item/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function prepareActiveCartItems()
121121

122122
$quoteItemsSelect->reset()
123123
->from(['main_table' => $this->getTable('quote_item')], '')
124-
->columns('main_table.product_id')
124+
->columns(['main_table.product_id', 'main_table.name'])
125125
->columns(['carts' => new \Zend_Db_Expr('COUNT(main_table.item_id)')])
126126
->columns('quote.base_to_global_rate')
127127
->joinInner(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ public function collect(
182182
foreach ($rules as $rule) {
183183
/** @var Item $item */
184184
foreach ($items as $item) {
185+
if ($quote->getIsMultiShipping() && $item->getAddress()->getId() !== $address->getId()) {
186+
continue;
187+
}
185188
if ($item->getNoDiscount() || !$this->calculator->canApplyDiscount($item) || $item->getParentItem()) {
186189
continue;
187190
}

app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ define(['prototype'], function () {
262262
}
263263
dimensionElements.each(callback);
264264

265+
const allowedPackageTypes = ["N","D"];
266+
267+
if (Object.values(this.customizableContainers).some(packageType => allowedPackageTypes.includes(packageType))) {
268+
dimensionElements.each(function(element) {
269+
$(element).addClassName('required-entry');
270+
});
271+
}
272+
265273
return result = $$('[id^="package_block_"] input').collect(function (element) {
266274
return this.validateElement(element);
267275
}, this).all();
@@ -666,6 +674,22 @@ define(['prototype'], function () {
666674
if (!currentNode) {
667675
return;
668676
}
677+
678+
$(currentNode).select(
679+
'input[name=container_length],input[name=container_width],input[name=container_height],select[name=container_dimension_units]'
680+
).each(function (inputElement) {
681+
if (disable) {
682+
Form.Element.disable(inputElement);
683+
inputElement.addClassName('_disabled');
684+
685+
if (inputElement.nodeName == 'INPUT') {
686+
$(inputElement).value = '';
687+
}
688+
} else {
689+
Form.Element.enable(inputElement);
690+
inputElement.removeClassName('_disabled');
691+
}
692+
});
669693
},
670694

671695
changeContentTypes: function (obj) {

app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,27 @@ define([
498498
$widget._EmulateSelected($widget._getSelectedAttributes());
499499
},
500500

501+
disableSwatchForOutOfStockProducts: function () {
502+
let $widget = this, container = this.element;
503+
504+
$.each(this.options.jsonConfig.attributes, function () {
505+
let item = this;
506+
507+
if ($widget.options.jsonConfig.canDisplayShowOutOfStockStatus) {
508+
let salableProducts = $widget.options.jsonConfig.salable[item.id],
509+
swatchOptions = container.find('.swatch-option');
510+
511+
swatchOptions.each(function (key, value) {
512+
let optionId = $(value).data('option-id');
513+
514+
if (!salableProducts.hasOwnProperty(optionId)) {
515+
$(value).attr('disabled', true).addClass('disabled');
516+
}
517+
});
518+
}
519+
});
520+
},
521+
501522
/**
502523
* Render swatch options by part of config
503524
*
@@ -888,6 +909,7 @@ define([
888909
.attr('disabled', true)
889910
.addClass('disabled')
890911
.attr('tabindex', '-1');
912+
this.disableSwatchForOutOfStockProducts();
891913
},
892914

893915
/**

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ public function testProductListOutOfStockSortOrderWithElasticsearch(
407407
string $direction,
408408
array $expected
409409
): void {
410-
$this->markTestSkipped('MC-40449: ListProduct\SortingTest failure on 2.4-develop');
411410
$this->assertProductListSortOrderWithConfig($sortBy, $direction, $expected);
412411
}
413412

@@ -429,7 +428,6 @@ public function testProductListOutOfStockSortOrderWithMysql(
429428
string $direction,
430429
array $expected
431430
): void {
432-
$this->markTestSkipped('MC-40449: ListProduct\SortingTest failure on 2.4-develop');
433431
$this->assertProductListSortOrderWithConfig($sortBy, $direction, $expected);
434432
}
435433

@@ -449,7 +447,7 @@ public function productListWithOutOfStockSortOrderDataProvider(): array
449447
'default_order_price_desc' => [
450448
'sort' => 'price',
451449
'direction' => Collection::SORT_ORDER_DESC,
452-
'expectation' => ['configurable', 'simple3', 'simple2', 'simple1'],
450+
'expectation' => ['simple3', 'simple2', 'simple1', 'configurable'],
453451
],
454452
];
455453
}

0 commit comments

Comments
 (0)