Show read more if variable product is out of stock

This commit is contained in:
Mike Jolley 2016-06-07 14:34:27 +01:00
parent 5329baee0a
commit 594641422d
1 changed files with 3 additions and 1 deletions

View File

@ -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 );
}
/**