Skip to content

Commit 4c37ed6

Browse files
committed
Merge remote-tracking branch 'origin/MC-18963' into 2.3-develop-pr30
2 parents b620a5e + 1565085 commit 4c37ed6

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

app/code/Magento/Bundle/Plugin/UpdatePriceInQuoteItemOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function afterCalcRowTotal(OrigQuoteItem $subject, AbstractItem $result)
4242
{
4343
$bundleAttributes = $result->getProduct()->getCustomOption('bundle_selection_attributes');
4444
if ($bundleAttributes !== null) {
45-
$actualPrice = $result->getPrice();
45+
$actualPrice = (float)$result->getPrice();
4646
$parsedValue = $this->serializer->unserialize($bundleAttributes->getValue());
4747
if (is_array($parsedValue) && array_key_exists('price', $parsedValue)) {
4848
$parsedValue['price'] = $actualPrice;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontSpecialPriceBundleProductInCartTest">
11+
<annotations>
12+
<features value="Bundle"/>
13+
<stories value="Add bundle product to cart on storefront"/>
14+
<title value="Customer should not be able to add a Bundle Product to the cart when added a special price for associated products"/>
15+
<description value="Customer should not be able to add a Bundle Product to the cart when added a special price for associated products"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-19134"/>
18+
<useCaseId value="MC-18963"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<!-- Create the Simple product with Special price -->
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct"/>
24+
<createData entity="specialProductPrice2" stepKey="specialPriceToSimpleProduct">
25+
<requiredEntity createDataKey="simpleProduct"/>
26+
</createData>
27+
<!-- Create the bundle product -->
28+
<createData entity="ApiBundleProduct" stepKey="bundleProduct"/>
29+
<createData entity="RadioButtonsOption" stepKey="bundleOption">
30+
<requiredEntity createDataKey="bundleProduct"/>
31+
<field key="required">true</field>
32+
</createData>
33+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
34+
<requiredEntity createDataKey="bundleProduct"/>
35+
<requiredEntity createDataKey="bundleOption"/>
36+
<requiredEntity createDataKey="simpleProduct"/>
37+
</createData>
38+
<!-- Run reindex stock status -->
39+
<magentoCLI command="indexer:reindex" arguments="cataloginventory_stock" stepKey="reindex"/>
40+
</before>
41+
<after>
42+
<deleteData createDataKey="bundleProduct" stepKey="deleteBundleProduct"/>
43+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
44+
</after>
45+
<!-- Go to storefront BundleProduct -->
46+
<amOnPage url="{{StorefrontProductPage.url($$bundleProduct.custom_attributes[url_key]$$)}}" stepKey="goToStorefront"/>
47+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCartFirstTime">
48+
<argument name="productName" value="$$bundleProduct.name$$"/>
49+
</actionGroup>
50+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCartSecondTime">
51+
<argument name="productName" value="$$bundleProduct.name$$"/>
52+
</actionGroup>
53+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCart"/>
54+
<actionGroup ref="AssertStorefrontMiniCartSubtotalActionGroup" stepKey="assertSubtotal">
55+
<argument name="subtotal" value="$111.10"/>
56+
</actionGroup>
57+
</test>
58+
</tests>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontMiniCartSubtotalActionGroup">
11+
<arguments>
12+
<argument name="subtotal" type="string"/>
13+
</arguments>
14+
<waitForElementVisible selector="{{StorefrontMinicartSection.productSubTotal}}" stepKey="waitForSubtotal"/>
15+
<see selector="{{StorefrontMinicartSection.productSubTotal}}" userInput="{{subtotal}}" stepKey="seeSubtotal"/>
16+
</actionGroup>
17+
</actionGroups>

0 commit comments

Comments
 (0)