我使用过WooCommerce和WooCommerce Min / Max Quantities插件
如果"最小数量"我想要这样是50和"库存"是40比产品缺货但我必须做所有40数量在输入框中并添加到购物车。这在"简单的产品"但当进入"变量产品" 它不起作用。
Array
(
[variation_id] => 5
[variation_is_visible] => 1
[variation_is_active] => 1
[is_purchasable] => 1
[display_price] => 54
[display_regular_price] => 54
[attributes] => Array
(
[attribute_color] => red
)
[image_src] =>
[image_link] =>
[image_title] =>
[image_alt] =>
[image_srcset] =>
[image_sizes] =>
[price_html] => £54.00
[availability_html] =>
10 In stock
[sku] => abc
[weight] => kg
[dimensions] =>
[min_qty] => 40
[max_qty] => 10
[backorders_allowed] =>
[is_in_stock] => 1
[is_downloadable] =>
[is_virtual] =>
[is_sold_individually] => no
[variation_description] =>
[input_value] => 40
)
这来自档案woocommerce/template/simple-product/add-to-cart/variable.php
。
下面的代码是自定义代码,放在原始文件中的表单上方,此代码引用了上面数据的位置。
print_r($variation);
其中attribute / array [input_value] =>在woocommerce / include / class-wc-product-variable.php
中找不到40
我已分配[input_value] => 40到10
请帮助