Skip to content

How to add discounted price next to original price in checkout summary cart

I have a cart rule that discounts an item from a category A by 50% when in the cart with an item from category B.
I would like to point this out to customers in the minicart, cart, and checkout summary cart by displaying the discounted price next to it and cross out the previous price.

Now, i’ve managed to accomplish this in the cart and minicart:
cart
minicart

but have no idea how to do it in the checkout summary cart:
checkout-summary

I’ve found the piece of code that outputs the price here:
/magento/module-weee/view/frontend/web/template/checkout/summary/item/price

<span class="cart-price">
    <span class="price" data-bind="text: getFormattedPrice(getRowDisplayPriceExclTax($parents[2]))"></span>
</span>

I don’t know much about knockoutJS so couldn’t do much.

Also tried this: https://magento.stackexchange.com/a/363958/103634, didn’t work.

Any help would be appreciated, thank you.