Only add add_to_cart_button if purchasable and in stock
This commit is contained in:
parent
f76953c3ba
commit
071815aebb
|
@ -16,7 +16,7 @@ echo apply_filters( 'woocommerce_loop_add_to_cart_link',
|
|||
esc_url( $product->add_to_cart_url() ),
|
||||
esc_attr( $product->id ),
|
||||
esc_attr( $product->get_sku() ),
|
||||
$product->is_purchasable() ? 'add_to_cart_button' : '',
|
||||
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
|
||||
esc_attr( $product->product_type ),
|
||||
esc_html( $product->add_to_cart_text() )
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue