Home › Forums › Themes Support › Gecko › How to strike through prices when sale on
Tagged: Sale price
- This topic has 7 replies, 2 voices, and was last updated 6 years, 5 months ago by Harry.
-
AuthorPosts
-
-
July 18, 2018 at 4:08 pm #22920
Is it possible to display the price of a product with the original price with a line through it and the sale price beside it. It is a visual for the customer to see clearly what they are saving. At the moment I have it in the description which highlights it but only once you have gone to that product page – https://www.wheyuk.com/product/pro-recovery/
Thanks
-
July 18, 2018 at 7:33 pm #22923
Hi,
Please add below code
.price del span {text-decoration: line-through;}
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
July 18, 2018 at 8:50 pm #22935
Thank you, I have added this to Jan Studio Theme – General Settings CSS Style Sheet but it has not had any effect. Is there another place I should be adding it please.
-
July 19, 2018 at 1:37 am #22947
Hi,
The price on top is price of separate variation not sale price, the code apply for variation at bottom http://take.ms/ITRhq
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
July 19, 2018 at 1:41 am #22948
I see, thank you. Is there a way to show it at the price of separation variation as well?
-
July 19, 2018 at 1:58 am #22951
Hi,
Please add below code to gecko-child > functions.php
function wc_varb_price_range( $wcv_price, $product ) { $prefix = sprintf('%s: ', __('From', 'wcvp_range')); $wcv_reg_min_price = $product->get_variation_regular_price( 'min', true ); $wcv_min_sale_price = $product->get_variation_sale_price( 'min', true ); $wcv_max_price = $product->get_variation_price( 'max', true ); $wcv_min_price = $product->get_variation_price( 'min', true ); $wcv_price = ( $wcv_min_sale_price == $wcv_reg_min_price ) ? wc_price( $wcv_reg_min_price ) : '<del>' . wc_price( $wcv_reg_min_price ) . '</del>' . '<ins>' . wc_price( $wcv_min_sale_price ) . '</ins>'; return ( $wcv_min_price == $wcv_max_price ) ? $wcv_price : sprintf('%s%s', $prefix, $wcv_price); } add_filter( 'woocommerce_variable_sale_price_html', 'wc_varb_price_range', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_varb_price_range', 10, 2 );
For more please refer this topic https://wedevs.com/105501/disable-woocommerce-variable-product-price/
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
July 19, 2018 at 3:18 pm #22965This reply has been marked as private.
-
July 19, 2018 at 6:33 pm #22974
Hi,
Please remove code and add to gecko-child > functions.php not in gecko. Because when you update gecko theme the code will be remove. If you put in gecko-child the code will prevent when have update.
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio
-
-
AuthorPosts
You must be logged in to reply to this topic.