Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1160741
    Simon
    Participant

    Hi 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.
    😉

    #1160747
    Simon
    Participant
    This reply has been marked as private.
    #1160752
    Simon
    Participant

    Ok,

    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;
    }
    }
    #1160779
    Simon
    Participant
    This reply has been marked as private.
    #1160919
    Rue Nel
    Moderator

    Hello 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.

    #1162955
    Simon
    Participant

    Hi Rue Nel !

    Thanks for that. It Works !

    Simon

    #1162962
    Thai
    Moderator

    You’re most welcome:)

  • <script> jQuery(function($){ $("#no-reply-1160741 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>