Skip to content

Commit 77ec730

Browse files
authored
Merge branch 'magento-commerce:2.4-develop' into MC-40791
2 parents d8dc45f + e092238 commit 77ec730

File tree

176 files changed

+3688
-1313
lines changed

Some content is hidden

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

176 files changed

+3688
-1313
lines changed

app/code/Magento/Backend/etc/config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
<seo>
4545
<use_rewrites>0</use_rewrites>
4646
</seo>
47+
<secure>
48+
<use_in_frontend>1</use_in_frontend>
49+
<use_in_adminhtml>1</use_in_adminhtml>
50+
</secure>
4751
</web>
4852
</default>
4953
<stores>

app/code/Magento/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function getValueHtml($item)
151151
{
152152
if ($attributes = $this->getSelectionAttributes($item)) {
153153
return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " "
154-
. $this->getOrder()->formatBasePrice($attributes['price']);
154+
. $this->getOrder()->formatPrice($attributes['price']);
155155
}
156156
return $this->escapeHtml($item->getName());
157157
}

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<severity value="MAJOR"/>
1616
<testCaseId value="MC-37515"/>
1717
<group value="Bundle"/>
18+
<group value="cloud_smoke"/>
1819
</annotations>
1920
<before>
2021
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<testCaseId value="MC-38683"/>
1717
<useCaseId value="MC-37663"/>
1818
<group value="Bundle"/>
19+
<group value="cloud_smoke"/>
1920
</annotations>
2021
<before>
2122
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckNewCategoryLevelAddedViaApiTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<group value="catalog"/>
1919
<severity value="MAJOR"/>
2020
<group value="pr_exclude"/>
21+
<group value="cloud_smoke"/>
2122
</annotations>
2223
<before>
2324
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<testCaseId value="MC-28534"/>
1919
<useCaseId value="MC-37347"/>
2020
<group value="catalog"/>
21+
<group value="cloud_smoke"/>
2122
</annotations>
2223

2324
<before>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<severity value="BLOCKER"/>
1818
<group value="catalog"/>
1919
<group value="mtf_migrated"/>
20+
<group value="cloud_smoke"/>
2021
</annotations>
2122
<before>
2223
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ define([
230230
if (response.error) {
231231
this.blockMsg.show();
232232
this.blockMsgError.innerHTML = response.message;
233-
this.blockCancelBtn.hide();
233+
if(this.blockCancelBtn) {
234+
this.blockCancelBtn.hide();
235+
}
234236
this.setConfirmCallback(listType, null);
235237
this._showWindow();
236238
}
@@ -584,7 +586,9 @@ define([
584586
this.blockFormFields.update();
585587
this.blockMsg.hide();
586588
this.blockMsgError.update();
587-
this.blockCancelBtn.show();
589+
if(this.blockCancelBtn) {
590+
this.blockCancelBtn.show();
591+
}
588592
break;
589593
default:
590594
// search in list types for its cleaning
@@ -603,7 +607,9 @@ define([
603607
this.blockFormFields.update();
604608
this.blockMsg.hide();
605609
this.blockMsgError.update();
606-
this.blockCancelBtn.show();
610+
if(this.blockCancelBtn) {
611+
this.blockCancelBtn.show();
612+
}
607613
}
608614
break;
609615
}

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,33 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
3838
/**
3939
* Value that means all entities (e.g. websites, groups etc.)
4040
*/
41-
const VALUE_ALL = 'all';
41+
public const VALUE_ALL = 'all';
4242

4343
/**
4444
* Permanent column names.
4545
*
4646
* Names that begins with underscore is not an attribute. This name convention is for
4747
* to avoid interference with same attribute name.
4848
*/
49-
const COL_STORE = '_store';
49+
public const COL_STORE = '_store';
5050

51-
const COL_ATTR_SET = '_attribute_set';
51+
public const COL_ATTR_SET = '_attribute_set';
5252

53-
const COL_TYPE = '_type';
53+
public const COL_TYPE = '_type';
5454

55-
const COL_PRODUCT_WEBSITES = '_product_websites';
55+
public const COL_PRODUCT_WEBSITES = '_product_websites';
5656

57-
const COL_CATEGORY = '_category';
57+
public const COL_CATEGORY = '_category';
5858

59-
const COL_ROOT_CATEGORY = '_root_category';
59+
public const COL_ROOT_CATEGORY = '_root_category';
6060

61-
const COL_SKU = 'sku';
61+
public const COL_SKU = 'sku';
6262

63-
const COL_VISIBILITY = 'visibility';
63+
public const COL_VISIBILITY = 'visibility';
6464

65-
const COL_MEDIA_IMAGE = '_media_image';
65+
public const COL_MEDIA_IMAGE = '_media_image';
6666

67-
const COL_ADDITIONAL_ATTRIBUTES = 'additional_attributes';
67+
public const COL_ADDITIONAL_ATTRIBUTES = 'additional_attributes';
6868

6969
/**
7070
* Pairs of attribute set ID-to-name.
@@ -123,14 +123,14 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
123123
protected $_storeIdToCode = [];
124124

125125
/**
126-
* Website ID-to-code.
126+
* Array of Website ID-to-code.
127127
*
128128
* @var array
129129
*/
130130
protected $_websiteIdToCode = [];
131131

132132
/**
133-
* Attribute types
133+
* Attributes type
134134
*
135135
* @var array
136136
*/
@@ -284,6 +284,18 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
284284
'custom_design_to'
285285
];
286286

287+
/**
288+
* Image labels array
289+
*
290+
* @var array
291+
*/
292+
private $imageLabelAttributes = [
293+
'base_image_label',
294+
'small_image_label',
295+
'thumbnail_image_label',
296+
'swatch_image_label',
297+
];
298+
287299
/**
288300
* Attributes codes which are appropriate for export and not the part of additional_attributes.
289301
*
@@ -346,7 +358,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
346358
protected $metadataPool;
347359

348360
/**
349-
* Product entity link field
361+
* Link field of Product entity
350362
*
351363
* @var string
352364
*/
@@ -828,12 +840,12 @@ protected function getItemsPerPage()
828840
switch ($lastMemoryLimitLetter) {
829841
case 'g':
830842
$memoryLimit *= 1024;
831-
// fall-through intentional
832-
// no break
843+
// fall-through intentional
844+
// no break
833845
case 'm':
834846
$memoryLimit *= 1024;
835-
// fall-through intentional
836-
// no break
847+
// fall-through intentional
848+
// no break
837849
case 'k':
838850
$memoryLimit *= 1024;
839851
break;
@@ -962,6 +974,7 @@ protected function getExportData()
962974
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
963975
$dataRow = array_merge($dataRow, $stockItemRows[$productId]);
964976
}
977+
$this->updateGalleryImageData($dataRow, $rawData);
965978
$this->appendMultirowData($dataRow, $multirawData);
966979
if ($dataRow) {
967980
$exportData[] = $dataRow;
@@ -1370,6 +1383,29 @@ private function appendMultirowData(&$dataRow, $multiRawData)
13701383
return $dataRow;
13711384
}
13721385

1386+
/**
1387+
* Add image column if image label exists for all scope
1388+
*
1389+
* @param array $dataRow
1390+
* @param array $rawData
1391+
* @return void
1392+
*/
1393+
private function updateGalleryImageData(&$dataRow, $rawData)
1394+
{
1395+
$storeId = $dataRow['store_id'];
1396+
$productId = $dataRow['product_id'];
1397+
foreach ($this->imageLabelAttributes as $imageLabelCode) {
1398+
$imageAttributeCode = str_replace('_label', '', $imageLabelCode);
1399+
if ($storeId != Store::DEFAULT_STORE_ID
1400+
&& isset($dataRow[$imageLabelCode])
1401+
&& $dataRow[$imageLabelCode]
1402+
&& (!isset($dataRow[$imageAttributeCode]) || !$dataRow[$imageAttributeCode])
1403+
) {
1404+
$dataRow[$imageAttributeCode] = $rawData[$productId][Store::DEFAULT_STORE_ID][$imageAttributeCode];
1405+
}
1406+
}
1407+
}
1408+
13731409
/**
13741410
* Add multi row data to export
13751411
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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="AdminExportSimpleProductWithImageAndImageAltForDiffrentScopeTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Admin product export with different Alt Text for multiple stores"/>
15+
<title value="Admin product export with different Alt Text for multiple stores"/>
16+
<description value="Admin product export with different Alt Text for multiple stores"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="ACP2E-561"/>
19+
<group value="catalog_import_export"/>
20+
</annotations>
21+
<before>
22+
<!-- Login Admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Create Store View English -->
25+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn">
26+
<argument name="customStore" value="customStoreEN"/>
27+
</actionGroup>
28+
<!-- Create Store View France -->
29+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFr">
30+
<argument name="customStore" value="customStoreFR"/>
31+
</actionGroup>
32+
<!-- Create Category and Simple Product -->
33+
<createData entity="_defaultCategory" stepKey="createCategory"/>
34+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
35+
<requiredEntity createDataKey="createCategory"/>
36+
<field key="price">100</field>
37+
</createData>
38+
<!-- Upload Image All Store View -->
39+
<createData entity="ApiProductAttributeMediaGalleryEntryTestImage" stepKey="createProductImage">
40+
<requiredEntity createDataKey="createSimpleProduct"/>
41+
</createData>
42+
</before>
43+
<after>
44+
<!-- Delete Store View English -->
45+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn">
46+
<argument name="customStore" value="customStoreEN"/>
47+
</actionGroup>
48+
<!-- Delete Store View France -->
49+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewFr">
50+
<argument name="customStore" value="customStoreFR"/>
51+
</actionGroup>
52+
<!-- Clear Filter Store -->
53+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetFiltersOnStorePage"/>
54+
<!-- Delete Category and Simple Product -->
55+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
56+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
57+
<!-- Clear Filter Product -->
58+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/>
59+
<!-- Logout Admin -->
60+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
61+
</after>
62+
<!-- Search Product and Open Edit -->
63+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct">
64+
<argument name="product" value="$$createSimpleProduct$$"/>
65+
</actionGroup>
66+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
67+
<argument name="product" value="$$createSimpleProduct$$"/>
68+
</actionGroup>
69+
<actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole">
70+
<argument name="image" value="$$createProductImage$$"/>
71+
</actionGroup>
72+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
73+
74+
<!-- Switch to the English store view -->
75+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewEnglishProduct">
76+
<argument name="storeView" value="customStoreEN.name"/>
77+
</actionGroup>
78+
<actionGroup ref="AdminProductChangeImageAltTextActionGroup" stepKey="changeEnglishImageAltTextOnProduct">
79+
<argument name="image" value="$$createProductImage$$"/>
80+
<argument name="altText" value="english image alt text 1"/>
81+
</actionGroup>
82+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/>
83+
84+
<!-- Switch to the French store view -->
85+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewFrenchProduct">
86+
<argument name="storeView" value="customStoreFR.name"/>
87+
</actionGroup>
88+
<actionGroup ref="AdminProductChangeImageAltTextActionGroup" stepKey="changeFrenchImageAltTextOnProduct">
89+
<argument name="image" value="$$createProductImage$$"/>
90+
<argument name="altText" value="french image alt text 1"/>
91+
</actionGroup>
92+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/>
93+
94+
<actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/>
95+
<actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku">
96+
<argument name="attribute" value="sku"/>
97+
<argument name="attributeData" value="$$createSimpleProduct.sku$$"/>
98+
</actionGroup>
99+
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
100+
<argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/>
101+
<argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/>
102+
</actionGroup>
103+
<reloadPage stepKey="refreshPage"/>
104+
<waitForPageLoad stepKey="waitForReload"/>
105+
<waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/>
106+
<grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/>
107+
<actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile">
108+
<argument name="rowIndex" value="0"/>
109+
</actionGroup>
110+
<!-- Validate Export File on File System: Configurable Product -->
111+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists">
112+
<argument name="filePath">var/export/{$grabNameFile}</argument>
113+
</helper>
114+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct">
115+
<argument name="filePath">var/export/{$grabNameFile}</argument>
116+
<argument name="text">$createProductImage.entry[content][name]$,"english image alt text 1"</argument>
117+
</helper>
118+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct1">
119+
<argument name="filePath">var/export/{$grabNameFile}</argument>
120+
<argument name="text">$createProductImage.entry[content][name]$,"french image alt text 1"</argument>
121+
</helper>
122+
</test>
123+
</tests>

0 commit comments

Comments
 (0)