Skip to content

Commit e5c1527

Browse files
authored
Merge pull request magento#3598 from magento-epam/EPAM-PR-30
Fixed issues: MAGETWO-94444 [2.3] Order total value is limited by 8 round digits MAGETWO-95813 Only two bundle options are added to the cart MAGETWO-95803 Rewards points earned from coupon code are not applied to guests that create accounts after checking out MAGETWO-96410 [2.3.x] The cart rule cannot effect the cart MAGETWO-96427 [2.3.x] Offline refund warning not displayed for Express Checkout orders MAGETWO-96417 [2.3.x] Detaching category from product causes massive product url regeneration MAGETWO-96407 [2.3.x] [B2B] Products with customizable options of type File aren't saved on requisition lists with the attachments MAGETWO-96850 [2.3.x] One page Checkout resets Customer data if Product Qty was changed MAGETWO-58841 API call with pageSize and currentPage > items should return error MAGETWO-63036 CLONE - Quans: Orders API without key/value on ADDITIONAL_INFORMATION (only values) MAGETWO-91650 Translation not working for product alerts MAGETWO-71344 Update product from mini shopping cart doesn't reflect in the shopping cart MAGETWO-62495 Products change in one category will cause cache miss for other categories (Only reproducible by unassigning products from backend category page) MAGETWO-91750 Multiselect attribute values is not searchable under Quick Search when more than one value is selected MAGETWO-50668 Event clean_cache_by_tags didn't clean all tags pointed in getIdentity MAGETWO-95809 Item row total display incorrect value in API response
2 parents 9c36f6f + c0dce8d commit e5c1527

File tree

53 files changed

+1520
-409
lines changed

Some content is hidden

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

53 files changed

+1520
-409
lines changed

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)