Skip to content

Commit 556d8b2

Browse files
[Magento Community Engineering] Community Contributions - 2.3-develop
- merged latest code from mainline branch
2 parents 03d0363 + 419fbf3 commit 556d8b2

File tree

81 files changed

+2533
-171
lines changed

Some content is hidden

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

81 files changed

+2533
-171
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\BundleGraphQl\Model\Resolver\Product\Price;
9+
10+
use Magento\Bundle\Pricing\Price\FinalPrice;
11+
use Magento\Catalog\Pricing\Price\BasePrice;
12+
use Magento\Bundle\Model\Product\Price;
13+
use Magento\Catalog\Pricing\Price\RegularPrice;
14+
use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface;
15+
use Magento\Framework\Pricing\Amount\AmountInterface;
16+
use Magento\Framework\Pricing\SaleableInterface;
17+
18+
/**
19+
* Provides pricing information for Bundle products
20+
*/
21+
class Provider implements ProviderInterface
22+
{
23+
/**
24+
* @inheritdoc
25+
*/
26+
public function getMinimalFinalPrice(SaleableInterface $product): AmountInterface
27+
{
28+
return $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getMinimalPrice();
29+
}
30+
31+
/**
32+
* @inheritdoc
33+
*/
34+
public function getMinimalRegularPrice(SaleableInterface $product): AmountInterface
35+
{
36+
return $product->getPriceInfo()->getPrice(RegularPrice::PRICE_CODE)->getMinimalPrice();
37+
}
38+
39+
/**
40+
* @inheritdoc
41+
*/
42+
public function getMaximalFinalPrice(SaleableInterface $product): AmountInterface
43+
{
44+
return $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getMaximalPrice();
45+
}
46+
47+
/**
48+
* @inheritdoc
49+
*/
50+
public function getMaximalRegularPrice(SaleableInterface $product): AmountInterface
51+
{
52+
return $product->getPriceInfo()->getPrice(RegularPrice::PRICE_CODE)->getMaximalPrice();
53+
}
54+
55+
/**
56+
* @inheritdoc
57+
*/
58+
public function getRegularPrice(SaleableInterface $product): AmountInterface
59+
{
60+
if ($product->getPriceType() == Price::PRICE_TYPE_FIXED) {
61+
return $product->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getAmount();
62+
}
63+
return $product->getPriceInfo()->getPrice(RegularPrice::PRICE_CODE)->getAmount();
64+
}
65+
}

app/code/Magento/BundleGraphQl/etc/graphql/di.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,22 @@
4040
</argument>
4141
</arguments>
4242
</type>
43+
44+
45+
<type name="Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool">
46+
<arguments>
47+
<argument name="providers" xsi:type="array">
48+
<item name="bundle" xsi:type="object">Magento\BundleGraphQl\Model\Resolver\Product\Price\Provider</item>
49+
</argument>
50+
</arguments>
51+
</type>
52+
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\AttributeProcessor">
53+
<arguments>
54+
<argument name="fieldToAttributeMap" xsi:type="array">
55+
<item name="price_range" xsi:type="array">
56+
<item name="price_type" xsi:type="string">price_type</item>
57+
</item>
58+
</argument>
59+
</arguments>
60+
</type>
4361
</config>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<group value="category"/>
2020
</annotations>
2121
<after>
22-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
22+
<actionGroup ref="logout" stepKey="adminLogout"/>
2323
</after>
2424

2525
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</createData>
2424
</before>
2525
<after>
26-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
26+
<actionGroup ref="logout" stepKey="adminLogout"/>
2727
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
2828
</after>
2929

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2323
</before>
2424
<after>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
2625
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
2726
</after>
2827

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2323
</before>
2424
<after>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
25+
<actionGroup ref="logout" stepKey="adminLogout"/>
2626
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
2727
</after>
2828

app/code/Magento/Catalog/Test/Mftf/Test/AdminMultipleWebsitesUseDefaultValuesTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite">
2323
<argument name="websiteName" value="Second Website"/>
2424
</actionGroup>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
25+
<actionGroup ref="logout" stepKey="adminLogout"/>
2626
</after>
2727
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
2828
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite">

app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<group value="Catalog"/>
1919
</annotations>
2020
<after>
21-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
21+
<actionGroup ref="logout" stepKey="adminLogout"/>
2222
</after>
2323

2424
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<deleteData createDataKey="category" stepKey="deletePreReqCategory"/>
3535
<deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/>
3636
<deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/>
37-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
37+
<actionGroup ref="logout" stepKey="adminLogout"/>
3838
</after>
3939

4040
<!-- Go to the first product edit page -->
@@ -186,7 +186,7 @@
186186
<after>
187187
<deleteData createDataKey="category" stepKey="deletePreReqCategory"/>
188188
<deleteData createDataKey="product" stepKey="deleteProduct"/>
189-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
189+
<actionGroup ref="logout" stepKey="adminLogout"/>
190190
</after>
191191

192192
<!-- Go to the product edit page -->

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
2323
<argument name="categoryEntity" value="_defaultCategory"/>
2424
</actionGroup>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
25+
<actionGroup ref="logout" stepKey="adminLogout"/>
2626
</after>
2727

2828
<!-- Create category, change store view to default -->

0 commit comments

Comments
 (0)