Tagged: x
-
AuthorPosts
-
September 4, 2016 at 1:00 pm #1160741
SimonParticipantHi X team,
1 / I added a bit of php to put “from” when a product more expensive variant.
For example (from 35$ to 45$)add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); function wc_wc20_variation_price_format( $price, $product ) { $min_price = $product->get_variation_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); if ($min_price != $max_price){ $price = sprintf( __( 'A partir de %1$s', 'woocommerce'), wc_price( $min_price ) ); return $price; } else { $price = sprintf( __( '%1$s', 'woocommerce' ), wc_price( $min_price ) ); return $price; } }But no indication of “ttc” (the suffix price / taxe) on thumbnails .
French law requires us to display “ttc” on all products, all the time.
Can you help me to add the suffix price in this code ?2/ How can i have left sidebar on the page of single product ?
I appreciate your help.
😉September 4, 2016 at 1:06 pm #1160747
SimonParticipantThis reply has been marked as private.September 4, 2016 at 1:14 pm #1160752
SimonParticipantOk,
1/ is done for the thumbmail but not for the single page product (only with promo)
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); function wc_wc20_variation_price_format( $price, $product ) { $min_price = $product->get_variation_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); if ($min_price != $max_price){ $price = sprintf( __( 'A partir de %1$s TTC', 'woocommerce'), wc_price( $min_price ) ); return $price; } else { $price = sprintf( __( '%1$s TTC', 'woocommerce' ), wc_price( $min_price ) ); return $price; } }September 4, 2016 at 1:51 pm #1160779
SimonParticipantThis reply has been marked as private.September 4, 2016 at 7:30 pm #1160919
Rue NelModeratorHello There,
Thanks for writing in! We’re glad that you have figure out a way to resolve the issue in #1. To add a sidebar in single product pages, please check out this topic: https://community.theme.co/forums/topic/sidebar-in-single-product-page-woocommerce/#post-141013
Hope this helps.
September 6, 2016 at 7:25 am #1162955
SimonParticipantHi Rue Nel !
Thanks for that. It Works !
Simon
September 6, 2016 at 7:35 am #1162962
ThaiModeratorYou’re most welcome:)
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1160741 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
