Skip to content

Commit f1d066f

Browse files
merge magento/2.3-develop into magento-pangolin/MQE-1393-New-Customer-Action-Group
2 parents f761764 + e5c1527 commit f1d066f

File tree

110 files changed

+3448
-604
lines changed

Some content is hidden

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

110 files changed

+3448
-604
lines changed

app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $ccType = $block->getInfoData('cc_type');
8383
id="<?= /* @noEscape */ $code ?>_vault"
8484
name="payment[is_active_payment_token_enabler]"
8585
class="admin__control-checkbox"/>
86-
<label class="label" for="<?= /* @noEscape */ $code ?>_vault">
86+
<label class="label admin__field-label" for="<?= /* @noEscape */ $code ?>_vault">
8787
<span><?= $block->escapeHtml(__('Save for later use.')) ?></span>
8888
</label>
8989
</div>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Model\Plugin\Frontend;
9+
10+
use Magento\Bundle\Model\Product\Type;
11+
use Magento\Catalog\Model\Product as CatalogProduct;
12+
13+
/**
14+
* Add child identities to product identities on storefront.
15+
*/
16+
class Product
17+
{
18+
/**
19+
* @var Type
20+
*/
21+
private $type;
22+
23+
/**
24+
* @param Type $type
25+
*/
26+
public function __construct(Type $type)
27+
{
28+
$this->type = $type;
29+
}
30+
31+
/**
32+
* Add child identities to product identities
33+
*
34+
* @param CatalogProduct $product
35+
* @param array $identities
36+
* @return array
37+
*/
38+
public function afterGetIdentities(CatalogProduct $product, array $identities): array
39+
{
40+
foreach ($this->type->getChildrenIds($product->getEntityId()) as $childIds) {
41+
foreach ($childIds as $childId) {
42+
$identities[] = CatalogProduct::CACHE_TAG . '_' . $childId;
43+
}
44+
}
45+
46+
return array_unique($identities);
47+
}
48+
}

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\EntityManager\MetadataPool;
1414
use Magento\Framework\Pricing\PriceCurrencyInterface;
1515
use Magento\Framework\Serialize\Serializer\Json;
16+
use Magento\Framework\Stdlib\ArrayUtils;
1617

1718
/**
1819
* Bundle Type Model
@@ -160,6 +161,11 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
160161
*/
161162
private $selectionCollectionFilterApplier;
162163

164+
/**
165+
* @var ArrayUtils
166+
*/
167+
private $arrayUtility;
168+
163169
/**
164170
* @param \Magento\Catalog\Model\Product\Option $catalogProductOption
165171
* @param \Magento\Eav\Model\Config $eavConfig
@@ -185,6 +191,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
185191
* @param \Magento\Framework\Serialize\Serializer\Json $serializer
186192
* @param MetadataPool|null $metadataPool
187193
* @param SelectionCollectionFilterApplier|null $selectionCollectionFilterApplier
194+
* @param ArrayUtils|null $arrayUtility
188195
*
189196
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
190197
*/
@@ -212,7 +219,8 @@ public function __construct(
212219
\Magento\CatalogInventory\Api\StockStateInterface $stockState,
213220
Json $serializer = null,
214221
MetadataPool $metadataPool = null,
215-
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null
222+
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null,
223+
ArrayUtils $arrayUtility = null
216224
) {
217225
$this->_catalogProduct = $catalogProduct;
218226
$this->_catalogData = $catalogData;
@@ -232,6 +240,7 @@ public function __construct(
232240

233241
$this->selectionCollectionFilterApplier = $selectionCollectionFilterApplier
234242
?: ObjectManager::getInstance()->get(SelectionCollectionFilterApplier::class);
243+
$this->arrayUtility= $arrayUtility ?: ObjectManager::getInstance()->get(ArrayUtils::class);
235244

236245
parent::__construct(
237246
$catalogProductOption,
@@ -673,7 +682,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
673682
$options
674683
);
675684

676-
$selectionIds = $this->multiToFlatArray($options);
685+
$selectionIds = array_values($this->arrayUtility->flatten($options));
677686
// If product has not been configured yet then $selections array should be empty
678687
if (!empty($selectionIds)) {
679688
$selections = $this->getSelectionsByIds($selectionIds, $product);
@@ -814,26 +823,6 @@ private function recursiveIntval(array $array)
814823
return $array;
815824
}
816825

817-
/**
818-
* Convert multi dimensional array to flat
819-
*
820-
* @param array $array
821-
* @return int[]
822-
*/
823-
private function multiToFlatArray(array $array)
824-
{
825-
$flatArray = [];
826-
foreach ($array as $value) {
827-
if (is_array($value)) {
828-
$flatArray = array_merge($flatArray, $this->multiToFlatArray($value));
829-
} else {
830-
$flatArray[] = $value;
831-
}
832-
}
833-
834-
return $flatArray;
835-
}
836-
837826
/**
838827
* Retrieve message for specify option(s)
839828
*

app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,74 @@
5656
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
5757
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
5858
</actionGroup>
59+
60+
<actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts">
61+
<remove keyForRemoval="openProductFilters2"/>
62+
<remove keyForRemoval="fillProductSkuFilter2"/>
63+
<remove keyForRemoval="clickApplyFilters2"/>
64+
<remove keyForRemoval="waitForFilteredGridLoad2"/>
65+
<remove keyForRemoval="selectProduct2"/>
66+
<remove keyForRemoval="selectProduct2"/>
67+
<remove keyForRemoval="fillQuantity1"/>
68+
<remove keyForRemoval="fillQuantity2"/>
69+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/>
70+
</actionGroup>
71+
72+
<actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts">
73+
<arguments>
74+
<argument name="prodTreeSku" type="string"/>
75+
</arguments>
76+
<remove keyForRemoval="fillQuantity1"/>
77+
<remove keyForRemoval="fillQuantity2"/>
78+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
79+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
80+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
81+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
82+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
83+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
84+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/>
85+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/>
86+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/>
87+
</actionGroup>
88+
89+
<actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts">
90+
<arguments>
91+
<argument name="prodTreeSku" type="string"/>
92+
<argument name="prodFourSku" type="string"/>
93+
<argument name="prodFiveSku" type="string"/>
94+
<argument name="prodSixSku" type="string"/>
95+
</arguments>
96+
<remove keyForRemoval="fillQuantity1"/>
97+
<remove keyForRemoval="fillQuantity2"/>
98+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
99+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
100+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
101+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
102+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
103+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
104+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/>
105+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/>
106+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/>
107+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/>
108+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/>
109+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/>
110+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/>
111+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/>
112+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/>
113+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/>
114+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/>
115+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/>
116+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/>
117+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/>
118+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/>
119+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/>
120+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/>
121+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/>
122+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/>
123+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/>
124+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/>
125+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/>
126+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/>
127+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/>
128+
</actionGroup>
59129
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="BundleProductsSummary" type="Quote">
12+
<data key="subtotal">1,968.00</data>
13+
<data key="shipping">5.00</data>
14+
<data key="total">1,973.00</data>
15+
<data key="shippingMethod">Flat Rate - Fixed</data>
16+
</entity>
17+
</entities>

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
2323
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
2424
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
25+
<element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/>
26+
<element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/>
2527
<!--Select"url Key"InputForm-->
2628
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
2729
<!--AddSelectedProducts-->

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontBundledSection">
12+
<element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/>
13+
<element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/>
1214
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
1315
<element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/>
1416
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/>

0 commit comments

Comments
 (0)