Skip to content

Commit a52986d

Browse files
MC-16650: Product Attribute Type Price Not Displaying
1 parent a3a8c13 commit a52986d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryFilterSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<section name="StorefrontCategoryFilterSection">
1212
<element name="CategoryFilter" type="button" selector="//main//div[@class='filter-options']//div[contains(text(), 'Category')]"/>
1313
<element name="CategoryByName" type="button" selector="//main//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
14-
<element name="CustomPriceAttribute" type="button" selector="//div[contains(@class,'filter-options-title')]"/>
14+
<element name="CustomPriceAttribute" type="button" selector="div.filter-options-title"/>
1515
</section>
1616
</sections>

app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*/
1515
class Decimal extends AbstractFilter
1616
{
17+
/** Decimal delta for filter */
18+
private const DECIMAL_DELTA = 0.001;
19+
1720
/**
1821
* @var \Magento\Framework\Pricing\PriceCurrencyInterface
1922
*/
@@ -75,7 +78,7 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
7578
// When the range is 10-20 we only need to get products that are in the 10-19.99 range.
7679
$toValue = $to;
7780
if (!empty($toValue) && $from !== $toValue) {
78-
$toValue -= 0.001;
81+
$toValue -= self::DECIMAL_DELTA;
7982
}
8083

8184
$this->getLayer()

app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Price.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Price implements GeneratorInterface
1919
/**
2020
* @inheritdoc
2121
*/
22-
public function getFilterData(Attribute $attribute, $filterName)
22+
public function getFilterData(Attribute $attribute, $filterName): array
2323
{
2424
return [
2525
'type' => FilterInterface::TYPE_RANGE,
@@ -33,7 +33,7 @@ public function getFilterData(Attribute $attribute, $filterName)
3333
/**
3434
* @inheritdoc
3535
*/
36-
public function getAggregationData(Attribute $attribute, $bucketName)
36+
public function getAggregationData(Attribute $attribute, $bucketName): array
3737
{
3838
return [
3939
'type' => BucketInterface::TYPE_DYNAMIC,

0 commit comments

Comments
 (0)