Show read more if variable product is out of stock
This commit is contained in:
parent
5329baee0a
commit
594641422d
|
@ -40,7 +40,9 @@ class WC_Product_Variable extends WC_Product {
|
|||
* @return string
|
||||
*/
|
||||
public function add_to_cart_text() {
|
||||
return apply_filters( 'woocommerce_product_add_to_cart_text', __( 'Select options', 'woocommerce' ), $this );
|
||||
$text = $this->is_purchasable() && $this->is_in_stock() ? __( 'Select options', 'woocommerce' ) : __( 'Read More', 'woocommerce' );
|
||||
|
||||
return apply_filters( 'woocommerce_product_add_to_cart_text', $text, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue