• Resolved mandy semaan

    (@mandy-semaan)


    Hello,

    Hope all is well.

    How can I display the total amount in the single product page taking into consideration the minimum quantity set please?

    e.g.: if single product price is 1$ and minimum quantity is 20, how to display before the ADD TO CART button “Total amount: $20” ?

    Thank you

    • This topic was modified 10 months, 2 weeks ago by mandy semaan.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there,

    To show/display total minimum amount, you can set product short description for that product.

    Check the screenshot for reference.

    https://prnt.sc/3xzelvwktI-D

    Let me know if this helps.

    Thread Starter mandy semaan

    (@mandy-semaan)

    hello,

    thanks for your feedback. I think I haven’t expressed myself properly ??

    I have the below code to display the total amount in a single product page.

    the code works in variable products if I have default attributes selected, but doesn’t work for simple products:

    How can I make the code work (display total amount) for all products with a minimum qty selected?

    CODE

    add_action( ‘woocommerce_after_add_to_cart_button’, ‘bbloomer_product_price_recalculate’ );

    function bbloomer_product_price_recalculate() {
    global $WOOCS;
    global $product;

    echo ‘

    Total’;
    $priceo = $product->get_price();
    $price = $WOOCS->woocs_exchange_value($priceo);
    $currency = get_woocommerce_currency_symbol();
    wc_enqueue_js( “
    $(‘[name=quantity]’).on(‘input change’, function() {
    var qty = $(this).val();
    var price = ‘” . esc_js( $price ) . “‘;
    var price_string = (price*qty).toFixed(0);
    $(‘#subtot > span’).html(‘” . esc_js( $currency ) . “‘ +price_string);
    }).change();
    ” );
    }
    add_action( ‘wp_header’, ‘bbloomer_product_price_recalculate’ );

    Hi,

    Thanks for sharing details.

    You change the action hook from 'wp_header' to 'wp_enqueue_scripts'. It may help.

    Thread Starter mandy semaan

    (@mandy-semaan)

    it’s not working… throwing error when trying to save the functions.php file ??

    can you share a little more details please? ??

    Thanks again

    Hello Mandy,

    The feature you’re currently looking for is not present in the plugin.

    However, we took it as a feature request and hopefully we’ll be introducing this feature in upcoming release.

    Thank you for choosing WC Min Max Quantities.

    Thread Starter mandy semaan

    (@mandy-semaan)

    noted. last question please: how can I display under the product tile in the single product page “minimum quantity for this item is X” and dynamically get the minimum qty set in the backend ?

    Thanks

    Hello Mandy,

    Since the feature is currently not available in the plugin and none of the above solutions worked for you, I would suggest and recommend you wait till the feature is live from WC Min Max Quantities.

    Hopefully this feature will get live soon within one of the next updates.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display Total Amount in Single Product Page’ is closed to new replies.