Skip to content

Add product with customizable option to wishlist #28259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions app/code/Magento/Catalog/Pricing/Render/ConfiguredPriceBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,8 @@ protected function _prepareLayout()
}

/**
* {@inheritdoc}
*/
public function getPriceType($priceCode)
{
$price = $this->saleableItem->getPriceInfo()->getPrice($priceCode);
$item = $this->getData('item');
if ($price instanceof ConfiguredPriceInterface
&& $item instanceof ItemInterface
) {
$price->setItem($item);
}

return $price;
}

/**
* Returns configured price
*
* @return PriceInterface
*/
public function getConfiguredPrice(): PriceInterface
Expand All @@ -117,6 +103,8 @@ public function getConfiguredPrice(): PriceInterface
}

/**
* Returns configured regular price
*
* @return PriceInterface
*/
public function getConfiguredRegularPrice(): PriceInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontAddProductsWithCustomOptionToWishlistTest">
<annotations>
<features value="Wishlist"/>
<stories value="Add product with customizable option to wishlist"/>
<title value="Add product with customizable option to wishlist."/>
<description value="Add product with custom radio button option to wishlist."/>
<group value="wishlist"/>
<severity value="MAJOR"/>
<testCaseId value="MC-34245"/>
</annotations>
<before>
<createData entity="SimpleProduct2" stepKey="simpleProduct"/>
<updateData entity="productWithOptionRadiobutton" createDataKey="simpleProduct" stepKey="updateProductWithOptions">
<requiredEntity createDataKey="simpleProduct"/>
</updateData>

<createData entity="Simple_US_Customer" stepKey="customer"/>
</before>
<after>
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
<argument name="Customer" value="$$customer$$"/>
</actionGroup>

<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
<argument name="productUrl" value="$$simpleProduct.custom_attributes[url_key]$$"/>
</actionGroup>

<actionGroup ref="StorefrontProductPageSelectRadioButtonOptionValueActionGroup" stepKey="selectRadioButtonOption">
<argument name="attributeLabel" value="{{ProductOptionRadiobuttonWithTwoFixedOptions.title}}"/>
<argument name="optionLabel" value="{{ProductOptionValueRadioButtons1.title}}"/>
</actionGroup>

<click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addProductToWishlist"/>
<actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent">
<argument name="productName" value="$$simpleProduct.name$$"/>
<argument name="productPrice" value="$222.99"/>
</actionGroup>
</test>
</tests>