*/ class Phoen_Asonfw_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; $enable_plugin = get_option( 'wc_settings_order_number_enable_plugin'); define('plugins_url',plugin_dir_url(__FILE__)); add_action( 'admin_menu', __CLASS__ . '::phoen_asonfw_fv_menu_page' ); add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::phoen_asonfw_add_settings_tab', 50 ); add_action( 'woocommerce_settings_tabs_settings_tab_order_number', __CLASS__ . '::phoen_asonfw_settings_tab' ); add_action( 'woocommerce_update_options_settings_tab_order_number', __CLASS__ . '::phoen_asonfw_update_settings' ); if($enable_plugin=='yes'){ add_action('woocommerce_checkout_order_processed',__CLASS__ . '::phoen_asonfw_prefix_suffix', 10, 2); add_filter( 'woocommerce_order_number',__CLASS__ . '::phoen_asonfw_change_woocommerce_order_number'); } } /** * Register Admin menu function. * * @since 1.0.0 */ // Admin menu function function phoen_asonfw_fv_menu_page(){ add_menu_page( __( 'Advanced Sequential Order Number ', 'textdomain' ), 'Sequential Order Number ', 'manage_options', 'custompage', __CLASS__.'::phoen_asonfw_fv_setting', plugins_url.'images/icon1.png', 59.9 ); } /** * Register the stylesheets for the admin area. * * @since 1.0.0 */ public function enqueue_styles() { /* * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Phoen_Advanced_Request_Quote_Loader as all of the hooks are defined * in that particular class. * * The Phoen_Advanced_Request_Quote_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'style.css', array(), $this->version, 'all' ); } /** * Create a general settings Tabs. * * @since 1.0.0 */ public function phoen_asonfw_fv_setting(){ ?>

  • WhatsApp or Call:+91 8860616134

We Expertize In

  • Design and Develop WordPress based Websites

    Phoeniixx Designs deliver interactive WordPress development services to help businesses drive forward in every sector. We build practically functional WordPress websites integrated with CMS capabilities and high performance algorithms.

  • Theme Customization

    We provide theme customization services so that your website or blog gains effective and catchy online presence. Custom themes are designed by WP experts to match all your business needs.

  • Plugin Customization

    Plugin customization services are provided by highly experienced experts to expand the functionality of your website. We provide complete package of WP plugin development, installation, integration, upgrade, modification and enhancement services.

  • Ecommerce Website using WooCommerce

    Our expert WordPress development services help you get fully functional ecommerce websites integrated with secure payment gateways. We build responsive UI designs to augment your online sales, consumer engagement and brand loyalty.

  • Custom WordPress Development

    Phoeniixx Designs is a leading WordPress development company with spotless track record that aims to deliver an all-inclusive package of website development services at affordable price within stipulated time frame.

  • Wordpress Based Website Maintenance

    We deliver complete website maintenance, migration and support solutions for your business right from addition/modification of content, image manipulation/addition to update/integration of new pages and database support & management services.

  • PSD to WordPress

    Phoeniixx Designs, as a renowned WordPress development company offers PSD to WordPress theme conversion services for personal blogs and corporate websites keeping in mind specific guidelines given by the client.

  • Hire Dedicated WordPress Developers

    Hire industry experts for quality work and save a huge cost on WordPress development services. Get a complete package of WP solutions right from custom theme development to plugin installation for maximizing business ROI.

  • Mobile App for WordPress and Woocommerce

    Get interactive mobile app development services including testing, security, integration, and quality assurance. We provide enhanced mobile app development solutions powered with specialized engineering capabilities and ongoing management of content.

2 Types of Counter Available – Sequential and Random

Set Order Number Width

3 Types of Reset Counter – Daily, Monthly and Yearly

Free Order Identifier

Fields to edit the Prefix/Suffix Text For Order Number and Order Date

Woocommerce Mobile App for Android and iOS

Your WooCommerce store will be converted into an app. Connect to your WooCommerce store sync with your store Products.

Woocommerce Admin App for Android and iOS

Admin app for WooCommmerce is an amazing app which helps the administrator to manage all his woocommerce store work from mobile. It lets you see Sales, Orders , customer details , reports and charts. It Lets you edit and update the Products.Just download this app and connect your WooCommerce store.

INSTRUCTION TO INSTALL PLUGIN

FREE VERSION LIVE DEMO

get_date_created(); $date_suffix = $order_date->date($date); // Order Date create suffixx $order_date_pre = $order->get_date_created(); $date_prefix = $order_date->date($date_pre); // Fix Counter type order number Sequential Or Random if($counter_type == 'sequential'){ // Default Start order number $result = $start_order_number; // Get Order Number Create from wpdb by ID & Date $table_prefix = $wpdb->prefix; $query = "SELECT ID FROM {$table_prefix}posts WHERE post_date LIKE '%".$date_created."%' AND post_type='shop_order' ORDER BY ID "; $result += @count($wpdb->get_results( $query )); }else { $result = $ordernumber_id; } // Width of order number $numlength = mb_strlen($result); if($order_number_width <= $numlength){ $result; }elseif($order_number_width > $numlength){ $num_padded = sprintf("%0".$order_number_width."d", $result); $result = $num_padded; } $new_order_id = str_replace('{prefix}',$order_prefix,$order_format); $new_order_id = str_replace('{suffix}',$order_suffix,$new_order_id); $new_order_id = str_replace('{order_number}',$result,$new_order_id); update_post_meta($ordernumber_id,'new_order_id',$new_order_id); } function phoen_asonfw_change_woocommerce_order_number($ordernumber_id) { global $wpdb; // Get Data by ID $new_order_id = get_post_meta($ordernumber_id,'new_order_id',true); if($new_order_id){ return $new_order_id; } return $ordernumber_id; } /** * Save all the admin setting data. * * @since 1.0.0 */ public static function phoen_asonfw_add_settings_tab( $settings_tabs ) { $settings_tabs['settings_tab_order_number'] = __( 'Order Number', 'phoen-asonfw' ); return $settings_tabs; } public static function phoen_asonfw_settings_tab (){ woocommerce_admin_fields( self::phoen_asonfw_get_settings() ); } public static function phoen_asonfw_update_settings() { woocommerce_update_options( self::phoen_asonfw_get_settings() ); } public static function phoen_asonfw_get_settings() { $settings = array( 'section_title' => array( 'name' => __( 'Order Number', 'phoen-asonfw' ), 'type' => 'title', 'desc' => '', 'id' => 'wc_settings_order_number_section_title' ), 'enable_plugin' => array( 'name' => __( 'Enable Plugin', 'phoen-asonfw' ), 'type' => 'checkbox', 'default'=>'yes', 'desc' => __( 'Enable', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_enable_plugin' ), 'counter' => array( 'name' => __( 'Counter Type', 'phoen-asonfw' ), 'type' => 'select', 'desc_tip' => __('This is order Choose counter type','phoen-asonfw'), 'desc' => __( 'Choose counter type.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_counter', 'options' => array( 'sequential'=>__('Sequential','phoen-asonfw'), 'random'=>__('Random','phoen-asonfw') ), 'default'=>'Sequential', ), 'order_format' => array( 'name' => __( 'Order Number Format', 'phoen-asonfw' ), 'type' => 'text', 'default'=>'{prefix}{order_number}{suffix}', 'desc_tip' =>__('This is order number format, feel the format like Sample format that given below as like you want.','phoen-asonfw'), 'desc' => __( 'Sample format : {prefix}{suffix}{order_number}.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_order_format', ), 'order_number_width' => array( 'name' => __( 'Order Number Width', 'phoen-asonfw' ), 'type' => 'number', 'custom_attributes' => array( 'step' => '1', 'min' => '0' ), 'min' => '0', 'default'=>'3', 'desc_tip' => __('This is Order Number Width,E.g. set to 4 to have order number displayed as 0001 instead of 1.','phoen-asonfw'), 'desc' => __( 'Fill Order Number Width E.g. set to 4 to have order number displayed as 0001.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_width', ), 'start_order_number' => array( 'name' => __( 'Start From Order Number', 'phoen-asonfw' ), 'type' => 'number', 'default' => '1', 'custom_attributes' => array( 'step' => '1', 'min' => '1' ), 'default'=>'1', 'desc_tip' => __( 'The starting number for the incrementing portion of the order numbers, unless there is an existing order with a higher number.', 'phoen-asonfw' ), 'desc' => __( 'Sample Order Number : #phoen-101-07012020.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_start_order_number' ), 'order_prefix' => array( 'name' => __( 'Order Number Prefix', 'phoen-asonfw' ), 'type' => 'text', 'default'=>'phoen-', 'desc_tip' => __( 'Set a text to be used as prefix in order number. Leave it blank if no prefix has to be used.', 'phoen-asonfw' ), 'desc' => __( 'This is prefix order number- E.g. phoen- or PHOEN-.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_order_prefix' ), 'order_suffix' => array( 'name' => __( 'Order Number Suffix', 'phoen-asonfw' ), 'type' => 'text', 'default'=>'', 'desc_tip' => __( 'Set a text to be used as suffix in order number. Leave it blank if no suffix has to be used.', 'phoen-asonfw' ), 'desc' => __( 'This is suffix order number E.g. order- Or ORDER- etc.', 'phoen-asonfw' ), 'id' => 'wc_settings_order_number_order_suffix' ), 'section_end' => array( 'type' => 'sectionend', 'id' => 'wc_settings_order_number_section_end' ) ); // $orderNum = get_option( 'wc_settings_order_number_order'); // echo $orderNum; return apply_filters( 'wc_settings_tabs_order_number_settings', $settings ); } }