WPIntell

Source evidence

Step not working in variable product

Min Max Quantity – Minimum/Maximum Quantity, Step Control & Price Limit for WooCommerce · support · 2025-08-18T11:01:00+00:00

complaintsentiment
mediumseverity
0.92relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 34 rows with source links

17.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
covalenciawebs unresolved
Hi, I have the last versino of the plugin. In a variable product I have setup a minimum of 10 items. And step in 10. Minimum works, but step doesn’t work. In simple product it works. https://distecglass.com/productos/adhesivos-tecnicos/sellantes-especiales/loxeal-superlox/ Hope you can help me. Thank you This topic was modified 10 months, 3 weeks ago by covalenciawebs . The page I need help with: [ log in to see the link] Hi, I have updated the plugin but still doesn’t work. I have added a filter to fix it. Maybe it can help: add_filter( 'woocommerce_available_variation', 'cca_pass_variation_qty_rules', 50, 3 ); function cca_pass_variation_qty_rules( $data, $product, $variation ) { // Lee el meta serializado del plugin para esta variación $meta = get_post_meta( $variation->get_id(), 'quantity_var_args', true ); if ( is_array( $meta ) ) { $min = isset( $meta['min_item_var'] ) && $meta['min_item_var'] > 0 ? (int) $meta['min_item_var'] : 0; $max = isset( $meta['max_item_var'] ) && $meta['max_item_var'] ? (int) $meta['max_item_var'] : 0; // puede ser NULL $step = isset( $meta['step_item_var'] ) && $meta['step_item_var'] > 0 ? (int) $meta['step_item_var'] : 0; // Claves que WooCommerce sí respeta (min/max/input_value) if ( $min > 0 ) { $data['min_qty'] = $min; $data['input_value'] = $min; } if ( $max > 0 ) { $data['max_qty'] = $max; } // Nuestras claves personalizadas para leer via JS $data['_cca_qty_min'] = $min > 0 ? $min : 1; $data['_cca_qty_max'] = $max > 0 ? $max : ''; $data['_cca_qty_step'] = $step > 0 ? $step : 1; } return $data; } I also have added a script that changes quantity when you change variation to the minimum available for that variation. If you select a variation with minimum of 10 and change to another with minimum of 5, for example, it changes quantity to 5, so the customer knows this is the minimum, not 10. add_action( 'wp_footer', 'cca_apply_variation_qty_rules_js', 100 ); function cca_apply_variation_qty_rules_js() { if ( ! is_product() ) return; ?> <script> jQuery(function($){ var $form = $('form.variations_form'); if(!$form.length) return; $form.on('found_variation', function(evt, variation){ var min = variation._cca_qty_min || variation.min_qty || 1; var max = variation._cca_qty_max || variation.max_qty || ''; var step = variation._cca_qty_step || 1; var $qty = $form.find('input.qty'); if(min){ $qty.attr('min', min); } if(max){ $qty.attr('max', max); } else { $qty.removeAttr('max'); } if(step){ $qty.attr('step', step); } // 🔹 Siempre reiniciar la cantidad al mínimo (o 1 si no hay mínimo) $qty.val(min > 0 ? min : 1).trigger('change'); }); // Al limpiar selección de variaciones $form.on('reset_data', function(){ var $qty = $form.find('input.qty'); $qty.attr({min:1, step:1}).removeAttr('max').val(1); }); }); </script> <?php } Hi again. I see that what you have donde is remove that from free version, and it’s only available in Pro version. That’s great!! Thank you for your “support”.

Comments

2 shown
covalenciawebs 2025-08-27T08:48:00+00:00

Hi, I have updated the plugin but still doesn’t work. I have added a filter to fix it. Maybe it can help: add_filter( 'woocommerce_available_variation', 'cca_pass_variation_qty_rules', 50, 3 ); function cca_pass_variation_qty_rules( $data, $product, $variation ) { // Lee el meta serializado del plugin para esta variación $meta = get_post_meta( $variation->get_id(), 'quantity_var_args', true ); if ( is_array( $meta ) ) { $min = isset( $meta['min_item_var'] ) && $meta['min_item_var'] > 0 ? (int) $meta['min_item_var'] : 0; $max = isset( $meta['max_item_var'] ) && $meta['max_item_var'] ? (int) $meta['max_item_var'] : 0; // puede ser NULL $step = isset( $meta['step_item_var'] ) && $meta['step_item_var'] > 0 ? (int) $meta['step_item_var'] : 0; // Claves que WooCommerce sí respeta (min/max/input_value) if ( $min > 0 ) { $data['min_qty'] = $min; $data['input_value'] = $min; } if ( $max > 0 ) { $data['max_qty'] = $max; } // Nuestras claves personalizadas para leer via JS $data['_cca_qty_min'] = $min > 0 ? $min : 1; $data['_cca_qty_max'] = $max > 0 ? $max : ''; $data['_cca_qty_step'] = $step > 0 ? $step : 1; } return $data; } I also have added a script that changes quantity when you change variation to the minimum available for that variation. If you select a variation with minimum of 10 and change to another with minimum of 5, for example, it changes quantity to 5, so the customer knows this is the minimum, not 10. add_action( 'wp_footer', 'cca_apply_variation_qty_rules_js', 100 ); function cca_apply_variation_qty_rules_js() { if ( ! is_product() ) return; ?> <script> jQuery(function($){ var $form = $('form.variations_form'); if(!$form.length) return; $form.on('found_variation', function(evt, variation){ var min = variation._cca_qty_min || variation.min_qty || 1; var max = variation._cca_qty_max || variation.max_qty || ''; var step = variation._cca_qty_step || 1; var $qty = $form.find('input.qty'); if(min){ $qty.attr('min', min); } if(max){ $qty.attr('max', max); } else { $qty.removeAttr('max'); } if(step){ $qty.attr('step', step); } // 🔹 Siempre reiniciar la cantidad al mínimo (o 1 si no hay mínimo) $qty.val(min > 0 ? min : 1).trigger('change'); }); // Al limpiar selección de variaciones $form.on('reset_data', function(){ var $qty = $form.find('input.qty'); $qty.attr({min:1, step:1}).removeAttr('max').val(1); }); }); </script> <?php }

covalenciawebs 2025-08-27T08:54:00+00:00

Hi again. I see that what you have donde is remove that from free version, and it’s only available in Pro version. That’s great!! Thank you for your “support”.