woocommerce_quantity_input returns wrong input value
After installing WooCommerce Min/Max Quantities our mini cart quantities seems to be broken.
Plugin: https://woocommerce.com/products/minmax-quantities/
This is the snippet that is suppose to return the input field with the current quantity in the cart.
$product_quantity = woocommerce_quantity_input(
array(
'input_name' => "cart[{$cart_item_key}][qty]",
'input_value' => $cart_item['quantity'],
'max_value' => $_product->get_max_purchase_quantity(),
'min_value' => '0',
'product_name' => $_product->get_name(),
),
$_product,
false
);
If I output the values I get the following:
Array (
[input_name] => cart[18997733ec258a9fcaf239cc55d53363][qty]
[input_value] => 36
[max_value] => -1
[min_value] => 0
[product_name] => Test product 1
)
The input_value is suppose to be 36 so that is good, but the max and min values is not what we set on the product using the "WooCommerce Min/Max Quantities"-plugin.
The max value should be 3000 and the min value should be 12.
When I output woocommerce_quantity_input i get something completely different.
<input
type="number"
id="quantity_5fa7e4d10a17a"
class="input-text qty text form-control"
step="12"
min="12"
max="3000"
name="cart[18997733ec258a9fcaf239cc55d53363][qty]"
value="12"
title="Stk."
size="4"
placeholder=""
inputmode="numeric"
/>
Here the min, max seems to be correct, but the value is 12.
So my question is. How do I set the correct value inside the woocommerce_quantity_input? There must be something I have overlooked.
Any help or point in direction is very appreciated.
Leave an answer
You must login or register to add a new answer .