Skip to content

Commit 907772e

Browse files
author
Dmytro Voskoboinikov
committed
MAGETWO-71515: Special/lowest price in child of a Configurable Product causes the entire product to show that price
1 parent 4004f92 commit 907772e

File tree

2 files changed

+19
-2
lines changed
  • dev/tests/functional/tests/app/Magento
    • Catalog/Test/Block/Product
    • ConfigurableProduct/Test/Block/Product

2 files changed

+19
-2
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,23 @@ class View extends AbstractConfigureBlock
211211
/**
212212
* Get block price.
213213
*
214+
* @param FixtureInterface|null $product
215+
*
214216
* @return Price
215217
*/
216-
public function getPriceBlock()
218+
public function getPriceBlock(FixtureInterface $product = null)
217219
{
220+
$typeId = null;
221+
222+
if ($product) {
223+
$dataConfig = $product->getDataConfig();
224+
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
225+
}
226+
227+
if ($this->hasRender($typeId)) {
228+
return $this->callRender($typeId, 'getPriceBlock');
229+
}
230+
218231
return $this->blockFactory->create(
219232
'Magento\Catalog\Test\Block\Product\Price',
220233
['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)]

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ class View extends \Magento\Catalog\Test\Block\Product\View
1818
/**
1919
* Gets a configurable product price block.
2020
*
21+
* @param FixtureInterface|null $product
22+
*
2123
* @return Price
24+
*
25+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2226
*/
23-
public function getPriceBlock()
27+
public function getPriceBlock(FixtureInterface $product = null)
2428
{
2529
return $this->blockFactory->create(
2630
'Magento\ConfigurableProduct\Test\Block\Product\Price',

0 commit comments

Comments
 (0)