From 0db54ecec3284d027caf171a9880e1c28451259b Mon Sep 17 00:00:00 2001 From: Kathy Daring Date: Fri, 28 Aug 2020 12:01:11 -0600 Subject: [PATCH] Add woocommerce_product_has_options filter --- includes/abstracts/abstract-wc-product.php | 2 +- includes/class-wc-product-variable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index f45d1449ebb..ccecf15e367 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -1738,7 +1738,7 @@ class WC_Product extends WC_Abstract_Legacy_Product { * @return boolean */ public function has_options() { - return false; + return apply_filters( 'woocommerce_product_has_options', false, $this ); } /* diff --git a/includes/class-wc-product-variable.php b/includes/class-wc-product-variable.php index 135705e81d5..8b65cc2f0f5 100644 --- a/includes/class-wc-product-variable.php +++ b/includes/class-wc-product-variable.php @@ -590,7 +590,7 @@ class WC_Product_Variable extends WC_Product { * @return boolean */ public function has_options() { - return true; + return apply_filters( 'woocommerce_product_has_options', true, $this ); } /**