[2.5] Qty button can be hidden for variables sold individually
This commit is contained in:
parent
f5140af918
commit
8093194a44
|
@ -14,7 +14,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
global $product;
|
||||
?>
|
||||
<div class="woocommerce-variation-add-to-cart variations_button">
|
||||
<?php if ( ! $product->is_sold_individually() ) : ?>
|
||||
<?php woocommerce_quantity_input( array( 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : 1 ) ); ?>
|
||||
<?php endif; ?>
|
||||
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
|
||||
<input type="hidden" name="add-to-cart" value="<?php echo absint( $product->id ); ?>" />
|
||||
<input type="hidden" name="product_id" value="<?php echo absint( $product->id ); ?>" />
|
||||
|
|
Loading…
Reference in New Issue