diff --git a/.editorconfig b/.editorconfig
index 1a9acd92fc0fc..40f57587d3497 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,3 +16,7 @@ indent_size = 2
[{composer, auth}.json]
indent_size = 4
+
+[db_schema_whitelist.json]
+indent_size = 4
+trim_trailing_whitespace = false
diff --git a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml
index d4aa14250837f..4bdee469e2fa4 100644
--- a/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml
+++ b/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml
@@ -14,12 +14,13 @@
* getPagerVisibility()
* getVarNamePage()
*/
-$numColumns = count($block->getColumns());
/**
* @var \Magento\Backend\Block\Widget\Grid\Extended $block
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
*/
+$numColumns = count($block->getColumns());
+
?>
getCollection()): ?>
canDisplayContainer()): ?>
@@ -285,7 +286,9 @@ $numColumns = count($block->getColumns());
+ canDisplayContainer()): ?>
+
getData('jsonHelper');
diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
index 64e9f56dd65bc..a7f0a70b45219 100644
--- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
+++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
@@ -8,6 +8,7 @@
namespace Magento\Bundle\Model\Sales\Order\Pdf\Items;
use Magento\Framework\Data\Collection\AbstractDb;
+use Magento\Framework\DataObject;
use Magento\Framework\Filesystem;
use Magento\Framework\Filter\FilterManager;
use Magento\Framework\Model\Context;
@@ -69,34 +70,38 @@ public function __construct(
}
/**
- * Draw item line
+ * Draw bundle product item line
*
* @return void
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.NPathComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function draw()
{
- $order = $this->getOrder();
- $item = $this->getItem();
- $pdf = $this->getPdf();
- $page = $this->getPage();
+ $draw = $this->drawChildrenItems();
+ $draw = $this->drawCustomOptions($draw);
+ $page = $this->getPdf()->drawLineBlocks($this->getPage(), $draw, ['table_header' => true]);
+
+ $this->setPage($page);
+ }
+
+ /**
+ * Draw bundle product children items
+ *
+ * @return array
+ */
+ private function drawChildrenItems(): array
+ {
$this->_setFontRegular();
- $items = $this->getChildren($item);
$prevOptionId = '';
$drawItems = [];
-
- foreach ($items as $childItem) {
- $line = [];
-
+ $optionId = 0;
+ $lines = [];
+ foreach ($this->getChildren($this->getItem()) as $childItem) {
+ $index = array_key_last($lines) !== null ? array_key_last($lines) + 1 : 0;
$attributes = $this->getSelectionAttributes($childItem);
if (is_array($attributes)) {
$optionId = $attributes['option_id'];
- } else {
- $optionId = 0;
}
if (!isset($drawItems[$optionId])) {
@@ -104,15 +109,13 @@ public function draw()
}
if ($childItem->getOrderItem()->getParentItem() && $prevOptionId != $attributes['option_id']) {
- $line[0] = [
+ $lines[$index][] = [
'font' => 'italic',
'text' => $this->string->split($attributes['option_label'], 45, true, true),
'feed' => 35,
];
- $drawItems[$optionId] = ['lines' => [$line], 'height' => 15];
-
- $line = [];
+ $index++;
$prevOptionId = $attributes['option_id'];
}
@@ -124,35 +127,97 @@ public function draw()
$feed = 35;
$name = $childItem->getName();
}
- $line[] = ['text' => $this->string->split($name, 35, true, true), 'feed' => $feed];
+ $lines[$index][] = ['text' => $this->string->split($name, 35, true, true), 'feed' => $feed];
- // draw SKUs
- if (!$childItem->getOrderItem()->getParentItem()) {
- $text = [];
- foreach ($this->string->split($item->getSku(), 17) as $part) {
- $text[] = $part;
- }
- $line[] = ['text' => $text, 'feed' => 255];
- }
+ $lines = $this->drawSkus($childItem, $lines);
- // draw prices
- if ($this->canShowPriceInfo($childItem)) {
- $price = $order->formatPriceTxt($childItem->getPrice());
- $line[] = ['text' => $price, 'feed' => 395, 'font' => 'bold', 'align' => 'right'];
- $line[] = ['text' => $childItem->getQty() * 1, 'feed' => 435, 'font' => 'bold'];
+ $lines = $this->drawPrices($childItem, $lines);
+ }
+ $drawItems[$optionId]['lines'] = $lines;
- $tax = $order->formatPriceTxt($childItem->getTaxAmount());
- $line[] = ['text' => $tax, 'feed' => 495, 'font' => 'bold', 'align' => 'right'];
+ return $drawItems;
+ }
- $row_total = $order->formatPriceTxt($childItem->getRowTotal());
- $line[] = ['text' => $row_total, 'feed' => 565, 'font' => 'bold', 'align' => 'right'];
+ /**
+ * Draw sku parts
+ *
+ * @param DataObject $childItem
+ * @param array $lines
+ * @return array
+ */
+ private function drawSkus(DataObject $childItem, array $lines): array
+ {
+ $index = array_key_last($lines);
+ if (!$childItem->getOrderItem()->getParentItem()) {
+ $text = [];
+ foreach ($this->string->split($this->getItem()->getSku(), 17) as $part) {
+ $text[] = $part;
}
+ $lines[$index][] = ['text' => $text, 'feed' => 255];
+ }
+
+ return $lines;
+ }
- $drawItems[$optionId]['lines'][] = $line;
+ /**
+ * Draw prices for bundle product children items
+ *
+ * @param DataObject $childItem
+ * @param array $lines
+ * @return array
+ */
+ private function drawPrices(DataObject $childItem, array $lines): array
+ {
+ $index = array_key_last($lines);
+ if ($this->canShowPriceInfo($childItem)) {
+ $lines[$index][] = ['text' => $childItem->getQty() * 1, 'feed' => 435, 'align' => 'right'];
+
+ $tax = $this->getOrder()->formatPriceTxt($childItem->getTaxAmount());
+ $lines[$index][] = ['text' => $tax, 'feed' => 495, 'font' => 'bold', 'align' => 'right'];
+
+ $item = $this->getItem();
+ $this->_item = $childItem;
+ $feedPrice = 380;
+ $feedSubtotal = $feedPrice + 185;
+ foreach ($this->getItemPricesForDisplay() as $priceData) {
+ if (isset($priceData['label'])) {
+ // draw Price label
+ $lines[$index][] = ['text' => $priceData['label'], 'feed' => $feedPrice, 'align' => 'right'];
+ // draw Subtotal label
+ $lines[$index][] = ['text' => $priceData['label'], 'feed' => $feedSubtotal, 'align' => 'right'];
+ $index++;
+ }
+ // draw Price
+ $lines[$index][] = [
+ 'text' => $priceData['price'],
+ 'feed' => $feedPrice,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ];
+ // draw Subtotal
+ $lines[$index][] = [
+ 'text' => $priceData['subtotal'],
+ 'feed' => $feedSubtotal,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ];
+ $index++;
+ }
+ $this->_item = $item;
}
- // custom options
- $options = $item->getOrderItem()->getProductOptions();
+ return $lines;
+ }
+
+ /**
+ * Draw bundle product custom options
+ *
+ * @param array $draw
+ * @return array
+ */
+ private function drawCustomOptions(array $draw): array
+ {
+ $options = $this->getItem()->getOrderItem()->getProductOptions();
if ($options && isset($options['options'])) {
foreach ($options['options'] as $option) {
$lines = [];
@@ -180,12 +245,10 @@ public function draw()
$lines[][] = ['text' => $text, 'feed' => 40];
}
- $drawItems[] = ['lines' => $lines, 'height' => 15];
+ $draw[] = ['lines' => $lines, 'height' => 15];
}
}
- $page = $pdf->drawLineBlocks($page, $drawItems, ['table_header' => true]);
-
- $this->setPage($page);
+ return $draw;
}
}
diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php
index a28d721cc9a4e..52a024dc9fac3 100644
--- a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php
+++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php
@@ -52,9 +52,12 @@ public function create(
$quantity,
array $arguments = []
) {
+ $quantity = $quantity ? (float)$quantity : 1.;
+ $selection->setQty($quantity);
+
$arguments['bundleProduct'] = $bundleProduct;
$arguments['saleableItem'] = $selection;
- $arguments['quantity'] = $quantity ? (float)$quantity : 1.;
+ $arguments['quantity'] = $quantity;
return $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments);
}
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml
index ca8a35ee7a363..ceed14e76fb4b 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml
@@ -42,9 +42,13 @@
-
-
-
+
+
+
+
+
+
+
@@ -64,9 +68,11 @@
-
-
-
+
+
+
+
+
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml
index 79d85c6ced957..228c1d3cf1def 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml
@@ -109,9 +109,11 @@
-
-
-
+
+
+
+
+
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml
index 88fc5b7171592..e08982a266ee5 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml
@@ -70,7 +70,7 @@
-
+
diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php
index b7041051591d8..9c4d4ce00b7c0 100644
--- a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php
@@ -11,7 +11,6 @@
use Magento\Bundle\Model\Product\Type;
use Magento\Bundle\Model\ResourceModel\BundleFactory;
use Magento\Bundle\Model\ResourceModel\Option\Collection;
-use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor;
use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionCollection;
use Magento\Bundle\Model\ResourceModel\Selection\CollectionFactory;
use Magento\Bundle\Model\Selection;
@@ -28,6 +27,7 @@
use Magento\CatalogInventory\Api\StockStateInterface;
use Magento\CatalogInventory\Model\StockRegistry;
use Magento\CatalogInventory\Model\StockState;
+use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor;
use Magento\Framework\DataObject;
use Magento\Framework\EntityManager\EntityMetadataInterface;
use Magento\Framework\EntityManager\MetadataPool;
@@ -1548,6 +1548,10 @@ public function testPrepareForCartAdvancedSpecifyProductOptions()
->disableOriginalConstructor()
->getMock();
+ $buyRequest->method('getOptions')
+ ->willReturn([333 => ['type' => 'image/jpeg']]);
+ $option->method('getId')
+ ->willReturn(333);
$this->parentClass($group, $option, $buyRequest, $product);
$product->expects($this->any())
@@ -1556,6 +1560,8 @@ public function testPrepareForCartAdvancedSpecifyProductOptions()
$buyRequest->expects($this->once())
->method('getBundleOption')
->willReturn([0, '', 'str']);
+ $group->expects($this->once())
+ ->method('validateUserValue');
$result = $this->model->prepareForCartAdvanced($buyRequest, $product);
$this->assertEquals('Please specify product option(s).', $result);
diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTest.php
new file mode 100644
index 0000000000000..e5bf94241dbd9
--- /dev/null
+++ b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTest.php
@@ -0,0 +1,184 @@
+createMock(Context::class);
+ $registryMock = $this->createMock(Registry::class);
+ $this->taxDataMock = $this->createMock(Data::class);
+ $directoryMock = $this->createMock(Filesystem\Directory\Read::class);
+ $directoryMock->expects($this->any())->method('getAbsolutePath')->willReturn('');
+ $filesystemMock = $this->createMock(Filesystem::class);
+ $filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($directoryMock);
+ $filterManagerMock = $this->createMock(FilterManager::class);
+ $stringUtilsMock = $this->createMock(StringUtils::class);
+ $stringUtilsMock->expects($this->any())->method('split')->willReturnArgument(0);
+ $resourceMock = $this->createMock(AbstractResource::class);
+ $collectionMock = $this->createMock(AbstractDb::class);
+ $serializerMock = $this->createMock(Json::class);
+
+ $this->model = $this->getMockBuilder(Invoice::class)
+ ->setConstructorArgs(
+ [
+ $contextMock,
+ $registryMock,
+ $this->taxDataMock,
+ $filesystemMock,
+ $filterManagerMock,
+ $stringUtilsMock,
+ $serializerMock,
+ $resourceMock,
+ $collectionMock,
+ [],
+ ]
+ )
+ ->onlyMethods(
+ [
+ '_setFontRegular',
+ 'getChildren',
+ 'isShipmentSeparately',
+ 'isChildCalculated',
+ 'getValueHtml',
+ 'getSelectionAttributes',
+ ]
+ )
+ ->getMock();
+ }
+
+ /**
+ * @dataProvider \Magento\Bundle\Test\Unit\Model\Sales\Order\Pdf\Items\InvoiceTestProvider::getData
+ * @param array $expected
+ * @param string $method
+ */
+ public function testDrawPrice(array $expected, string $method): void
+ {
+ $this->taxDataMock->expects($this->any())->method($method)->willReturn(true);
+ $pageMock = $this->createMock(Zend_Pdf_Page::class);
+ $this->model->setPage($pageMock);
+ $pdfMock = $this->createMock(InvoicePdf::class);
+ $pdfMock->expects($this->any())->method('drawLineBlocks')->with(
+ $pageMock,
+ $expected,
+ ['table_header' => true]
+ )->willReturn($pageMock);
+ $this->model->setPdf($pdfMock);
+
+ $this->prepareModel();
+ $this->model->draw();
+ }
+
+ /**
+ * Prepare invoice draw model for test execution
+ *
+ * @return void
+ */
+ private function prepareModel(): void
+ {
+ $parentItem = new DataObject(
+ [
+ 'sku' => 'bundle-simple',
+ 'name' => 'Bundle',
+ 'order_item' => new DataObject(
+ [
+ 'product_options' => [],
+ ]
+ ),
+ ]
+ );
+ $items = [
+ new DataObject(
+ [
+ 'name' => 'Simple1',
+ 'sku' => 'simple1',
+ 'price' => '10.00',
+ 'price_incl_tax' => '10.83',
+ 'row_total' => '20.00',
+ 'row_total_incl_tax' => '21.66',
+ 'qty' => '2',
+ 'tax_amount' => '1.66',
+ 'order_item' => new DataObject(
+ [
+ 'parent_item' => $parentItem,
+ ]
+ ),
+ ]
+ ),
+ new DataObject(
+ [
+ 'name' => 'Simple2',
+ 'sku' => 'simple2',
+ 'price' => '5.00',
+ 'price_incl_tax' => '5.41',
+ 'row_total' => '10.00',
+ 'row_total_incl_tax' => '10.83',
+ 'qty' => '2',
+ 'tax_amount' => '0.83',
+ 'order_item' => new DataObject(
+ [
+ 'parent_item' => $parentItem,
+ ]
+ ),
+ ]
+ ),
+ ];
+ $orderMock = $this->createMock(Order::class);
+
+ $this->model->expects($this->any())->method('getChildren')->willReturn($items);
+ $this->model->expects($this->any())->method('isShipmentSeparately')->willReturn(false);
+ $this->model->expects($this->any())->method('isChildCalculated')->willReturn(true);
+ $this->model->expects($this->at(2))->method('getSelectionAttributes')->willReturn(
+ ['option_id' => 1, 'option_label' => 'test option']
+ );
+ $this->model->expects($this->at(3))->method('getValueHtml')->willReturn($items[0]->getName());
+ $this->model->expects($this->at(5))->method('getSelectionAttributes')->willReturn(
+ ['option_id' => 1, 'option_label' => 'second option']
+ );
+ $this->model->expects($this->at(6))->method('getValueHtml')->willReturn($items[1]->getName());
+
+ $orderMock->expects($this->any())->method('formatPriceTxt')->willReturnArgument(0);
+ $this->model->setOrder($orderMock);
+ $this->model->setItem($parentItem);
+ }
+}
diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTestProvider.php b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTestProvider.php
new file mode 100644
index 0000000000000..7de3d383d006e
--- /dev/null
+++ b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/InvoiceTestProvider.php
@@ -0,0 +1,329 @@
+ [
+ 'expected' => [
+ 1 => [
+ 'height' => 15,
+ 'lines' => [
+ [
+ [
+ 'text' => 'test option',
+ 'feed' => 35,
+ 'font' => 'italic',
+
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple1',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 1.66,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Excl. Tax:',
+ 'feed' => 380,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Excl. Tax:',
+ 'feed' => 565,
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => '10.00',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '20.00',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Incl. Tax:',
+ 'feed' => 380,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Incl. Tax:',
+ 'feed' => 565,
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => '10.83',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '21.66',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple2',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 0.83,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Excl. Tax:',
+ 'feed' => 380,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Excl. Tax:',
+ 'feed' => 565,
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => '5.00',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.00',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Incl. Tax:',
+ 'feed' => 380,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 'Incl. Tax:',
+ 'feed' => 565,
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => '5.41',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.83',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'tax_mock_method' => 'displaySalesBothPrices',
+ ],
+ 'including_tax' => [
+ 'expected' => [
+ 1 => [
+ 'height' => 15,
+ 'lines' => [
+ [
+ [
+ 'text' => 'test option',
+ 'feed' => 35,
+ 'font' => 'italic',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple1',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 1.66,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.83',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '21.66',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple2',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 0.83,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '5.41',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.83',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'tax_mock_method' => 'displaySalesPriceInclTax',
+ ],
+ 'excluding_tax' => [
+ 'expected' => [
+ 1 => [
+ 'height' => 15,
+ 'lines' => [
+ [
+ [
+ 'text' => 'test option',
+ 'feed' => 35,
+ 'font' => 'italic',
+
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple1',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 1.66,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.00',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '20.00',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ [
+ [
+ 'text' => 'Simple2',
+ 'feed' => 40,
+ ],
+ [
+ 'text' => 2,
+ 'feed' => 435,
+ 'align' => 'right',
+ ],
+ [
+ 'text' => 0.83,
+ 'feed' => 495,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '5.00',
+ 'feed' => 380,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ [
+ 'text' => '10.00',
+ 'feed' => 565,
+ 'font' => 'bold',
+ 'align' => 'right',
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'tax_mock_method' => 'displaySalesPriceExclTax',
+ ],
+ ];
+ }
+}
diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php
new file mode 100644
index 0000000000000..51563d319dfc8
--- /dev/null
+++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php
@@ -0,0 +1,166 @@
+objectManager = new ObjectManager($this);
+ $this->arrayManagerMock = $this->getMockBuilder(ArrayManager::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->arrayManagerMock->expects($this->any())
+ ->method('get')
+ ->willReturn([]);
+ $this->urlBuilder = $this->getMockBuilder(UrlInterface::class)
+ ->getMockForAbstractClass();
+ $this->shipmentType = $this->getMockBuilder(ShipmentType::class)
+ ->getMockForAbstractClass();
+ $this->productMock = $this->getMockBuilder(ProductInterface::class)
+ ->addMethods(['getStoreId'])
+ ->getMockForAbstractClass();
+ $this->productMock->method('getId')
+ ->willReturn(true);
+ $this->productMock->method('getStoreId')
+ ->willReturn(0);
+ $this->locatorMock = $this->getMockBuilder(LocatorInterface::class)
+ ->onlyMethods(['getProduct'])
+ ->getMockForAbstractClass();
+ $this->locatorMock->method('getProduct')
+ ->willReturn($this->productMock);
+
+ $this->bundlePanelModel = $this->objectManager->getObject(
+ BundlePanel::class,
+ [
+ 'locator' => $this->locatorMock,
+ 'urlBuilder' => $this->urlBuilder,
+ 'shipmentType' => $this->shipmentType,
+ 'arrayManager' => $this->arrayManagerMock,
+ ]
+ );
+ }
+
+ /**
+ * Test for modify meta
+ *
+ * @param string $shipmentTypePath
+ * @param string $dataScope
+ *
+ * @return void
+ * @dataProvider getDataModifyMeta
+ */
+ public function testModifyMeta(string $shipmentTypePath, string $dataScope): void
+ {
+ $sourceMeta = [
+ 'bundle-items' => [
+ 'children' => [
+ BundlePrice::CODE_PRICE_TYPE => []
+ ]
+ ]
+ ];
+ $this->arrayManagerMock->method('findPath')
+ ->willReturnMap(
+ [
+ [
+ BundlePanel::CODE_SHIPMENT_TYPE,
+ [],
+ null,
+ 'children',
+ ArrayManager::DEFAULT_PATH_DELIMITER,
+ $shipmentTypePath
+ ],
+ ]
+ );
+ $this->arrayManagerMock->method('merge')
+ ->willReturn([]);
+ $this->arrayManagerMock->method('remove')
+ ->willReturn([]);
+ $this->arrayManagerMock->method('set')
+ ->willReturn([]);
+ $this->arrayManagerMock->expects($this->at(12))
+ ->method('merge')
+ ->with(
+ $shipmentTypePath . BundlePanel::META_CONFIG_PATH,
+ [],
+ [
+ 'dataScope' => $dataScope,
+ 'validation' => [
+ 'required-entry' => false
+ ]
+ ]
+ );
+ $this->bundlePanelModel->modifyMeta($sourceMeta);
+ }
+
+ /**
+ * Data provider for modify meta test
+ *
+ * @return string[][]
+ */
+ public function getDataModifyMeta(): array
+ {
+ return [
+ [
+ 'bundle-items/children',
+ 'data.product.shipment_type'
+ ],
+ [
+ 'someAttrGroup/children',
+ 'shipment_type'
+ ],
+ ];
+ }
+}
diff --git a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php
index 5ff9e674acad9..01b113def9243 100644
--- a/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php
+++ b/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php
@@ -252,16 +252,19 @@ public function modifyData(array $data)
*/
private function modifyShipmentType(array $meta)
{
+ $actualPath = $this->arrayManager->findPath(
+ static::CODE_SHIPMENT_TYPE,
+ $meta,
+ null,
+ 'children'
+ );
+
$meta = $this->arrayManager->merge(
- $this->arrayManager->findPath(
- static::CODE_SHIPMENT_TYPE,
- $meta,
- null,
- 'children'
- ) . static::META_CONFIG_PATH,
+ $actualPath . static::META_CONFIG_PATH,
$meta,
[
- 'dataScope' => 'data.product.shipment_type',
+ 'dataScope' => stripos($actualPath, self::CODE_BUNDLE_DATA) === 0
+ ? 'data.product.shipment_type' : 'shipment_type',
'validation' => [
'required-entry' => false
]
diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
index f90b097415661..19f6461d44b6a 100644
--- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
+++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
@@ -3,7 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-declare(strict_types=1);
namespace Magento\Catalog\Model\Product\Type;
@@ -605,7 +604,11 @@ protected function _prepareOptions(\Magento\Framework\DataObject $buyRequest, $p
if ($product->getSkipCheckRequiredOption() !== true) {
$group->validateUserValue($optionsFromRequest);
} elseif ($optionsFromRequest !== null && isset($optionsFromRequest[$option->getId()])) {
- $transport->options[$option->getId()] = $optionsFromRequest[$option->getId()];
+ if (is_array($optionsFromRequest[$option->getId()])) {
+ $group->validateUserValue($optionsFromRequest);
+ } else {
+ $transport->options[$option->getId()] = $optionsFromRequest[$option->getId()];
+ }
}
} catch (LocalizedException $e) {
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeWebSiteAssignedToProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeWebSiteAssignedToProductActionGroup.xml
new file mode 100644
index 0000000000000..76a0af8f63fd5
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeWebSiteAssignedToProductActionGroup.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ Extends AddWebsiteToProductActionGroup. Changes website assigned to product from websiteToDeselect to website
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml
index 64fab5575e392..8cb737f50c620 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductOnProductGridActionGroup.xml
@@ -1,22 +1,21 @@
-
-
+
+
-
-
-
- Check the checkbox for the product on the Product Grid
-
-
-
-
+
+
+
+ Check the checkbox for the product on the Product Grid
+
+
+
+
-
+
-
-
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml
new file mode 100644
index 0000000000000..31a4521331664
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ Selects the specified value from the Attribute Set dropdown on the opened product edit page.
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetPriceForMassUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetPriceForMassUpdateActionGroup.xml
new file mode 100644
index 0000000000000..b00f181c92360
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetPriceForMassUpdateActionGroup.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Click the "Change" checkbox for the "Price" field. Set new price.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSortProductsGridByActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSortProductsGridByActionGroup.xml
new file mode 100644
index 0000000000000..92c714c2478b0
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSortProductsGridByActionGroup.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Sorts the Product Grid by field
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductPriceUpdatedOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductPriceUpdatedOnEditPageActionGroup.xml
new file mode 100644
index 0000000000000..c7a665119b328
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductPriceUpdatedOnEditPageActionGroup.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ Validate if Product price is updated on the Product creation/edit page
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml
new file mode 100644
index 0000000000000..10d85a91a02c6
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Hover product on the Category page
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml
index 92be79fdfe720..e1499a2484353 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml
@@ -20,7 +20,7 @@
-
+
@@ -30,6 +30,7 @@
+
@@ -37,74 +38,92 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ($grabTextFromSuccessMessage)
- You added product $$product.name$$ to the comparison list.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ($grabTextFromSuccessMessage)
- You added product $$product.name$$ to the comparison list.
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml
index 94d3b46aaa5f1..73019bb5ec0e0 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml
@@ -58,10 +58,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml
index 3b8c2cb736721..e7d4241500bfb 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml
@@ -60,9 +60,11 @@
-
-
-
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
index a72af673c009a..f2413a1523394 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
@@ -124,62 +124,108 @@
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
+
-
+
+
+
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml
index 0bdf19c9b8950..ca0616213c593 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml
@@ -33,9 +33,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml
index 9fef5e4203167..8d3fbbaa34355 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml
@@ -64,9 +64,11 @@
-
-
-
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml
index d2278f3ddae1d..d1110f593545d 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml
@@ -62,9 +62,11 @@
-
-
-
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml
index 070c07d9feb7d..8a5da6d6e3640 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml
@@ -29,52 +29,60 @@
-
-
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml
index de116b26d1414..8a33f6132aeb9 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml
@@ -141,9 +141,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml
index f5046faf82b6f..a9f8eab9a582f 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml
@@ -25,7 +25,7 @@
-
+
@@ -52,31 +52,30 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml
index 27a834833ed76..2124efed31293 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml
@@ -34,10 +34,7 @@
-
-
-
-
+
@@ -45,9 +42,7 @@
-
-
-
+
@@ -71,7 +66,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
index a021bf2d7141e..6f83bf2b70e17 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
@@ -26,10 +26,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
index daf3833d1fd78..77ff99eecf5ad 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
@@ -94,10 +94,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
index a9ff81c9c7f87..acbecd653fa1e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
@@ -94,10 +94,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
index 5f7e9c4225c00..2095d56ce6c59 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
@@ -332,10 +332,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml
index d1f7adb8a902c..9d805b2cf7930 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml
@@ -14,8 +14,8 @@
-
-
+
+
@@ -34,7 +34,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserTest.xml
index ff68bba78cae8..aed2976df8f73 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserTest.xml
@@ -56,10 +56,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml
index 7fd752d7df98d..654dc727b24ca 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml
@@ -50,7 +50,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml
index cde7b14614f8e..3d3867d1efcf1 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml
@@ -114,9 +114,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml
index e1b5aca6382e9..64ad348257853 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml
@@ -74,9 +74,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml
index 0117493906de1..4d04a25c8d12f 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml
@@ -66,9 +66,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml
index a73bd5a533ad0..ca561e4af70de 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml
@@ -187,10 +187,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml
index 2156178ea88d0..9819357704d44 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml
@@ -33,9 +33,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml
index ce04b377300f8..cf1bb065349b6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml
@@ -65,9 +65,7 @@
-
-
-
+
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml
index 6c92ddcf36243..cf64c57c720b7 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml
@@ -77,6 +77,16 @@ $scriptString .= <<