Removing the word “From:” in categrory and price page
-
This, I am hoping, is a simple code change.
I have variable pricing for some products, which was displaying as a price range that was something like this: “AUD$xxx to AUD$XXX”. I implemented the following code to remove the two prices and only display the lower price.
———–
//hide price range code 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 );
—————–
On the category page and the individual product page the price of the item is now displaying “AUD From: $XXXX”. I would like to remove the word “From”. This also appears on the category page of the shop. This also needs to be removed. So the price should show as the following;
“AUD: $XXX” or
“USD: $XXX” for US pricing etc…As I said I have already adjusted the funtions.php file in the theme (Sober) with the above custom code. However I cannot remove the word “From”.
Any help would be great.
- This topic was modified 5 years, 3 months ago by .
- This topic was modified 5 years, 3 months ago by . Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
- This topic was modified 5 years, 3 months ago by . Reason: code fixed
The page I need help with: [log in to see the link]
- The topic ‘Removing the word “From:” in categrory and price page’ is closed to new replies.