Skip to content

Commit ad0f51f

Browse files
Merge remote-tracking branch '37354/revert36041' into comm_voted_v2
2 parents 5eb3481 + 31d1f64 commit ad0f51f

File tree

6 files changed

+58
-91
lines changed

6 files changed

+58
-91
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Price.php

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
use Magento\Catalog\Api\Data\ProductRender\PriceInfoInterfaceFactory;
1212
use Magento\Catalog\Api\Data\ProductRenderInterface;
1313
use Magento\Catalog\Model\ProductRender\FormattedPriceInfoBuilder;
14-
use Magento\Catalog\Pricing\Price\FinalPrice;
15-
use Magento\Catalog\Pricing\Price\RegularPrice;
1614
use Magento\Catalog\Ui\DataProvider\Product\ProductRenderCollectorInterface;
1715
use Magento\Framework\Pricing\PriceCurrencyInterface;
18-
use Magento\GroupedProduct\Model\Product\Type\Grouped;
1916

2017
/**
2118
* Collect information about base prices of products
@@ -25,6 +22,18 @@
2522
*/
2623
class Price implements ProductRenderCollectorInterface
2724
{
25+
/** FInal Price key */
26+
public const KEY_FINAL_PRICE = "final_price";
27+
28+
/** Minimal Price key */
29+
public const KEY_MINIMAL_PRICE = "minimal_price";
30+
31+
/** Regular Price key */
32+
public const KEY_REGULAR_PRICE = "regular_price";
33+
34+
/** Max Price key */
35+
public const KEY_MAX_PRICE = "max_price";
36+
2837
/**
2938
* @var PriceCurrencyInterface
3039
*/
@@ -75,49 +84,40 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ
7584
$priceInfo = $this->priceInfoFactory->create();
7685
}
7786

78-
if ($product->getTypeId() === Grouped::TYPE_CODE) {
79-
$product = $product
87+
$priceInfo->setFinalPrice(
88+
$product
8089
->getPriceInfo()
81-
->getPrice(FinalPrice::PRICE_CODE)
82-
->getMinProduct();
83-
}
90+
->getPrice('final_price')
91+
->getAmount()
92+
->getValue()
93+
);
94+
$priceInfo->setMinimalPrice(
95+
$product
96+
->getPriceInfo()
97+
->getPrice('final_price')
98+
->getMinimalPrice()
99+
->getValue()
100+
);
101+
$priceInfo->setRegularPrice(
102+
$product
103+
->getPriceInfo()
104+
->getPrice('regular_price')
105+
->getAmount()
106+
->getValue()
107+
);
108+
$priceInfo->setMaxPrice(
109+
$product
110+
->getPriceInfo()
111+
->getPrice('final_price')
112+
->getMaximalPrice()
113+
->getValue()
114+
);
84115

85-
if ($product !== null) {
86-
$priceInfo->setFinalPrice(
87-
$product
88-
->getPriceInfo()
89-
->getPrice(FinalPrice::PRICE_CODE)
90-
->getAmount()
91-
->getValue()
92-
);
93-
$priceInfo->setMinimalPrice(
94-
$product
95-
->getPriceInfo()
96-
->getPrice(FinalPrice::PRICE_CODE)
97-
->getMinimalPrice()
98-
->getValue()
99-
);
100-
$priceInfo->setRegularPrice(
101-
$product
102-
->getPriceInfo()
103-
->getPrice(RegularPrice::PRICE_CODE)
104-
->getAmount()
105-
->getValue()
106-
);
107-
$priceInfo->setMaxPrice(
108-
$product
109-
->getPriceInfo()
110-
->getPrice(FinalPrice::PRICE_CODE)
111-
->getMaximalPrice()
112-
->getValue()
113-
);
114-
115-
$this->formattedPriceInfoBuilder->build(
116-
$priceInfo,
117-
$productRender->getStoreId(),
118-
$productRender->getCurrencyCode()
119-
);
120-
}
116+
$this->formattedPriceInfoBuilder->build(
117+
$priceInfo,
118+
$productRender->getStoreId(),
119+
$productRender->getCurrencyCode()
120+
);
121121

122122
$productRender->setPriceInfo($priceInfo);
123123
}

app/code/Magento/Catalog/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"magento/module-ui": "*",
3232
"magento/module-url-rewrite": "*",
3333
"magento/module-widget": "*",
34-
"magento/module-wishlist": "*",
35-
"magento/module-grouped-product": "*"
34+
"magento/module-wishlist": "*"
3635
},
3736
"suggest": {
3837
"magento/module-cookie": "*",

app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,21 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
use Magento\Catalog\Block\Product\View;
8-
use Magento\Catalog\Model\Product;
9-
use Magento\Catalog\Pricing\Price\FinalPrice;
10-
use Magento\Framework\Escaper;
11-
use Magento\GroupedProduct\Model\Product\Type\Grouped;
12-
13-
/**
14-
* @var View $block
15-
* @var Escaper $escaper
16-
*/
7+
/** @var $block \Magento\Catalog\Block\Product\View */
178
?>
189

1910
<meta property="og:type" content="product" />
2011
<meta property="og:title"
21-
content="<?= $escaper->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
12+
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
2213
<meta property="og:image"
23-
content="<?= $escaper->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>"
24-
/>
14+
content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
2515
<meta property="og:description"
26-
content="<?= $escaper->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
16+
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
2717
<meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
28-
<?php
29-
if ($block->getProduct()->getTypeId() === Grouped::TYPE_CODE):
30-
/** @var Product $minProduct */
31-
$minProduct = $block->getProduct()
32-
->getPriceInfo()
33-
->getPrice(FinalPrice::PRICE_CODE)
34-
->getMinProduct();
35-
36-
$priceAmount = ($minProduct !== null) ? $minProduct->getPriceInfo()
37-
->getPrice(FinalPrice::PRICE_CODE)
38-
->getAmount() : $minProduct;
39-
else:
40-
$priceAmount = $block->getProduct()
41-
->getPriceInfo()
42-
->getPrice(FinalPrice::PRICE_CODE)
43-
->getAmount();
44-
endif;
45-
?>
46-
47-
<?php if ($priceAmount !== null): ?>
48-
<meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/>
49-
<?= $block->getChildHtml('meta.currency') ?>
18+
<?php if ($priceAmount = $block->getProduct()
19+
->getPriceInfo()
20+
->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)
21+
->getAmount()):?>
22+
<meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/>
23+
<?= $block->getChildHtml('meta.currency') ?>
5024
<?php endif;?>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithTaxRuleForBundleProductInRecentlyViewedWidgetTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<description value="Create tax rule for grouped product in recently viewed widget"/>
1616
<testCaseId value="AC-6282"/>
1717
<severity value="CRITICAL"/>
18+
<skip>
19+
<issueId value="https://github.com/magento/magento2/issues/37322"/>
20+
</skip>
1821
</annotations>
1922
<before>
2023
<createData entity="defaultTaxRate" stepKey="initialTaxRate"/>

app/code/Magento/GroupedProduct/view/base/web/template/product/price/special_price.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/code/Magento/GroupedProduct/view/frontend/ui_component/widget_recently_viewed.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<item name="regular_price" xsi:type="array">
1818
<item name="bodyTmpl" xsi:type="string">Magento_GroupedProduct/product/price/regular_price</item>
1919
</item>
20-
<item name="special_price" xsi:type="array">
21-
<item name="bodyTmpl" xsi:type="string">Magento_GroupedProduct/product/price/special_price</item>
22-
</item>
2320
<item name="minimal_price" xsi:type="array">
2421
<item name="label" xsi:type="string" translate="true">Starting at</item>
2522
<item name="bodyTmpl" xsi:type="string">Magento_GroupedProduct/product/price/minimal_price</item>

0 commit comments

Comments
 (0)