Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Regular and Sale price in the Cart.
- This topic has 3 replies, 3 voices, and was last updated 4 years, 11 months ago by Smadar Israel.
- AuthorPosts
- June 1, 2017 at 6:28 am #1431camsParticipant
Is it possible to show regular and sale price in the cart with autocupons?
Thanks in advance.
***
Es posible que este plugin muestre el precio normal y el precio rebajado con cupones automáticos?
Me refiero a esto: https://businessbloomer.com/wp-content/uploads/2016/05/woocommerce-display-regular-sale-price-cart-table.png
Muchas gracias!
June 1, 2017 at 8:56 am #1436Soft79KeymasterYes, this can be done using the following snippet in functions.php.
But:
– The snippet does not respect the tax display settings of WooCommerce
– The subtotal below the cart will still display the undiscounted subtotaladd_filter( 'woocommerce_cart_item_subtotal', function( $price, $values ) { if ( ! isset( $values['line_subtotal'], $values['line_total'] ) ) return $price; $regular_price = $values['line_subtotal'] + $values['line_subtotal_tax']; $sale_price = $values['line_total'] + $values['line_tax']; $price = '<del>' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del> <ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins>'; return $price; }, 10, 2);June 3, 2017 at 2:37 pm #1447camsParticipantReally thanks!
October 7, 2021 at 1:31 pm #18070Smadar IsraelParticipantThat code is perfect!
Do you have a snippet for catalog page & product page?
I need to show original and sale price - AuthorPosts
- You must be logged in to reply to this topic.