*/ namespace StorePlugin\CustomOrderStatus\MetaBox; use StorePlugin\CustomOrderStatus\Abstracts\AbstractMetaBoxes; use StorePlugin\CustomOrderStatus\Contracts\ServiceInterface; /** * OrderStatusMetaPromo * * WooCommerce custom order status post type metabox (Pro Promotion) */ class OrderStatusMetaPromo implements ServiceInterface { /** * Loader * * @return void */ public function register(): void { \add_filter( 'wc_order_status_fields', [$this, 'orderStatusProFeaturesPromo'], 10, 2 ); \add_filter( 'wc_order_status_email', [$this, 'orderEmailProFeaturesPromo'], 10, 2 ); \add_action( 'post_submitbox_misc_actions', [$this, 'removeUnnecessaryStatusInfoPromo'] ); \add_filter( 'wc_custom_order_status_icon', [$this, 'order_status_icon_field'], 10, 2 ); \add_filter( 'wc_order_status_column', [ $this, 'wc_order_status_column_promo' ] ); \add_action( 'wc_used_order_status_column', [ $this, 'get_blank_option_promo' ] ); \add_action( 'wc_order_status_payable_column', [ $this, 'get_blank_option_promo' ] ); \add_action( 'wc_order_status_report_column', [ $this, 'get_blank_option_promo' ] ); \add_filter( 'manage_wc_order_email_posts_columns', [$this, 'addEmailPostColumns_promo'] ); \add_action( 'manage_wc_order_email_posts_custom_column', [$this, 'setEmailPostColumns_promo'], 10, 2 ); \add_action( 'admin_footer', [$this, 'promo_premium_banner'] ); } /** * Pro Promo Fields for WC Custom Order Statuses * * @param array $fields * @param string $prefix * @return array */ public function orderStatusProFeaturesPromo( $fields, $prefix = '' ) { $fieldsPro = array( array( 'name' => __('Select Icon', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_icon_status", 'type' => 'icon', 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Order statuses for actions', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_action_list_order_status", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Position next to status', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_positioning_order_status", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Order Status Type', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_order_status_type", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Enable Bulk action', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_bulk_action_status", 'type' => 'checkbox', 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Enable Show to report', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_report_order_status", 'type' => 'checkbox', 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), ); return array_merge( $fields, $fieldsPro ); } /** * Pro Fields for WC Custom Order Statuses * * @param array $fields * @param string $prefix * @return array */ public function orderEmailProFeaturesPromo( $fields, $prefix = '' ) { $fields = array( array( 'name' => __('Title', 'advanced-custom-order-status-pro-for-woocommerce'), 'desc' => __('Internal template title shown in admin (not the recipient-visible subject).', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_status_email_title", 'type' => 'text', 'placeholder' => __('Enter email title'), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Order status from', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_order_status_from", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Order status to', 'advanced-custom-order-status-pro-for-woocommerce'), 'desc' => __( 'Set \'Order status to\' to send an e-mail upon changing order status is enough. But sometimes you might also need to manage \'from status\' to \'to status\'', 'advanced-custom-order-status-pro-for-woocommerce' ), 'id' => "{$prefix}_order_status_to", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Send email to', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_status_email_to", 'type' => 'select', 'nullvalue' => true, 'options' => array(), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Email subject', 'advanced-custom-order-status-pro-for-woocommerce'), 'desc' => __('Provide the subject line recipients will see. Keep it short and descriptive and, when helpful, include order-specific placeholders such as {order_number} or {order_id} so recipients can quickly identify the order.', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_status_email_subject", 'type' => 'text', 'placeholder' => __('Enter email subject'), 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), array( 'name' => __('Email Body', 'advanced-custom-order-status-pro-for-woocommerce'), 'desc' => __('Compose the main message for the email. Use the editor to add formatted content (plain text or HTML depending on your email settings). Keep the message concise and include order-specific details using placeholders/shortcodes. Supported shortcodes: {order_details}, {order_id}, {order_number}, {order_date}, {status_from}, {status_to}, {first_name}, {last_name}.', 'advanced-custom-order-status-pro-for-woocommerce'), 'id' => "{$prefix}_status_email_body", 'type' => 'wp_editor', 'disabled' => true, 'tr-class' => 'spcos-pro-tr', 'pro-label' => true, ), ); return $fields; } public function order_status_icon_field($id, $value) { ob_start(); ?>
Custom Icons for Status to provide a personalized and visually appealing experience
Easily apply Custom Order Status Action for faster order management directly from order table.
Include Custom Order Status in Reports and Paid Status(such as paid, requires payment, or not) to streamline tracking and order analysis.
Control Custom Order Status Position and Bulk Action to better align and improve order management efficiency.
Automatically send Email Notifications to admins, customers, or any email address when an order status changes.
Enjoy Premium Support as a premium user