• I like to share with you a code for display lowest price from fixed quantity.
    I am open to suggestions and improvements

    // Lowest price on single product, product cat, recent viewed  by risorsainformatica.com
    add_filter( 'woocommerce_get_price_html', 'risorsa_add_price_prefix', 99, 2 );
      
    function risorsa_add_price_prefix( $price, $product ){
    
    global $product;
    
    $fixedPriceData = WoofixUtility::isFixedQtyPrice($product);
    
    // check if is a fixedqt product
    if ($fixedPriceData !== false) {
    			
    $data_fixed = WoofixUtility::isFixedQtyPrice($product);
    $prezzominimo=end($data_fixed['woofix']); 
    
    $prezzodamostrare = $prezzominimo['woofix_price'];
    $price = 'Start from: ' . $prezzodamostrare .'&euro; <small class="woocommerce-price-suffix">Iva escl.</small>';
        return $price;
    }
    else {
    // regular product (not fixedqt)
     $price = '' . $price;
        return $price;
    }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello this is amazing however is there a way to force it to 2 decimal places and also is there a way for it to work with the woocommerce blocks such as best selling and recently added, at the moment it just shows the default price.

    I have fixed the Decimal places but would be great to get it working with the blocks.

    Very nice piece of code.
    Is it possible to show the lowest total price?

    Let say the minimum you sell is 10 pieces at a cost of 10 €, can you then set the price to be 100 €?

    @radtax could you please share the code with two decimal prices?
    That would be really helpfull. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘SOLUTION: Show “From:” and the lowest possible price’ is closed to new replies.