Craft shows the sale running, and can tell which products are on sale using a:

{% set saleProducts = craft.products()
    hasSales: true,
    hasStock: true
}).all() %}

loop, but on the product itself. However, variant.onSale doesn't detect the sale, and variant.salePriceAsCurrency brings up the original price.

In the CMS looks like things are set up correctly -- the sale is connected to the product/varient and the product is promotable.

What am I missing here?

  • Can you share your for code that spits out the saleProducts? Commented Jun 30, 2022 at 20:52

1 Answer 1


My suggestion: The discounted price will only be shown for the item already ADDED to the cart.

{% for lineItem in cart.lineItems %}
{{ dump(lineItem.total) }}
{% endfor %}



Therefore, I think you can get a saleModel applicable to the iterable variant and then use these properties to manually calculate and display the discount


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.