Sylius: Original price not displayed in product listing

Created on 6 Jul 2017  Â·  7Comments  Â·  Source: Sylius/Sylius

Create a product variant with price and original price.
On product listing only the price is being displayed, original price should also be displayed crossed out.

I'm ready to contribute if you see it's importance.

Good First Issue Potential Bug UX

Most helpful comment

@nacholibre , sorting per price is totally not related to this issue, here we just want to show the original price.(only affecting the view).
The service that will calculate original price , will implement the identical function (f(x) = x),
which means sorting per price wont be affected. going through a service gives plugins ability to alter original price on the fly (without touching data in DB)

All 7 comments

Please, feel free to open a PR :)

@Snake-Tn, try this:

{% set prices = product.variants|first.channelPricings|first %}
{{ prices.originalPrice }}

UPDATE: see these #7079 & #7087

@kochen , original price should not be taken directly from entity, it should be calculated through a service, so I give the possibility for plugins to overwrite it(like catalog promotion plugin) , currently this is the case for the price.

If the price is calculated through service how can you sort by price?

@nacholibre , what you mean by "sort" the price ?

For example when you list products and you want to sort them by price asc/desc (including promotions etc). One solution is to fetch all products and sort them in memory, but this is not good idea.

@nacholibre , sorting per price is totally not related to this issue, here we just want to show the original price.(only affecting the view).
The service that will calculate original price , will implement the identical function (f(x) = x),
which means sorting per price wont be affected. going through a service gives plugins ability to alter original price on the fly (without touching data in DB)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ping86 picture ping86  Â·  3Comments

eb22fbb4 picture eb22fbb4  Â·  3Comments

tchapi picture tchapi  Â·  3Comments

stefandoorn picture stefandoorn  Â·  3Comments

stefandoorn picture stefandoorn  Â·  3Comments