• Hello ,
    I have set the default value for quantity input to 50 in quantity-input.php

    <strong><div class="quantity"><input type="number" step="50" <?php if ( is_numeric( $min_value ) ) : ?>min="50"<?php endif; ?></strong>

    This works well in single product page , but doesnt change in quick view.
    I tried with jquery too

    $(‘.yith-wcqv-main .input-text’).val(“50”);

    both works in single product page but not in quick view?
    Is there any way i can put default value to 50 using code?
    NOTE: I dont want to use to min/max quantity plugin for some reasons

    Here is my website- https://cardmart.in/wedding-invitations/
    Hover on product for quick view button.
    Thank You !

    https://ww.wp.xz.cn/plugins/yith-woocommerce-quick-view/

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    you need to set the input value also.
    <strong><div class="quantity"><input type="number" step="50" <?php if ( is_numeric( $min_value ) ) : ?>min="50"<?php endif; ?> value="50"></strong>

    or, for example, by using the woocommerce function

    woocommerce_quantity_input( array(
           'min_value'   => "50",
           'max_value'   => $product->backorders_allowed() ? '' : $product->get_stock_quantity(),
           'input_value' => ( isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : 50 ),
    	'step'	=> 50
    ) );

    In this way you can remove the js code. Let me know. Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Woocommerce Quantity input default value’ is closed to new replies.