Skip to content

Commit

Permalink
Merge pull request #3598 from magento-epam/EPAM-PR-30
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rganin authored Jan 17, 2019
2 parents 9c36f6f + c0dce8d commit e5c1527
Show file tree
Hide file tree
Showing 53 changed files with 1,520 additions and 409 deletions.
33 changes: 11 additions & 22 deletions app/code/Magento/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Stdlib\ArrayUtils;

/**
* Bundle Type Model
Expand Down Expand Up @@ -160,6 +161,11 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
*/
private $selectionCollectionFilterApplier;

/**
* @var ArrayUtils
*/
private $arrayUtility;

/**
* @param \Magento\Catalog\Model\Product\Option $catalogProductOption
* @param \Magento\Eav\Model\Config $eavConfig
Expand All @@ -185,6 +191,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
* @param \Magento\Framework\Serialize\Serializer\Json $serializer
* @param MetadataPool|null $metadataPool
* @param SelectionCollectionFilterApplier|null $selectionCollectionFilterApplier
* @param ArrayUtils|null $arrayUtility
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -212,7 +219,8 @@ public function __construct(
\Magento\CatalogInventory\Api\StockStateInterface $stockState,
Json $serializer = null,
MetadataPool $metadataPool = null,
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null,
ArrayUtils $arrayUtility = null
) {
$this->_catalogProduct = $catalogProduct;
$this->_catalogData = $catalogData;
Expand All @@ -232,6 +240,7 @@ public function __construct(

$this->selectionCollectionFilterApplier = $selectionCollectionFilterApplier
?: ObjectManager::getInstance()->get(SelectionCollectionFilterApplier::class);
$this->arrayUtility= $arrayUtility ?: ObjectManager::getInstance()->get(ArrayUtils::class);

parent::__construct(
$catalogProductOption,
Expand Down Expand Up @@ -673,7 +682,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
$options
);

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

/**
* Convert multi dimensional array to flat
*
* @param array $array
* @return int[]
*/
private function multiToFlatArray(array $array)
{
$flatArray = [];
foreach ($array as $value) {
if (is_array($value)) {
$flatArray = array_merge($flatArray, $this->multiToFlatArray($value));
} else {
$flatArray[] = $value;
}
}

return $flatArray;
}

/**
* Retrieve message for specify option(s)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,74 @@
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
</actionGroup>

<actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts">
<remove keyForRemoval="openProductFilters2"/>
<remove keyForRemoval="fillProductSkuFilter2"/>
<remove keyForRemoval="clickApplyFilters2"/>
<remove keyForRemoval="waitForFilteredGridLoad2"/>
<remove keyForRemoval="selectProduct2"/>
<remove keyForRemoval="selectProduct2"/>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/>
</actionGroup>

<actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts">
<arguments>
<argument name="prodTreeSku" type="string"/>
</arguments>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/>
</actionGroup>

<actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts">
<arguments>
<argument name="prodTreeSku" type="string"/>
<argument name="prodFourSku" type="string"/>
<argument name="prodFiveSku" type="string"/>
<argument name="prodSixSku" type="string"/>
</arguments>
<remove keyForRemoval="fillQuantity1"/>
<remove keyForRemoval="fillQuantity2"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="BundleProductsSummary" type="Quote">
<data key="subtotal">1,968.00</data>
<data key="shipping">5.00</data>
<data key="total">1,973.00</data>
<data key="shippingMethod">Flat Rate - Fixed</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
<element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/>
<element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/>
<!--Select"url Key"InputForm-->
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
<!--AddSelectedProducts-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontBundledSection">
<element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/>
<element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/>
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
<element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/>
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/>
Expand Down
Loading

0 comments on commit e5c1527

Please sign in to comment.