Skip to content

Commit a39c925

Browse files
authored
Merge pull request #59 from integer-net/use-special-price-for-indexing
Use special price for indexing so filters use the special price
2 parents de348c7 + d28a8ca commit a39c925

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

main/src/Model/Bridge/Product.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ public function getSolrBoost()
155155

156156
public function getPrice()
157157
{
158-
return $this->getMagentoProduct()->getPrice();
158+
$price = $this->getMagentoProduct()->getFinalPrice();
159+
if ($price == 0) {
160+
$price = $this->getMagentoProduct()->getMinimalPrice();
161+
}
162+
return $price;
159163
}
160164

161165
public function getAttributeValue(AttributeInterface $attribute)

main/test/unit/Model/Bridge/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testCoreAttributes($storeId, $productData, $expectedHasSpecialPr
8484
$this->assertEquals($productData['id'], $productBridge->getId(), 'id');
8585
$this->assertEquals($productData['id'] . '_' . $storeId, $productBridge->getSolrId(), 'solr_id');
8686
$this->assertEquals($productData['solr_boost'], $productBridge->getSolrBoost(), 'solr_boost');
87-
$this->assertEquals($productData['price'], $productBridge->getPrice(), 'price');
87+
$this->assertEquals($finalPrice, $productBridge->getPrice(), 'price');
8888
$this->assertEquals($productData['category_ids'], $productBridge->getCategoryIds(), 'category_ids');
8989

9090
$this->assertSame($expectedHasSpecialPrice, $productBridge->hasSpecialPrice(), 'has_special_price');

0 commit comments

Comments
 (0)