File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88if ( ! function_exists ( 'storefront_woo_cart_available ' ) ) {
99 /**
1010 * Validates whether the Woo Cart instance is available in the request
11+ * Will also be `false` for logged-out users if the Coming Soon mode is enabled for store pages only.
1112 *
1213 * @since 2.6.0
1314 * @return bool
1415 */
1516 function storefront_woo_cart_available () {
17+ $ coming_soon_helper_class = \Automattic \WooCommerce \Internal \ComingSoon \ComingSoonHelper::class;
18+ if ( function_exists ( 'wc_get_container ' ) && class_exists ( $ coming_soon_helper_class ) ) {
19+ $ coming_soon_helper = wc_get_container ()->get ( $ coming_soon_helper_class );
20+ if ( ! is_user_logged_in () && $ coming_soon_helper ->is_store_coming_soon () ) {
21+ return false ;
22+ }
23+ }
24+
1625 $ woo = WC ();
1726 return $ woo instanceof \WooCommerce && $ woo ->cart instanceof \WC_Cart;
1827 }
You can’t perform that action at this time.
0 commit comments