Skip to content

Commit 4874fcd

Browse files
committed
Merge remote-tracking branch 'origin/BUG#AC-3769' into spartans_pr_04082022
2 parents 2e45de7 + 9b8e3e3 commit 4874fcd

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminFilterProductListByBundleProductInDutchUserLanguageTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Admin list bundle products when user language is set as Dutch"/>
15+
<title value="Admin should be able to filter product list by type = Bundle Product, when user language is set as Dutch"/>
16+
<description value="Admin should be able to filter product list by type = Bundle Product
17+
wherein the tier price for the bundle product should be set and user language set as Dutch"/>
18+
<severity value="CRITICAL"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem1">
22+
<field key="price">100.00</field>
23+
</createData>
24+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem2">
25+
<field key="price">100.00</field>
26+
</createData>
27+
<!-- Enable Changing Locale to Dutch -->
28+
<magentoCLI command="setup:static-content:deploy" arguments="-f nl_NL" stepKey="staticDeployAfterChangeLocaleToNL"/>
29+
<magentoCron groups="index" stepKey="runCronIndex"/>
30+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
31+
</before>
32+
<after>
33+
<deleteData createDataKey="createProductForBundleItem1" stepKey="deleteProductForBundleItem1"/>
34+
<deleteData createDataKey="createProductForBundleItem2" stepKey="deleteProductForBundleItem2"/>
35+
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundle">
36+
<argument name="product" value="BundleProduct"/>
37+
</actionGroup>
38+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearProductsGridFilters"/>
39+
<comment userInput="BIC workaround" stepKey="waitForClearProductsGridFilters"/>
40+
<!-- Change Admin locale to default -->
41+
<actionGroup ref="SetAdminAccountActionGroup" stepKey="setAdminAccountToDefault">
42+
<argument name="InterfaceLocaleByValue" value="en_US" />
43+
</actionGroup>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
45+
</after>
46+
47+
<!-- Change Admin locale to Nederlands (Nederland) / Nederlands (Nederland) -->
48+
<actionGroup ref="SetAdminAccountActionGroup" stepKey="setAdminAccountToDutch">
49+
<argument name="InterfaceLocaleByValue" value="nl_NL" />
50+
</actionGroup>
51+
52+
<!--Create bundle product-->
53+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToBundleProductCreationPage">
54+
<argument name="attributeSetId" value="{{BundleProduct.set}}"/>
55+
<argument name="productType" value="{{BundleProduct.type}}"/>
56+
</actionGroup>
57+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/>
58+
<click selector="{{AdminProductFormBundleSection.dynamicSkuToggle}}" stepKey="disableDynamicSku"/>
59+
<click selector="{{AdminProductFormBundleSection.dynamicPrice}}" stepKey="clickDynamicPriceSwitcher"/>
60+
<fillField selector="{{AdminProductFormBundleSection.priceField}}" userInput="100" stepKey="fillBundlePrice"/>
61+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/>
62+
<actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1">
63+
<argument name="x" value="0"/>
64+
<argument name="n" value="1"/>
65+
<argument name="prodOneSku" value="$createProductForBundleItem1.sku$"/>
66+
<argument name="prodTwoSku" value=""/>
67+
<argument name="optionTitle" value="Option1"/>
68+
<argument name="inputType" value="checkbox"/>
69+
</actionGroup>
70+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="100" stepKey="fillBundleOption1Price"/>
71+
<selectOption selector="{{AdminProductFormBundleSection.bundlePriceType}}" userInput="Percent" stepKey="selectPercentPrice"/>
72+
<actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption2">
73+
<argument name="x" value="1"/>
74+
<argument name="n" value="2"/>
75+
<argument name="prodOneSku" value="$createProductForBundleItem2.sku$"/>
76+
<argument name="prodTwoSku" value=""/>
77+
<argument name="optionTitle" value="Option2"/>
78+
<argument name="inputType" value="checkbox"/>
79+
</actionGroup>
80+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('1', '0')}}" userInput="100" stepKey="fillBundleOption2Price"/>
81+
<scrollToTopOfPage stepKey="scrollToTopOfTheProductPage"/>
82+
<actionGroup ref="AdminBundleProductSetAdvancedPricingActionGroup" stepKey="addProductTierPrice">
83+
<argument name="quantity" value="1"/>
84+
<argument name="price" value="Discount"/>
85+
<argument name="amount" value="50"/>
86+
<argument name="priceView" value="As Low as"/>
87+
</actionGroup>
88+
89+
<!--Save the product-->
90+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
91+
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
92+
93+
<!--Apply Bundle Product Filter-->
94+
<!--Clear Filters-->
95+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFilters"/>
96+
97+
<!--Setting filter-->
98+
<actionGroup ref="BundleProductFilter" stepKey="FilterForOnlyBundleProducts"/>
99+
100+
<!--Testing application of filter-->
101+
<see selector="{{AdminProductFiltersSection.productType('0')}}" userInput="Bundle Product" stepKey="correcType0"/>
102+
<dontSeeElement selector="{{AdminProductFiltersSection.AllProductsNotOfBundleType}}" stepKey="checkingRowsForIncorrectType"/>
103+
</test>
104+
</tests>

app/code/Magento/Bundle/Ui/DataProvider/Product/Modifier/SpecialPriceAttributes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
class SpecialPriceAttributes implements ModifierInterface
2323
{
24+
public const LOCALE_USING_DECIMAL_COMMA = ['nl_BE', 'nl_NL'];
25+
2426
/**
2527
* @var ResolverInterface
2628
*/
@@ -77,6 +79,9 @@ public function modifyData(array $data): array
7779
['display' => Zend_Currency::NO_SYMBOL],
7880
false
7981
);
82+
if (in_array($this->localeResolver->getLocale(), self::LOCALE_USING_DECIMAL_COMMA)) {
83+
$item[$priceAttribute] = str_replace(['.',','], ['','.'], $item[$priceAttribute]);
84+
}
8085
$item[$priceAttribute] = $numberFormatter->format($item[$priceAttribute] / 100);
8186
}
8287
}

0 commit comments

Comments
 (0)