' .
__('CZL Express requires WooCommerce to be installed and active', 'woocommerce-czlexpress') .
'
';
});
return false;
}
if (version_compare(WC_VERSION, '6.0.0', '<')) {
add_action('admin_notices', function() {
echo '' .
__('CZL Express requires WooCommerce 6.0.0 or higher', 'woocommerce-czlexpress') .
'
';
});
return false;
}
return true;
}
// 初始化插件
function woo_czl_express_init() {
if (wc_czlexpress_check_environment()) {
require_once WOO_CZL_EXPRESS_PATH . 'includes/class-woo-czl-express.php';
WooCzlExpress::instance();
}
}
add_action('plugins_loaded', 'woo_czl_express_init');
add_action('woocommerce_order_status_processing', array('CZL_Order', 'create_shipment'));