diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/AdminResetUserPasswordFailedTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/AdminResetUserPasswordFailedTest.xml
new file mode 100644
index 0000000000000..8f9c5828e2f5e
--- /dev/null
+++ b/app/code/Magento/Captcha/Test/Mftf/Test/AdminResetUserPasswordFailedTest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Api/Data/CategoryInterface.php b/app/code/Magento/Catalog/Api/Data/CategoryInterface.php
index b9a23e9d08ec3..1940a0ac80c0b 100644
--- a/app/code/Magento/Catalog/Api/Data/CategoryInterface.php
+++ b/app/code/Magento/Catalog/Api/Data/CategoryInterface.php
@@ -1,7 +1,5 @@
\Magento\Catalog\Model\ResourceModel\Eav\Attribute, ...)
* @param string $valueFieldSuffix
*
@@ -304,12 +304,16 @@ protected function _fillTemporaryTable(
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
foreach ($columnsList as $columnName => $attribute) {
- $countTableName = 't' . $iterationNum++;
+ $countTableName = 't' . ($iterationNum++);
$joinCondition = sprintf(
- 'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0',
+ 'e.%3$s = %1$s.%3$s' .
+ ' AND %1$s.attribute_id = %2$d' .
+ ' AND (%1$s.store_id = %4$d' .
+ ' OR %1$s.store_id = 0)',
$countTableName,
$attribute->getId(),
- $metadata->getLinkField()
+ $metadata->getLinkField(),
+ $storeId
);
$select->joinLeft(
@@ -323,9 +327,10 @@ protected function _fillTemporaryTable(
$columnValueName = $attributeCode . $valueFieldSuffix;
if (isset($flatColumns[$columnValueName])) {
$valueJoinCondition = sprintf(
- 'e.%1$s = %2$s.option_id AND %2$s.store_id = 0',
+ 'e.%1$s = %2$s.option_id AND (%2$s.store_id = %3$d OR %2$s.store_id = 0)',
$attributeCode,
- $countTableName
+ $countTableName,
+ $storeId
);
$selectValue->joinLeft(
[
diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php
index 42b9639d2717b..e06e85e90a2d8 100644
--- a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php
+++ b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php
@@ -206,7 +206,7 @@ public function execute($product, $arguments = [])
}
/**
- * Returns media gallery atribute instance
+ * Returns media gallery attribute instance
*
* @return \Magento\Catalog\Api\Data\ProductAttributeInterface
* @since 101.0.0
@@ -230,6 +230,7 @@ public function getAttribute()
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @since 101.0.0
+ * phpcs:disable Magento2.CodeAnalysis.EmptyBlock
*/
protected function processDeletedImages($product, array &$images)
{
@@ -400,6 +401,7 @@ protected function getUniqueFileName($file, $forTmp = false)
$destinationFile = $forTmp
? $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getTmpMediaPath($file))
: $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getMediaPath($file));
+ // phpcs:disable Magento2.Functions.DiscouragedFunction
$destFile = dirname($file) . '/' . FileUploader::getNewFileName($destinationFile);
}
@@ -420,6 +422,7 @@ protected function copyImage($file)
$destinationFile = $this->getUniqueFileName($file);
if (!$this->mediaDirectory->isFile($this->mediaConfig->getMediaPath($file))) {
+ // phpcs:ignore Magento2.Exceptions.DirectThrow
throw new \Exception();
}
@@ -437,6 +440,7 @@ protected function copyImage($file)
}
return str_replace('\\', '/', $destinationFile);
+ // phpcs:ignore Magento2.Exceptions.ThrowCatch
} catch (\Exception $e) {
$file = $this->mediaConfig->getMediaPath($file);
throw new \Magento\Framework\Exception\LocalizedException(
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
new file mode 100644
index 0000000000000..dd66919640a73
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenNewProductFormPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenNewProductFormPageActionGroup.xml
new file mode 100644
index 0000000000000..fe859fab52667
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenNewProductFormPageActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
index da570f9ed99b0..3c44a8f1898ad 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
@@ -19,6 +19,14 @@
+
+
+
+
+
+
+
+
@@ -96,6 +104,9 @@
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index 46329dde278bc..86158aba68f82 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -65,6 +65,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
index 2914ecc470220..019d103a31cf2 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
@@ -45,6 +45,9 @@
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml
new file mode 100644
index 0000000000000..c25b73bab21ae
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClickAddToCartOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClickAddToCartOnProductPageActionGroup.xml
new file mode 100644
index 0000000000000..fb2065d228d5a
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClickAddToCartOnProductPageActionGroup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..24e1fe9cf5ecd
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Catalog
+ Catalog
+ magento-catalog-catalog
+
+
+ Default Category (ID: 2)
+ Categories
+ magento-catalog-catalog-categories
+
+
+ Products
+ Products
+ magento-catalog-catalog-products
+
+
+ Attribute Sets
+ Attribute Set
+ magento-catalog-catalog-attributes-sets
+
+
+ Product Attributes
+ Product
+ magento-catalog-catalog-attributes-attributes
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/AttributeSetData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/AttributeSetData.xml
new file mode 100644
index 0000000000000..6e1b25fb9cdc4
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/AttributeSetData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ 4
+ Default
+ 0
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CatalogRecentlyProductsConfigData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CatalogRecentlyProductsConfigData.xml
new file mode 100644
index 0000000000000..d1e469deaebba
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/CatalogRecentlyProductsConfigData.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+ EnableCatalogRecentlyProductsSynchronize
+
+
+
+ 1
+
+
+
+ DefaultCatalogRecentlyProductsSynchronize
+
+
+
+ 0
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index 134abcaa50354..817dd637f81dd 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -73,6 +73,20 @@
false
ProductAttributeFrontendLabel
+
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+
attribute
select
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
index 713c453bb7ad4..6d4314a6d865f 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
@@ -20,4 +20,10 @@
7
1
+
+
+ 0
+ 0
+ 0
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
index ba4a623e35def..3492dffd7cc7d 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
@@ -940,6 +940,19 @@
13
0
+
+ AAA Product
+
+
+ BBB Product
+
+
+ Product "!@#$%^&*()+:;\|}{][?=~`
+ |}{][?=~`
+
+
+ ProductWith128Chars 1234567891123456789112345678911234567891123456789112345678911234567891123456789112345678 endnums
+
sku_simple_product_
simple
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
index 83f0a56c21545..18564ff101fd9 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
@@ -12,4 +12,24 @@
Catalog Product Link
Product Link Block Template
+
+ Recently Compared Products
+ Magento Luma
+ Recently Compared Products
+
+ - All Store Views
+
+ All Pages
+ Sidebar Additional
+
+
+ Recently Viewed Products
+ Magento Luma
+ Recently Viewed Products
+
+ - All Store Views
+
+ All Pages
+ Sidebar Additional
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Metadata/catalog_recently_products-meta.xml b/app/code/Magento/Catalog/Test/Mftf/Metadata/catalog_recently_products-meta.xml
new file mode 100644
index 0000000000000..0fe4f154d5ef5
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Metadata/catalog_recently_products-meta.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
index e23a503266e33..dd5d5aef08a7c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCatalogProductWidgetSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCatalogProductWidgetSection.xml
new file mode 100644
index 0000000000000..3261db1f63f24
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCatalogProductWidgetSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml
index 697648cedb7ba..3ef78a3fe8f41 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml
@@ -14,6 +14,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
index e159a4ce5c0b6..a2a349ed67611 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
@@ -17,8 +17,23 @@
-
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
index da282d06145aa..f515171e835db 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
@@ -203,7 +203,9 @@
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml
new file mode 100644
index 0000000000000..87aab45bd8cb7
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml
new file mode 100644
index 0000000000000..4f66395bd0fbf
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..a51df86d0327a
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..1d9400bf81e4d
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml
new file mode 100644
index 0000000000000..ed29c281b804c
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml
new file mode 100644
index 0000000000000..28a33c4f20c01
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml
index df4803bcd7906..fb95fc3f57bca 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml
@@ -52,10 +52,6 @@
-
-
-
-
@@ -67,6 +63,14 @@
+
+
+
+
+
+
+
+
@@ -78,8 +82,9 @@
-
-
+
+
+
@@ -101,15 +106,12 @@
-
-
-
-
-
+
+
+
-
@@ -129,11 +131,9 @@
-
-
-
-
-
+
+
+
@@ -176,24 +176,29 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
@@ -205,14 +210,12 @@
-
-
-
-
-
-
-
+
+
+
+
+
@@ -250,13 +253,22 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -296,8 +308,7 @@
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
index cd6565f32ed18..a2d81854607a0 100644
--- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
@@ -154,38 +154,4 @@ public function modifyMetaLockedDataProvider()
{
return [[true], [false]];
}
-
- public function testModifyMetaWithCaching()
- {
- $this->arrayManagerMock->expects($this->exactly(2))
- ->method('findPath')
- ->willReturn(true);
- $cacheManager = $this->getMockBuilder(CacheInterface::class)
- ->getMockForAbstractClass();
- $cacheManager->expects($this->once())
- ->method('load')
- ->with(Categories::CATEGORY_TREE_ID . '_');
- $cacheManager->expects($this->once())
- ->method('save');
-
- $modifier = $this->createModel();
- $cacheContextProperty = new \ReflectionProperty(
- Categories::class,
- 'cacheManager'
- );
- $cacheContextProperty->setAccessible(true);
- $cacheContextProperty->setValue($modifier, $cacheManager);
-
- $groupCode = 'test_group_code';
- $meta = [
- $groupCode => [
- 'children' => [
- 'category_ids' => [
- 'sortOrder' => 10,
- ],
- ],
- ],
- ];
- $modifier->modifyMeta($meta);
- }
}
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
index 681435851fbde..800ead0e4030c 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php
@@ -3,6 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Catalog\Ui\DataProvider\Product\Form\Modifier;
use Magento\Catalog\Model\Locator\LocatorInterface;
@@ -11,6 +13,7 @@
use Magento\Framework\App\CacheInterface;
use Magento\Framework\DB\Helper as DbHelper;
use Magento\Catalog\Model\Category as CategoryModel;
+use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\UrlInterface;
use Magento\Framework\Stdlib\ArrayManager;
@@ -202,6 +205,7 @@ protected function createNewCategoryModal(array $meta)
*
* @param array $meta
* @return array
+ * @throws LocalizedException
* @since 101.0.0
*/
protected function customizeCategoriesField(array $meta)
@@ -306,20 +310,64 @@ protected function customizeCategoriesField(array $meta)
*
* @param string|null $filter
* @return array
+ * @throws LocalizedException
* @since 101.0.0
*/
protected function getCategoriesTree($filter = null)
{
- $categoryTree = $this->getCacheManager()->load(self::CATEGORY_TREE_ID . '_' . $filter);
- if ($categoryTree) {
- return $this->serializer->unserialize($categoryTree);
+ $storeId = (int) $this->locator->getStore()->getId();
+
+ $cachedCategoriesTree = $this->getCacheManager()
+ ->load($this->getCategoriesTreeCacheId($storeId, (string) $filter));
+ if (!empty($cachedCategoriesTree)) {
+ return $this->serializer->unserialize($cachedCategoriesTree);
}
- $storeId = $this->locator->getStore()->getId();
+ $categoriesTree = $this->retrieveCategoriesTree(
+ $storeId,
+ $this->retrieveShownCategoriesIds($storeId, (string) $filter)
+ );
+
+ $this->getCacheManager()->save(
+ $this->serializer->serialize($categoriesTree),
+ $this->getCategoriesTreeCacheId($storeId, (string) $filter),
+ [
+ \Magento\Catalog\Model\Category::CACHE_TAG,
+ \Magento\Framework\App\Cache\Type\Block::CACHE_TAG
+ ]
+ );
+
+ return $categoriesTree;
+ }
+
+ /**
+ * Get cache id for categories tree.
+ *
+ * @param int $storeId
+ * @param string $filter
+ * @return string
+ */
+ private function getCategoriesTreeCacheId(int $storeId, string $filter = '') : string
+ {
+ return self::CATEGORY_TREE_ID
+ . '_' . (string) $storeId
+ . '_' . $filter;
+ }
+
+ /**
+ * Retrieve filtered list of categories id.
+ *
+ * @param int $storeId
+ * @param string $filter
+ * @return array
+ * @throws LocalizedException
+ */
+ private function retrieveShownCategoriesIds(int $storeId, string $filter = '') : array
+ {
/* @var $matchingNamesCollection \Magento\Catalog\Model\ResourceModel\Category\Collection */
$matchingNamesCollection = $this->categoryCollectionFactory->create();
- if ($filter !== null) {
+ if (!empty($filter)) {
$matchingNamesCollection->addAttributeToFilter(
'name',
['like' => $this->dbHelper->addLikeEscape($filter, ['position' => 'any'])]
@@ -339,6 +387,19 @@ protected function getCategoriesTree($filter = null)
}
}
+ return $shownCategoriesIds;
+ }
+
+ /**
+ * Retrieve tree of categories with attributes.
+ *
+ * @param int $storeId
+ * @param array $shownCategoriesIds
+ * @return array|null
+ * @throws LocalizedException
+ */
+ private function retrieveCategoriesTree(int $storeId, array $shownCategoriesIds) : ?array
+ {
/* @var $collection \Magento\Catalog\Model\ResourceModel\Category\Collection */
$collection = $this->categoryCollectionFactory->create();
@@ -365,15 +426,6 @@ protected function getCategoriesTree($filter = null)
$categoryById[$category->getParentId()]['optgroup'][] = &$categoryById[$category->getId()];
}
- $this->getCacheManager()->save(
- $this->serializer->serialize($categoryById[CategoryModel::TREE_ROOT_ID]['optgroup']),
- self::CATEGORY_TREE_ID . '_' . $filter,
- [
- \Magento\Catalog\Model\Category::CACHE_TAG,
- \Magento\Framework\App\Cache\Type\Block::CACHE_TAG
- ]
- );
-
return $categoryById[CategoryModel::TREE_ROOT_ID]['optgroup'];
}
}
diff --git a/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php
new file mode 100644
index 0000000000000..27829155af292
--- /dev/null
+++ b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php
@@ -0,0 +1,58 @@
+stockConfiguration = $stockConfiguration;
+ }
+
+ /**
+ * Is product available for comparison.
+ *
+ * @param ProductInterface $product
+ * @return bool
+ */
+ public function isAvailableForCompare(ProductInterface $product): bool
+ {
+ return $this->isInStock($product) || $this->stockConfiguration->isShowOutOfStock();
+ }
+
+ /**
+ * Get is in stock status.
+ *
+ * @param ProductInterface $product
+ * @return bool
+ */
+ private function isInStock(ProductInterface $product): bool
+ {
+ $quantityAndStockStatus = $product->getQuantityAndStockStatus();
+ if (!$quantityAndStockStatus) {
+ return $product->isSalable();
+ }
+
+ return isset($quantityAndStockStatus['is_in_stock']) && $quantityAndStockStatus['is_in_stock'];
+ }
+}
diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml
index 41a2a6142d506..13e2d998f6cdd 100644
--- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml
+++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml
@@ -91,7 +91,11 @@
+ template="Magento_Catalog::product/view/addto/compare.phtml" >
+
+ Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability
+
+
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml
index f434402346087..ecc9700802d27 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml
@@ -169,7 +169,7 @@ switch ($type = $block->getType()) {
= /* @escapeNotVerified */ __('Check items to add to the cart or') ?>
-
+
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml
index adf0f44d0c831..194a472d81d58 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml
@@ -9,6 +9,10 @@
/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */
?>
+getData('addToCompareViewModel'); ?>
+isAvailableForCompare($block->getProduct())): ?>
= /* @escapeNotVerified */ __('Add to Compare') ?>
+
+
diff --git a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js
index 0c37f9ff4f007..66df48c28bfab 100644
--- a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js
+++ b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js
@@ -17,7 +17,7 @@ define([
relatedProductsField: '#related-products-field', // Hidden input field that stores related products.
selectAllMessage: $.mage.__('select all'),
unselectAllMessage: $.mage.__('unselect all'),
- selectAllLink: '[role="select-all"]',
+ selectAllLink: '[role="button"]',
elementsSelector: '.item.product'
},
diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
index 404c31296e4dd..edeb955b19c9b 100644
--- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php
+++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php
@@ -1247,6 +1247,7 @@ protected function _prepareRowForDb(array $rowData)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * phpcs:disable Generic.Metrics.NestingLevel
*/
protected function _saveLinks()
{
@@ -1256,7 +1257,7 @@ protected function _saveLinks()
$nextLinkId = $this->_resourceHelper->getNextAutoincrement($mainTable);
// pre-load 'position' attributes ID for each link type once
- foreach ($this->_linkNameToId as $linkName => $linkId) {
+ foreach ($this->_linkNameToId as $linkId) {
$select = $this->_connection->select()->from(
$resource->getTable('catalog_product_link_attribute'),
['id' => 'product_link_attribute_id']
@@ -1374,6 +1375,7 @@ protected function _saveLinks()
}
return $this;
}
+ // phpcs:enable
/**
* Save product attributes.
@@ -1608,6 +1610,7 @@ public function getImagesFromRow(array $rowData)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
* @throws LocalizedException
+ * phpcs:disable Generic.Metrics.NestingLevel
*/
protected function _saveProducts()
{
@@ -1798,7 +1801,13 @@ protected function _saveProducts()
$uploadedImages[$columnImage] = $uploadedFile;
} else {
unset($rowData[$column]);
- $this->skipRow($rowNum, ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE);
+ $this->addRowError(
+ ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,
+ $rowNum,
+ null,
+ null,
+ ProcessingError::ERROR_LEVEL_NOT_CRITICAL
+ );
}
} else {
$uploadedFile = $uploadedImages[$columnImage];
@@ -1974,6 +1983,7 @@ protected function _saveProducts()
return $this;
}
+ // phpcs:enable
/**
* Prepare array with image states (visible or hidden from product page)
diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml
index c7c9126f46803..2850b8d069201 100644
--- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml
+++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml
@@ -21,6 +21,7 @@
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminOpenNewCatalogPriceRuleFormPageActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminOpenNewCatalogPriceRuleFormPageActionGroup.xml
new file mode 100644
index 0000000000000..072e8b24b0336
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminOpenNewCatalogPriceRuleFormPageActionGroup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCustomerGroupNotOnCatalogPriceRuleFormActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCustomerGroupNotOnCatalogPriceRuleFormActionGroup.xml
new file mode 100644
index 0000000000000..93a2a8a610951
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCustomerGroupNotOnCatalogPriceRuleFormActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+ customerGroups
+ {{customerGroup.code}}
+
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..eb9cac1401c36
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Marketing
+ Marketing
+ magento-backend-marketing
+
+
+ Catalog Price Rule
+ Catalog Price Rule
+ magento-catalogrule-promo-catalog
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Page/CatalogRuleNewPage.xml b/app/code/Magento/CatalogRule/Test/Mftf/Page/CatalogRuleNewPage.xml
new file mode 100644
index 0000000000000..ad3e40b37c5b0
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Page/CatalogRuleNewPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml
new file mode 100644
index 0000000000000..0fe35419aaf3e
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/DeleteCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/DeleteCustomerGroupTest.xml
new file mode 100644
index 0000000000000..75223fcfc4c4b
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/DeleteCustomerGroupTest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogRule/etc/mview.xml b/app/code/Magento/CatalogRule/etc/mview.xml
index 35efe33461afc..9e5a1c866a842 100644
--- a/app/code/Magento/CatalogRule/etc/mview.xml
+++ b/app/code/Magento/CatalogRule/etc/mview.xml
@@ -16,7 +16,6 @@
-
diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
index 2ffa63098cdee..c758e773f43c1 100644
--- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
+++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
@@ -8,7 +8,9 @@
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
+use Magento\CatalogSearch\Model\Search\FilterMapper\VisibilityFilter;
use Magento\CatalogSearch\Model\Search\TableMapper;
+use Magento\Customer\Model\Session;
use Magento\Eav\Model\Config;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\ObjectManager;
@@ -20,10 +22,11 @@
use Magento\Framework\Search\Adapter\Mysql\Filter\PreprocessorInterface;
use Magento\Framework\Search\Request\FilterInterface;
use Magento\Store\Model\Store;
-use Magento\Customer\Model\Session;
-use Magento\CatalogSearch\Model\Search\FilterMapper\VisibilityFilter;
/**
+ * ElasticSearch search filter pre-processor.
+ *
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @deprecated
* @see \Magento\ElasticSearch
@@ -128,7 +131,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function process(FilterInterface $filter, $isNegation, $query)
{
@@ -136,10 +139,13 @@ public function process(FilterInterface $filter, $isNegation, $query)
}
/**
+ * Process query with field.
+ *
* @param FilterInterface $filter
* @param bool $isNegation
* @param string $query
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
private function processQueryWithField(FilterInterface $filter, $isNegation, $query)
{
@@ -170,7 +176,7 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu
} elseif ($filter->getField() === VisibilityFilter::VISIBILITY_FILTER_FIELD) {
return '';
} elseif ($filter->getType() === FilterInterface::TYPE_TERM &&
- in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true)
+ in_array($attribute->getFrontendInput(), ['select', 'multiselect', 'boolean'], true)
) {
$resultQuery = $this->processTermSelect($filter, $isNegation);
} elseif ($filter->getType() === FilterInterface::TYPE_RANGE &&
@@ -204,19 +210,23 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu
->where('main_table.store_id = ?', Store::DEFAULT_STORE_ID)
->having($query);
- $resultQuery = 'search_index.entity_id IN (
- select entity_id from ' . $this->conditionManager->wrapBrackets($select) . ' as filter
- )';
+ $resultQuery = 'search_index.entity_id IN ('
+ . 'select entity_id from '
+ . $this->conditionManager->wrapBrackets($select)
+ . ' as filter)';
}
return $resultQuery;
}
/**
+ * Process range numeric.
+ *
* @param FilterInterface $filter
* @param string $query
* @param Attribute $attribute
* @return string
+ * @throws \Exception
*/
private function processRangeNumeric(FilterInterface $filter, $query, $attribute)
{
@@ -238,14 +248,17 @@ private function processRangeNumeric(FilterInterface $filter, $query, $attribute
->where('main_table.store_id = ?', $currentStoreId)
->having($query);
- $resultQuery = 'search_index.entity_id IN (
- select entity_id from ' . $this->conditionManager->wrapBrackets($select) . ' as filter
- )';
+ $resultQuery = 'search_index.entity_id IN ('
+ . 'select entity_id from '
+ . $this->conditionManager->wrapBrackets($select)
+ . ' as filter)';
return $resultQuery;
}
/**
+ * Process term select.
+ *
* @param FilterInterface $filter
* @param bool $isNegation
* @return string
diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php
index e61a886a41d6f..e9fb1070fedd5 100644
--- a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php
+++ b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php
@@ -111,12 +111,9 @@ protected function _getItemsData()
$from = '';
}
if ($to == '*') {
- $to = '';
+ $to = null;
}
- $label = $this->renderRangeLabel(
- empty($from) ? 0 : $from,
- empty($to) ? 0 : $to
- );
+ $label = $this->renderRangeLabel(empty($from) ? 0 : $from, $to);
$value = $from . '-' . $to;
$data[] = [
@@ -141,7 +138,7 @@ protected function _getItemsData()
protected function renderRangeLabel($fromPrice, $toPrice)
{
$formattedFromPrice = $this->priceCurrency->format($fromPrice);
- if ($toPrice === '') {
+ if ($toPrice === null) {
return __('%1 and above', $formattedFromPrice);
} else {
if ($fromPrice != $toPrice) {
diff --git a/app/code/Magento/CatalogSearch/Model/Search/CustomAttributeFilterCheck.php b/app/code/Magento/CatalogSearch/Model/Search/CustomAttributeFilterCheck.php
index bcd4080b30b14..657c8540d7c68 100644
--- a/app/code/Magento/CatalogSearch/Model/Search/CustomAttributeFilterCheck.php
+++ b/app/code/Magento/CatalogSearch/Model/Search/CustomAttributeFilterCheck.php
@@ -44,7 +44,7 @@ public function isCustom(FilterInterface $filter)
return $attribute
&& $filter->getType() === FilterInterface::TYPE_TERM
- && in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true);
+ && in_array($attribute->getFrontendInput(), ['select', 'multiselect', 'boolean'], true);
}
/**
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
index 4b52b2c669edf..067d76821d687 100644
--- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
@@ -20,6 +20,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..df1c3db6e5661
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Search Terms
+ Search Terms
+ magento-search-search-terms
+
+
+ Search Terms Report
+ Search Terms
+ magento-search-report-search-term
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..bc255020d98b3
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..85cf0e3ba90ed
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml
new file mode 100644
index 0000000000000..19db201e91f40
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml
@@ -0,0 +1,629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $attributeSet.attribute_set_id$
+
+
+
+
+
+
+
+ $attributeSet.attribute_set_id$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php b/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php
index 3f6f638db5b82..557f143352446 100644
--- a/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php
+++ b/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php
@@ -122,6 +122,7 @@ private function convertElementsToSelect($elements, $attributesToConvert)
if (!in_array($code, $codes)) {
continue;
}
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
$options = call_user_func($attributesToConvert[$code]);
if (!is_array($options)) {
continue;
@@ -287,8 +288,14 @@ private function getBillingAddressComponent($paymentCode, $elements)
'provider' => 'checkoutProvider',
'deps' => 'checkoutProvider',
'dataScopePrefix' => 'billingAddress' . $paymentCode,
+ 'billingAddressListProvider' => '${$.name}.billingAddressList',
'sortOrder' => 1,
'children' => [
+ 'billingAddressList' => [
+ 'component' => 'Magento_Checkout/js/view/billing-address/list',
+ 'displayArea' => 'billing-address-list',
+ 'template' => 'Magento_Checkout/billing-address/list'
+ ],
'form-fields' => [
'component' => 'uiComponent',
'displayArea' => 'additional-fieldsets',
diff --git a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php
index f30bd73deeae2..470d4a3aca561 100644
--- a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php
+++ b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php
@@ -10,6 +10,7 @@
use Magento\Checkout\Model\Session as CheckoutSession;
use Magento\Customer\Api\AddressMetadataInterface;
use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository;
+use Magento\Customer\Model\Address\CustomerAddressDataProvider;
use Magento\Customer\Model\Context as CustomerContext;
use Magento\Customer\Model\Session as CustomerSession;
use Magento\Customer\Model\Url as CustomerUrlManager;
@@ -34,6 +35,7 @@
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class DefaultConfigProvider implements ConfigProviderInterface
{
@@ -177,6 +179,11 @@ class DefaultConfigProvider implements ConfigProviderInterface
*/
private $addressMetadata;
+ /**
+ * @var CustomerAddressDataProvider
+ */
+ private $customerAddressData;
+
/**
* @param CheckoutHelper $checkoutHelper
* @param Session $checkoutSession
@@ -206,6 +213,7 @@ class DefaultConfigProvider implements ConfigProviderInterface
* @param UrlInterface $urlBuilder
* @param AddressMetadataInterface $addressMetadata
* @param AttributeOptionManagementInterface $attributeOptionManager
+ * @param CustomerAddressDataProvider|null $customerAddressData
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
@@ -237,7 +245,8 @@ public function __construct(
\Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement,
UrlInterface $urlBuilder,
AddressMetadataInterface $addressMetadata = null,
- AttributeOptionManagementInterface $attributeOptionManager = null
+ AttributeOptionManagementInterface $attributeOptionManager = null,
+ CustomerAddressDataProvider $customerAddressData = null
) {
$this->checkoutHelper = $checkoutHelper;
$this->checkoutSession = $checkoutSession;
@@ -268,6 +277,8 @@ public function __construct(
$this->addressMetadata = $addressMetadata ?: ObjectManager::getInstance()->get(AddressMetadataInterface::class);
$this->attributeOptionManager = $attributeOptionManager ??
ObjectManager::getInstance()->get(AttributeOptionManagementInterface::class);
+ $this->customerAddressData = $customerAddressData ?:
+ ObjectManager::getInstance()->get(CustomerAddressDataProvider::class);
}
/**
@@ -359,57 +370,18 @@ private function isAutocompleteEnabled()
*
* @return array
*/
- private function getCustomerData()
+ private function getCustomerData(): array
{
$customerData = [];
if ($this->isCustomerLoggedIn()) {
+ /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */
$customer = $this->customerRepository->getById($this->customerSession->getCustomerId());
$customerData = $customer->__toArray();
- foreach ($customer->getAddresses() as $key => $address) {
- $customerData['addresses'][$key]['inline'] = $this->getCustomerAddressInline($address);
- if ($address->getCustomAttributes()) {
- $customerData['addresses'][$key]['custom_attributes'] = $this->filterNotVisibleAttributes(
- $customerData['addresses'][$key]['custom_attributes']
- );
- }
- }
+ $customerData['addresses'] = $this->customerAddressData->getAddressDataByCustomer($customer);
}
return $customerData;
}
- /**
- * Filter not visible on storefront custom attributes.
- *
- * @param array $attributes
- * @return array
- */
- private function filterNotVisibleAttributes(array $attributes)
- {
- $attributesMetadata = $this->addressMetadata->getAllAttributesMetadata();
- foreach ($attributesMetadata as $attributeMetadata) {
- if (!$attributeMetadata->isVisible()) {
- unset($attributes[$attributeMetadata->getAttributeCode()]);
- }
- }
-
- return $this->setLabelsToAttributes($attributes);
- }
-
- /**
- * Set additional customer address data
- *
- * @param \Magento\Customer\Api\Data\AddressInterface $address
- * @return string
- */
- private function getCustomerAddressInline($address)
- {
- $builtOutputAddressData = $this->addressMapper->toFlatArray($address);
- return $this->addressConfig
- ->getFormatByCode(\Magento\Customer\Model\Address\Config::DEFAULT_ADDRESS_FORMAT)
- ->getRenderer()
- ->renderArray($builtOutputAddressData);
- }
-
/**
* Retrieve quote data
*
@@ -726,61 +698,6 @@ private function getPaymentMethods()
return $paymentMethods;
}
- /**
- * Set Labels to custom Attributes
- *
- * @param array $customAttributes
- * @return array $customAttributes
- * @throws \Magento\Framework\Exception\InputException
- * @throws \Magento\Framework\Exception\StateException
- */
- private function setLabelsToAttributes(array $customAttributes) : array
- {
- if (!empty($customAttributes)) {
- foreach ($customAttributes as $customAttributeCode => $customAttribute) {
- $attributeOptionLabels = $this->getAttributeLabels($customAttribute, $customAttributeCode);
- if (!empty($attributeOptionLabels)) {
- $customAttributes[$customAttributeCode]['label'] = implode(', ', $attributeOptionLabels);
- }
- }
- }
-
- return $customAttributes;
- }
-
- /**
- * Get Labels by CustomAttribute and CustomAttributeCode
- *
- * @param array $customAttribute
- * @param string|integer $customAttributeCode
- * @return array $attributeOptionLabels
- * @throws \Magento\Framework\Exception\InputException
- * @throws \Magento\Framework\Exception\StateException
- */
- private function getAttributeLabels(array $customAttribute, string $customAttributeCode) : array
- {
- $attributeOptionLabels = [];
-
- if (!empty($customAttribute['value'])) {
- $customAttributeValues = explode(',', $customAttribute['value']);
- $attributeOptions = $this->attributeOptionManager->getItems(
- \Magento\Customer\Model\Indexer\Address\AttributeProvider::ENTITY,
- $customAttributeCode
- );
-
- if (!empty($attributeOptions)) {
- foreach ($attributeOptions as $attributeOption) {
- $attributeOptionValue = $attributeOption->getValue();
- if (in_array($attributeOptionValue, $customAttributeValues)) {
- $attributeOptionLabels[] = $attributeOption->getLabel() ?? $attributeOptionValue;
- }
- }
- }
- }
-
- return $attributeOptionLabels;
- }
-
/**
* Get notification messages for the quote items
*
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailNoteMessageOnCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailNoteMessageOnCheckoutActionGroup.xml
new file mode 100644
index 0000000000000..c4fc753e73713
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailNoteMessageOnCheckoutActionGroup.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailTooltipContentOnCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailTooltipContentOnCheckoutActionGroup.xml
new file mode 100644
index 0000000000000..f9c6771262ccc
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailTooltipContentOnCheckoutActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailValidationMessageOnCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailValidationMessageOnCheckoutActionGroup.xml
new file mode 100644
index 0000000000000..14b96ed46ce6b
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontEmailValidationMessageOnCheckoutActionGroup.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml
index b67b7451d5968..2e4b742ece8ec 100644
--- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml
@@ -110,7 +110,7 @@
-
+
@@ -241,6 +241,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -257,13 +272,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillNewShippingAddressModalActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillNewShippingAddressModalActionGroup.xml
new file mode 100644
index 0000000000000..7035855cc0ed3
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillNewShippingAddressModalActionGroup.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartEstimateShippingAndTaxActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartEstimateShippingAndTaxActionGroup.xml
new file mode 100644
index 0000000000000..0d6f34098c048
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartEstimateShippingAndTaxActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartShippingMethodSelectedActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartShippingMethodSelectedActionGroup.xml
new file mode 100644
index 0000000000000..4061f97821cd0
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCartShippingMethodSelectedActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutEstimateShippingInformationActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutEstimateShippingInformationActionGroup.xml
new file mode 100644
index 0000000000000..82d7e12105b8c
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutEstimateShippingInformationActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutShippingMethodSelectedActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutShippingMethodSelectedActionGroup.xml
new file mode 100644
index 0000000000000..33f2852f1f0ad
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertCheckoutShippingMethodSelectedActionGroup.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertGuestShippingInfoActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertGuestShippingInfoActionGroup.xml
new file mode 100644
index 0000000000000..02c362bf34058
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertGuestShippingInfoActionGroup.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertShippingMethodPresentInCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertShippingMethodPresentInCartActionGroup.xml
new file mode 100644
index 0000000000000..3d8530ae83704
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertShippingMethodPresentInCartActionGroup.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartEstimateShippingAndTaxActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartEstimateShippingAndTaxActionGroup.xml
new file mode 100644
index 0000000000000..4176859f99f70
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCartEstimateShippingAndTaxActionGroup.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillEmailFieldOnCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillEmailFieldOnCheckoutActionGroup.xml
new file mode 100644
index 0000000000000..fcac780a36776
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillEmailFieldOnCheckoutActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillGuestShippingInfoActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillGuestShippingInfoActionGroup.xml
new file mode 100644
index 0000000000000..e7669d62c79a0
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillGuestShippingInfoActionGroup.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCheckoutPageActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCheckoutPageActionGroup.xml
new file mode 100644
index 0000000000000..b18d476c02c65
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCheckoutPageActionGroup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Data/EstimateAndTaxData.xml b/app/code/Magento/Checkout/Test/Mftf/Data/EstimateAndTaxData.xml
new file mode 100644
index 0000000000000..36dea5a521a04
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Data/EstimateAndTaxData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ United States
+ California
+ 90240
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml
index 8d14a9a561900..3100fae3b119b 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml
@@ -20,9 +20,12 @@
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
index 0206c18b819c2..cbe71e9cffa60 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
@@ -54,5 +54,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.xml
new file mode 100644
index 0000000000000..42decd8d43220
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml
index 6838824400b96..b19e365f2e32c 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml
@@ -9,13 +9,17 @@
-
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml
index ab4b59fd67d03..77d903eab3934 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml
@@ -17,5 +17,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
index d825e10395145..9676f16f3a5c6 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutCheckoutCustomerLoginSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutCheckoutCustomerLoginSection.xml
new file mode 100644
index 0000000000000..9772fa1993acb
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutCheckoutCustomerLoginSection.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
index 55c4385706ba9..9d9a96d2ea5e6 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
@@ -12,5 +12,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml
new file mode 100644
index 0000000000000..166f5022d5aeb
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
index e7c2ad3dd28a4..fadc9ec50ad8d 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
@@ -186,20 +186,20 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
@@ -216,16 +216,18 @@
-
-
+
+
+
-
-
-
+
+
+
+
@@ -253,16 +255,18 @@
-
-
-
-
-
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
index 8537e10ce5a03..651c5bd8d4375 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
@@ -71,6 +71,7 @@
+
@@ -89,7 +90,7 @@
-
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml
new file mode 100644
index 0000000000000..20ff67a076e1e
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontValidateEmailOnCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontValidateEmailOnCheckoutTest.xml
new file mode 100644
index 0000000000000..1b27e1d53adad
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontValidateEmailOnCheckoutTest.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
index 64b70e80bd84f..a305413bcf1f3 100644
--- a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
+++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
@@ -105,7 +105,7 @@
- opc-new-shipping-address
-
-
-
- Save Address
+ - Ship here
- action primary action-save-address
-
diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml
index 454031279d882..d15794fb761bb 100644
--- a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml
+++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml
@@ -84,20 +84,20 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
|
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/create-billing-address.js b/app/code/Magento/Checkout/view/frontend/web/js/action/create-billing-address.js
index 7db0dc5ce7473..c601bb8acf125 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/action/create-billing-address.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/action/create-billing-address.js
@@ -12,6 +12,17 @@ define([
'use strict';
return function (addressData) {
- return addressConverter.formAddressDataToQuoteAddress(addressData);
+ var address = addressConverter.formAddressDataToQuoteAddress(addressData);
+
+ /**
+ * Returns new customer billing address type.
+ *
+ * @returns {String}
+ */
+ address.getType = function () {
+ return 'new-customer-billing-address';
+ };
+
+ return address;
};
});
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
index 9cc60a3645d58..bc0ab59b622a2 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
@@ -216,11 +216,11 @@ define([
newCustomerBillingAddressData = checkoutData.getNewCustomerBillingAddress();
if (selectedBillingAddress) {
- if (selectedBillingAddress == 'new-customer-address' && newCustomerBillingAddressData) { //eslint-disable-line
+ if (selectedBillingAddress === 'new-customer-billing-address' && newCustomerBillingAddressData) {
selectBillingAddress(createBillingAddress(newCustomerBillingAddressData));
} else {
addressList.some(function (address) {
- if (selectedBillingAddress == address.getKey()) { //eslint-disable-line eqeqeq
+ if (selectedBillingAddress === address.getKey()) {
selectBillingAddress(address);
}
});
@@ -243,7 +243,7 @@ define([
return;
}
- if (quote.isVirtual()) {
+ if (quote.isVirtual() || !quote.billingAddress()) {
isBillingAddressInitialized = addressList.some(function (addrs) {
if (addrs.isDefaultBilling()) {
selectBillingAddress(addrs);
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js
index d68b0682eb511..a552aa01da061 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js
@@ -40,30 +40,23 @@ function (
'use strict';
var lastSelectedBillingAddress = null,
- newAddressOption = {
- /**
- * Get new address label
- * @returns {String}
- */
- getAddressInline: function () {
- return $t('New Address');
- },
- customerAddressId: null
- },
countryData = customerData.get('directory-data'),
addressOptions = addressList().filter(function (address) {
- return address.getType() == 'customer-address'; //eslint-disable-line eqeqeq
+ return address.getType() === 'customer-address';
});
- addressOptions.push(newAddressOption);
-
return Component.extend({
defaults: {
- template: 'Magento_Checkout/billing-address'
+ template: 'Magento_Checkout/billing-address',
+ actionsTemplate: 'Magento_Checkout/billing-address/actions',
+ formTemplate: 'Magento_Checkout/billing-address/form',
+ detailsTemplate: 'Magento_Checkout/billing-address/details',
+ links: {
+ isAddressFormVisible: '${$.billingAddressListProvider}:isNewAddressSelected'
+ }
},
currentBillingAddress: quote.billingAddress,
- addressOptions: addressOptions,
- customerHasAddresses: addressOptions.length > 1,
+ customerHasAddresses: addressOptions.length > 0,
/**
* Init component
@@ -84,7 +77,7 @@ function (
.observe({
selectedAddress: null,
isAddressDetailsVisible: quote.billingAddress() != null,
- isAddressFormVisible: !customer.isLoggedIn() || addressOptions.length === 1,
+ isAddressFormVisible: !customer.isLoggedIn() || !addressOptions.length,
isAddressSameAsShipping: false,
saveInAddressBook: 1
});
@@ -147,7 +140,7 @@ function (
updateAddress: function () {
var addressData, newBillingAddress;
- if (this.selectedAddress() && this.selectedAddress() != newAddressOption) { //eslint-disable-line eqeqeq
+ if (this.selectedAddress() && !this.isAddressFormVisible()) {
selectBillingAddress(this.selectedAddress());
checkoutData.setSelectedBillingAddress(this.selectedAddress().getKey());
} else {
@@ -218,13 +211,6 @@ function (
}
},
- /**
- * @param {Object} address
- */
- onAddressChange: function (address) {
- this.isAddressFormVisible(address == newAddressOption); //eslint-disable-line eqeqeq
- },
-
/**
* @param {Number} countryId
* @return {*}
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address/list.js b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address/list.js
new file mode 100644
index 0000000000000..ca3a267c01671
--- /dev/null
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address/list.js
@@ -0,0 +1,77 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+define([
+ 'uiComponent',
+ 'Magento_Customer/js/model/address-list',
+ 'mage/translate',
+ 'Magento_Customer/js/model/customer'
+], function (Component, addressList, $t, customer) {
+ 'use strict';
+
+ var newAddressOption = {
+ /**
+ * Get new address label
+ * @returns {String}
+ */
+ getAddressInline: function () {
+ return $t('New Address');
+ },
+ customerAddressId: null
+ },
+ addressOptions = addressList().filter(function (address) {
+ return address.getType() === 'customer-address';
+ });
+
+ return Component.extend({
+ defaults: {
+ template: 'Magento_Checkout/billing-address',
+ selectedAddress: null,
+ isNewAddressSelected: false,
+ addressOptions: addressOptions,
+ exports: {
+ selectedAddress: '${ $.parentName }:selectedAddress'
+ }
+ },
+
+ /**
+ * @returns {Object} Chainable.
+ */
+ initConfig: function () {
+ this._super();
+ this.addressOptions.push(newAddressOption);
+
+ return this;
+ },
+
+ /**
+ * @return {exports.initObservable}
+ */
+ initObservable: function () {
+ this._super()
+ .observe('selectedAddress isNewAddressSelected')
+ .observe({
+ isNewAddressSelected: !customer.isLoggedIn() || !addressOptions.length
+ });
+
+ return this;
+ },
+
+ /**
+ * @param {Object} address
+ * @return {*}
+ */
+ addressOptionsText: function (address) {
+ return address.getAddressInline();
+ },
+
+ /**
+ * @param {Object} address
+ */
+ onAddressChange: function (address) {
+ this.isNewAddressSelected(address === newAddressOption);
+ }
+ });
+});
diff --git a/app/code/Magento/Checkout/view/frontend/web/template/authentication.html b/app/code/Magento/Checkout/view/frontend/web/template/authentication.html
index 406a7d899b67a..5b8dde81dd93e 100644
--- a/app/code/Magento/Checkout/view/frontend/web/template/authentication.html
+++ b/app/code/Magento/Checkout/view/frontend/web/template/authentication.html
@@ -31,15 +31,15 @@