Created
April 24, 2018 17:10
-
-
Save dsignr/b49d6ea996263712a5f85e1304a86275 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $_product->is_sold_individually() ) { | |
$product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key ); | |
} else { | |
$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 ); | |
} | |
echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); // PHPCS: XSS ok. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment