Hello,
I’m contacting you because I wanted to know if it’s possible to display a crossed-out price or a badge to indicate that the product is on sale in the side cart?
Sincerely,
Youcef
This topic has 4 replies, 3 voices, and was last updated 3 weeks, 4 days ago ago by Tony Rodriguez
Hello,
I’m contacting you because I wanted to know if it’s possible to display a crossed-out price or a badge to indicate that the product is on sale in the side cart?
Sincerely,
Youcef
Dear Youcef,
We hope this message finds you well.
To display the discounted price on the side cart, please add the following code to the functions.php file located in your XStore child theme. Alternatively, you may use the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/) to insert the code safely:
add_filter( 'woocommerce_cart_item_price', 'filter_cart_item_price', 999, 3 );
function filter_cart_item_price( $price_html, $cart_item, $cart_item_key ) {
if( $cart_item['data']->is_on_sale() ) {
return $cart_item['data']->get_price_html();
}
return $price_html;
}
Should you have any questions or require further assistance, please do not hesitate to reach out.
Best regards,
The 8Theme Team
Hello, I hope you are well?
Thank you very much for your help, it works.
Thank you so much.
Dear Youcef,
We hope you’re reveling in the experience our theme brings! Your enthusiasm is what fuels our passion. Would you be so kind as to channel that energy into a 5-star rating on ThemeForest? Your feedback is the spark that lights our way!
Click here to spread the love: https://themeforest.net/downloads
Thank you for being an integral part of our journey!
Best Regards,
The 8Theme Team
The issue related to '‘Displaying Discounted Price or Sale Badge in Side Cart’' has been successfully resolved, and the topic is now closed for further responses