_count ) { return (int) $zone_count > 0; } $zone_count = count( WC_Data_Store::load( 'shipping-zone' )->get_zones() ); set_transient( self::ZONE_COUNT_TRANSIENT_NAME, $zone_count ); return $zone_count > 0; } /** * Check if the store has physical products. * * @return bool */ public static function has_physical_products() { $profiler_data = get_option( OnboardingProfile::DATA_OPTION, array() ); $product_types = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array(); return in_array( 'physical', $product_types, true ); } /** * Delete the zone count transient used in has_shipping_zones() method * to refresh the cache. */ public static function delete_zone_count_transient() { delete_transient( self::ZONE_COUNT_TRANSIENT_NAME ); } /** * Check if the store sells digital products only. * * @return bool */ private static function is_selling_digital_type_only() { $profiler_data = get_option( OnboardingProfile::DATA_OPTION, array() ); $product_types = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array(); return array( 'downloads' ) === $product_types; } }