Skip to content

Commit cc05ea5

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-gl/magento2ce into AC-10971_v1
2 parents 21f3998 + 1b99b6d commit cc05ea5

File tree

82 files changed

+947
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+947
-219
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,10 @@ public function toArray(array $arrAttributes = [])
18771877
{
18781878
$data = parent::toArray($arrAttributes);
18791879
$stock = $this->getStockItem();
1880-
if ($stock) {
1880+
if (is_object($stock) && method_exists($stock, 'toArray')) {
18811881
$data['stock_item'] = $stock->toArray();
1882+
} elseif (is_array($stock)) {
1883+
$data['stock_item'] = $stock;
18821884
}
18831885
unset($data['stock_item']['product']);
18841886
return $data;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminChangeProductNameAsPerStoreViewScopeActionGroup">
12+
<annotations>
13+
<description>Admin change product name having store view scope</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
</arguments>
18+
<waitForElementClickable selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="waitForDefaultNameCheckBox"/>
19+
<uncheckOption selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="unCheckDefaultNameCheckbox"/>
20+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="changeProductName"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/CatalogAttributeSetData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313
<data key="attributeGroupId">7</data>
1414
<data key="skeletonId">4</data>
1515
</entity>
16+
<entity name="CatalogAdditionalAttributeSet" type="CatalogAttributeSet">
17+
<data key="attribute_set_name" unique="suffix">additional_set_</data>
18+
<data key="attributeGroupId">7</data>
19+
<data key="skeletonId">4</data>
20+
</entity>
1621
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductRelatedUpSellCrossSellSection/AdminProductFormRelatedUpSellCrossSellSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<element name="removeCrossSellProduct" type="button" selector="//span[text()='Cross-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2424
<element name="removeUpsellProduct" type="button" selector="//span[text()='Up-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2525
<element name="relatedUpSellCrossSellProductStagingSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='{{catalogStagingSection}}']" parameterized="true"/>
26+
<element name="relatedProductStatus" type="text" selector="//div[@class='admin__field-control']//div[@class='control-table-text']//span[@data-index='status']"/>
2627
</section>
2728
</sections>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminChangeRelatedProductPropertiesOnStoreViewLevelTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Product properties as per store view"/>
14+
<title value="Change related product properties on store view level"/>
15+
<description value="Change name and status of product properties on diferrent store view levels"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4491"/>
18+
</annotations>
19+
<before>
20+
<!-- Login as admin -->
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<!--Create product A-->
23+
<createData entity="SimpleProduct" stepKey="createSimpleProductA"/>
24+
<!--Create product B-->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProductB"/>
26+
<!--Create website 1-->
27+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite1">
28+
<argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/>
29+
<argument name="websiteCode" value="{{NewWebSiteData.code}}"/>
30+
</actionGroup>
31+
<!-- Create store 1-->
32+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore1">
33+
<argument name="website" value="{{NewWebSiteData.name}}"/>
34+
<argument name="storeGroupName" value="{{NewWebSiteData.name}}"/>
35+
<argument name="storeGroupCode" value="{{NewWebSiteData.code}}"/>
36+
</actionGroup>
37+
<!-- Create store view 1-->
38+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1">
39+
<argument name="StoreGroup" value="NewWebSiteData"/>
40+
<argument name="customStore" value="NewWebSiteData"/>
41+
</actionGroup>
42+
<!--Create website 2-->
43+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite2">
44+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
45+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
46+
</actionGroup>
47+
<!-- Create store 2-->
48+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore2">
49+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
50+
<argument name="storeGroupName" value="{{secondCustomWebsite.name}}"/>
51+
<argument name="storeGroupCode" value="{{secondCustomWebsite.code}}"/>
52+
</actionGroup>
53+
<!-- Create store view 2-->
54+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2">
55+
<argument name="StoreGroup" value="secondCustomWebsite"/>
56+
<argument name="customStore" value="secondCustomWebsite"/>
57+
</actionGroup>
58+
</before>
59+
<after>
60+
<!--Delete product-->
61+
<deleteData createDataKey="createSimpleProductA" stepKey="deleteSimpleProductA"/>
62+
<!--Delete product-->
63+
<deleteData createDataKey="createSimpleProductB" stepKey="deleteSimpleProductB"/>
64+
<!--Delete website 1-->
65+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite1">
66+
<argument name="websiteName" value="{{NewWebSiteData.name}}"/>
67+
</actionGroup>
68+
<!--Delete website 2-->
69+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite2">
70+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
71+
</actionGroup>
72+
<!--Logout as Admin-->
73+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
74+
</after>
75+
<!--Open simple product A-->
76+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductA">
77+
<argument name="productId" value="$$createSimpleProductA.id$$"/>
78+
</actionGroup>
79+
<!--Assign product A to website 1-->
80+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsite1">
81+
<argument name="website" value="{{NewWebSiteData.name}}"/>
82+
</actionGroup>
83+
<!--Assign product A to website 2-->
84+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsit2">
85+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
86+
</actionGroup>
87+
<!--Add simple product B as related product-->
88+
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addProductBasRelatedProduct">
89+
<argument name="sku" value="$$createSimpleProductB.sku$$"/>
90+
</actionGroup>
91+
<!--Save product A-->
92+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductA"/>
93+
<!--Open simple product B-->
94+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductB">
95+
<argument name="productId" value="$$createSimpleProductB.id$$"/>
96+
</actionGroup>
97+
<!--Assign product B to website 1-->
98+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite1">
99+
<argument name="website" value="{{NewWebSiteData.name}}"/>
100+
</actionGroup>
101+
<!--Assign product B to website 2-->
102+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite2">
103+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
104+
</actionGroup>
105+
<!--Save product B-->
106+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductB"/>
107+
<!--Change Scope to store view 2-->
108+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="changeScopeToStoreView2">
109+
<argument name="storeViewName" value="{{secondCustomWebsite.name}}"/>
110+
</actionGroup>
111+
<!--Uncheck default product status-->
112+
<waitForElementVisible selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="waitForDefaultValueCheckBox"/>
113+
<uncheckOption selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="uncheckDefaultProductStatus"/>
114+
<!-- Change status of product to "Disable" and save it having scope as Website-->
115+
<actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProductStatusHavingScopeWebsite"/>
116+
<!--Change product name having scope as store view-->
117+
<actionGroup ref="AdminChangeProductNameAsPerStoreViewScopeActionGroup" stepKey="changeProductNameHavingScopeStoreView">
118+
<argument name="productName" value="B2"/>
119+
</actionGroup>
120+
<!--Save product B-->
121+
<actionGroup ref="SaveProductFormActionGroup" stepKey="againSaveProductB"/>
122+
<!--Open simple product A again-->
123+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductAagain">
124+
<argument name="productId" value="$$createSimpleProductA.id$$"/>
125+
</actionGroup>
126+
<!--Switch scope to store view 1-->
127+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView1">
128+
<argument name="storeViewName" value="{{NewWebSiteData.name}}"/>
129+
</actionGroup>
130+
<!--Expand "Related Products" tab-->
131+
<conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab"/>
132+
<!--Assert product name and status as per store view 1-->
133+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$createSimpleProductB.name$$" stepKey="assertView1ProductName"/>
134+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Enabled" stepKey="assertView1ProductStatus"/>
135+
<!--Switch scope to store view 2-->
136+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView2">
137+
<argument name="storeViewName" value="{{secondCustomWebsite.name}}"/>
138+
</actionGroup>
139+
<!--Expand "Related Products" tab-->
140+
<conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="expandRelatedProductTab"/>
141+
<!--Assert product name and status as per store view 2-->
142+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="B2" stepKey="assertView2ProductName"/>
143+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Disabled" stepKey="assertView2ProductStatus"/>
144+
</test>
145+
</tests>

app/code/Magento/Customer/Model/Attribute/Data/Multiline.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Customer Attribute Multiply line Data Model
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
119
*/
1210
namespace Magento\Customer\Model\Attribute\Data;
1311

app/code/Magento/Customer/Model/Attribute/Data/Multiselect.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Customer Attribute Multiply select Data Model
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
119
*/
1210
namespace Magento\Customer\Model\Attribute\Data;
1311

app/code/Magento/Customer/Model/Attribute/Data/Select.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Customer Attribute Select Data Model
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
119
*/
1210
namespace Magento\Customer\Model\Attribute\Data;
1311

app/code/Magento/Customer/Model/Attribute/Data/Text.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Customer Attribute Text Data Model
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
119
*/
1210
namespace Magento\Customer\Model\Attribute\Data;
1311

app/code/Magento/Customer/Model/Attribute/Data/Textarea.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Customer Attribute Text Area Data Model
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
119
*/
1210
namespace Magento\Customer\Model\Attribute\Data;
1311

0 commit comments

Comments
 (0)