Support » Plugin: ELEX WooCommerce Role Based Pricing » Show minimum price for variations (“From: “)

  • Resolved insigni

    (@insigni)


    Hello and thank you for your plugin.

    I have the premium version of this one (V 2.6.1) but I don’t know what I need to insert as code to display only the smallest variation for variable products (with “From:” in front).

    The code I was using before doesn’t work with the Elex plugin anymore:

    add_filter( 'woocommerce_variable_sale_price_html', 'isg_variation_price_format', 1, 2 );
    add_filter( 'woocommerce_variable_price_html', 'isg_variation_price_format', 1, 2 );
    function isg_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( __( "<small class='prefix-var'>À partir de</small> %s <small class='woocommerce-price-suffix'>HT</small>", 'woocommerce' ), wc_price( $min_price ) );
        return $price;
      } else {
        $price = sprintf( __( "%s <small class='woocommerce-price-suffix'>HT</small>", 'woocommerce' ), wc_price( $min_price ) );
        return $price;
      }
    }

    And I can’t find any precise documentation about it (php…).

    Thank you for your help.

    • This topic was modified 2 years ago by insigni.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ELEXtensions

    (@elextensions)

    Hello,

    Your requirement could be solved by our another product ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount to show the prefix text. If that is not solving the requirement, suggest you to contact us through the support.

    Thanks

    Thread Starter insigni

    (@insigni)

    All right, I’ll contact support.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show minimum price for variations (“From: “)’ is closed to new replies.