I have set up my cart to display the product price with a strikethrough next to the sale price of the discounted item (see first product in cart in photo).
This was achieved using this code
function my_custom_show_sale_price_at_cart( $old_display, $cart_item, $cart_item_key ) {
$product = $cart_item['data'];
if ( $product ) {
return $product->get_price_html();
}
return $old_display;
}
add_filter( 'woocommerce_cart_item_price', 'my_custom_show_sale_price_at_cart', 10, 3 );
The issue as you can see in the photo is that this only works for products on sale (the $12.00 product on sale for 0.00). However, a coupon code is applied to the other two items.
I followed this thread to display the total savings as "You Saved" in the checkout summary, including sale and coupon discounts.
How can I display the discounted price of the items in the cart that have the coupon applied to them?