Magento2: Range label for 'Layer\Filter\Decimals' is using priceCurrency->format

Created on 28 Jun 2018  Â·  7Comments  Â·  Source: magento/magento2

The decimal filter is using the currency formatter.
Is this so planed or a bug?

This two files are affected:
vendor/magento/module-catalog/Model/Layer/Filter/Decimal.php ->_renderItemLabel()
vendor/magento/module-catalog-search/Model/Layer/Filter/Decimal.php -> renderRangeLabel()

catalog_filter_decimal

catalogsearch_filter_decimal

I think these filters should not use the currency formatter and it should be possible to define the unit of value in the eav table for the label :)

Preconditions

Debian 9.4
Apache 2.4
PHP 7.1
MySQL 5.7
Magento 2.2.5

Steps to reproduce

Default standard installation.
Add a new eav attribute programmatically with data type 'decimal'.

Expected result

Price filter should generate range labels with numbers only:

  • 0 - 9
  • 10 - 19
  • 20 and above.......

Actual result

  • 0,00 € - 9,00 €
  • 10,00 € - 9,00 €
  • 20,00 € - -0,01 €
Catalog Confirmed P2 ready for dev Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x S2 Dev.Experience

Most helpful comment

@xBitsSec, thank you for your report.
We've acknowledged the issue and added to our backlog.

All 7 comments

Hi @xBitsSec. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@xBitsSec do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@xBitsSec, thank you for your report.
We've acknowledged the issue and added to our backlog.

Hi @geet07. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.


This issue is still valid for 2.3.3

@ci2014 Yes, this is still valid and it gets worse in 2.3.4 as decimal attributes are actually assigned the price values.

Hi @drew7721. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@ci2014 Yes, this is still valid and it gets worse in 2.3.4 as decimal attributes are actually assigned the price values. I will open another issue for this though.

Was this page helpful?
0 / 5 - 0 ratings