Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrJoshFisher/dff9ffe55473543f7f7878114f935046 to your computer and use it in GitHub Desktop.
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.
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