Skip to content

Commit 4004f92

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 8ff539b commit 4004f92

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

app/code/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionsProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class LowestPriceOptionsProvider implements LowestPriceOptionsProviderInterface
3838
* @param LinkedProductSelectBuilderInterface $linkedProductSelectBuilder
3939
* @param CollectionFactory $collectionFactory
4040
* @param OptionsCollectionProvider|null $optionsCollectionProvider
41+
*
42+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4143
*/
4244
public function __construct(
4345
ResourceConnection $resourceConnection,

app/code/Magento/ConfigurableProduct/Pricing/Price/OptionsCollectionProvider.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ public function __construct(
4545
*
4646
* @return Collection
4747
*/
48-
public function getCollection(
49-
array $linkedProductSelects,
50-
array $attributesToSelect = ['price', 'special_price']
51-
) {
48+
public function getCollection(array $linkedProductSelects, array $attributesToSelect = ['price', 'special_price'])
49+
{
5250
$productIds = $this->resource->getConnection()->fetchCol(
5351
'(' . implode(') UNION (', $linkedProductSelects) . ')'
5452
);

app/code/Magento/ConfigurableProduct/view/base/templates/product/price/final_price.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $priceModel = $block->getPriceType('regular_price');
1818
$finalPriceModel = $block->getPriceType('final_price');
1919

2020
/** @var \Magento\Framework\Pricing\Price\PriceInterface $highestPriceModel */
21-
$highestPriceModel = $this->getPriceType('highest_price');
21+
$highestPriceModel = $block->getPriceType('highest_price');
2222

2323
$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : '';
2424
$schema = ($block->getZone() == 'item_view') ? true : false;

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,11 @@ define([
930930

931931
$(this.options.normalPriceLabelSelector).hide();
932932

933-
_.each($('.' + this.options.classes.attributeOptionsWrapper), function (element) {
934-
if ($(element).find('.' + this.options.classes.optionClass + '.selected').length === 0) {
935-
if ($(element).find('.' + this.options.classes.selectClass).length > 0) {
936-
_.each($(element).find('.' + this.options.classes.selectClass), function (element) {
937-
if ($(element).val() === '0') {
933+
_.each($('.' + this.options.classes.attributeOptionsWrapper), function (attribute) {
934+
if ($(attribute).find('.' + this.options.classes.optionClass + '.selected').length === 0) {
935+
if ($(attribute).find('.' + this.options.classes.selectClass).length > 0) {
936+
_.each($(attribute).find('.' + this.options.classes.selectClass), function (dropdown) {
937+
if ($(dropdown).val() === '0') {
938938
$(this.options.normalPriceLabelSelector).show();
939939
}
940940
}.bind(this));

0 commit comments

Comments
 (0)