• Resolved moiseh

    (@moiseh)


    Hello,
    Recently i fixed an issue for a customer that the right floating cart quantity not respecting the max value defined by Min Max quantities official extension.

    The only way i found to fix is to make a custom template in the theme for the file “parts/cart/list/product/quantity.php”.

    So i’m pasting the new template code to respect this limit, i think it will be great to add this on plugin in future:

    <span class="xt_woofc-quantity">
    
    	<?php
    	if ( $product->is_sold_individually() ) {
    
    		echo sprintf( '<input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key );
    		
    	} else {
    		
    		$xtMaxValue = $product->backorders_allowed() || $product->get_stock_quantity() === null ? '99999' : $product->get_stock_quantity();
    		$args['max_value'] = apply_filters( 'woocommerce_quantity_input_max', $xtMaxValue, $product );
    		$args = apply_filters( 'woocommerce_quantity_input_args', $args, $product );
    	
    		echo sprintf( 
    			'<input type="number" name="cart[%s][qty]" value="%s" step="1" min="0" max="%s" />', 
    			$cart_item_key, 
    			xt_woofc_item_qty($cart_item, $cart_item_key),
    			$args['max_value']
    		);
    		
    		echo '	
    	  	<span class="xt_woofc-quantity-changer">
    	    	<span class="xt_woofc-quantity-button xt_woofc-quantity-up"><i class="xt_woofcicon-flat-plus"></i></span>
    			<span class="xt_woofc-quantity-button xt_woofc-quantity-down"><i class="xt_woofcicon-flat-minus"></i></span>  
    		</span>';
    	
    	}
    	?>
    
    </span>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Incompatibility with MinMax quantities extension’ is closed to new replies.