Automattic\WooCommerce\Internal\Admin
ShippingLabelBanner::should_show_meta_box
Check if WooCommerce Shipping makes sense for this merchant.
Method of the class: ShippingLabelBanner{}
No Hooks.
Returns
true|false.
Usage
// private - for code of main (parent) class only $result = $this->should_show_meta_box();
ShippingLabelBanner::should_show_meta_box() ShippingLabelBanner::should show meta box code WC 10.7.0
private function should_show_meta_box() {
if ( ! $this->shipping_label_banner_display_rules ) {
$dotcom_connected = null;
$wcs_version = null;
if ( class_exists( Jetpack_Connection_Manager::class ) ) {
$dotcom_connected = ( new Jetpack_Connection_Manager() )->has_connected_owner();
}
if ( class_exists( '\Automattic\WCShipping\Utils' ) ) {
$wcs_version = \Automattic\WCShipping\Utils::get_wcshipping_version();
}
$incompatible_plugins = class_exists( '\WC_Shipping_Fedex_Init' ) ||
class_exists( '\WC_Shipping_UPS_Init' ) ||
class_exists( '\WC_Integration_ShippingEasy' ) ||
class_exists( '\WC_ShipStation_Integration' );
$this->shipping_label_banner_display_rules =
new ShippingLabelBannerDisplayRules(
$dotcom_connected,
$wcs_version,
$incompatible_plugins
);
}
return $this->shipping_label_banner_display_rules->should_display_banner();
}