Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
ExperimentalShippingRecommendation{}
Shipping Task
Хуков нет.
Использование
$ExperimentalShippingRecommendation = new ExperimentalShippingRecommendation(); // use class methods
Методы
- public can_view()
- public get_action_url()
- public get_content()
- public get_id()
- public get_time()
- public get_title()
- public static has_jetpack_connected()
- public static has_plugins_active()
- public is_complete()
Код ExperimentalShippingRecommendation{} ExperimentalShippingRecommendation{} WC 9.3.3
class ExperimentalShippingRecommendation extends Task { /** * ID. * * @return string */ public function get_id() { return 'shipping-recommendation'; } /** * Title. * * @return string */ public function get_title() { return __( 'Get your products shipped', 'woocommerce' ); } /** * Content. * * @return string */ public function get_content() { return ''; } /** * Time. * * @return string */ public function get_time() { return ''; } /** * Task completion. * * @return bool */ public function is_complete() { return self::has_plugins_active() && self::has_jetpack_connected(); } /** * Task visibility. * * @return bool */ public function can_view() { return Features::is_enabled( 'shipping-smart-defaults' ) && ! PluginsHelper::is_plugin_active( 'woocommerce-shipping' ) && ! PluginsHelper::is_plugin_active( 'woocommerce-tax' ); } /** * Action URL. * * @return string */ public function get_action_url() { return ''; } /** * Check if the store has any shipping zones. * * @return bool */ public static function has_plugins_active() { return PluginsHelper::is_plugin_active( 'woocommerce-services' ); } /** * Check if the Jetpack is connected. * * @return bool */ public static function has_jetpack_connected() { $jetpack_connection_manager = new Manager( 'woocommerce' ); return $jetpack_connection_manager->is_connected() && $jetpack_connection_manager->has_connected_owner(); } }