Created
July 17, 2017 17:49
-
-
Save MrJoshFisher/dff9ffe55473543f7f7878114f935046 to your computer and use it in GitHub Desktop.
Shows the RRP Price / Sale Price on the cart page in the table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_cart_item_price', 'bbloomer_change_cart_table_price_display', 30, 3 ); | |
function bbloomer_change_cart_table_price_display( $price, $values, $cart_item_key ) { | |
$slashed_price = $values['data']->get_price_html(); | |
$is_on_sale = $values['data']->is_on_sale(); | |
if ( $is_on_sale ) { | |
$price = $slashed_price; | |
} | |
return $price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment