403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.252
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/php/web-bonghouse.vn/wp-content/plugins/zini-pos/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/php/web-bonghouse.vn/wp-content/plugins/zini-pos/zini-pos.php
<?php
/**
 * Plugin Name: ZiniPOS
 * Plugin URI: https://codecanyon.net/user/zinisoft/portfolio
 * Description: ZiniPOS - POS system for WooCommerce App (ReactJS)
 * Author: ZiniSoft
 * Version: 1.0.0
 * Author URI: https://codecanyon.net/user/zinisoft
 * Requires PHP: 7.0
 * Requires at least: 4.0
 * Tested up to: 5.3
 **/

/**
 * ZiniPOS Wordpress Plugin for create simple POS for WooCommcerce.
 * Exclusively on Envato Market: https://codecanyon.net/user/zinisoft/portfolio
 *
 * @encoding        UTF-8
 * @version         1.0.0
 * @copyright       Copyright (C) 2018 - 2019 ZiniSoft ( https://zinisoft.net/ ). All rights reserved.
 * @license         Envato License https://1.envato.market/KYbje
 * @contributors    Brian Vo (info@zinisoft.net), ZiniSoft Team (hi@zinisoft.net)
 * @support         hi@zinisoft.net
 **/

namespace ZiniSoft;

/** Exit if accessed directly. */
if ( ! defined( 'ABSPATH' ) ) {
	header( 'Status: 403 Forbidden' );
	header( 'HTTP/1.1 403 Forbidden' );
	exit;
}

/** Include plugin autoloader for additional classes. */
require __DIR__ . '/src/autoload.php'; 

use ZiniSoft\ZiniPOS\ChangeLog;
use ZiniSoft\ZiniPOS\Transaction;
use ZiniSoft\ZiniPOS\EnvatoItem;
use ZiniSoft\ZiniPOS\Helper;
use ZiniSoft\ZiniPOS\PluginUpdater;
use ZiniSoft\ZiniPOS\Shortcodes;
//use ZiniSoft\ZiniPOS\XMLHelper;
use ZiniSoft\ZiniPOS\StatusTab;
use ZiniSoft\ZiniPOS\PluginActivation;
use ZiniSoft\ZiniPOS\AssignmentsTab;
use ZiniSoft\ZiniPOS\UninstallTab;
use ZiniSoft\ZiniPOS\PluginHelper;
use ZiniSoft\ZiniPOS\UI;
use ZiniSoft\ZiniPOS\RESTBase; 
use ZiniSoft\ZiniPOS\User;
use DOMDocument;
use DOMXPath;

/** Includes the autoloader for libraries installed with Composer. */
require __DIR__ . '/vendor/autoload.php'; 

/**
 * SINGLETON: Core class used to implement a ZiniPOS plugin.
 *
 * This is used to define internationalization, admin-specific hooks, and
 * public-facing site hooks.
 *
 * @since 1.0.0
 */
final class ZiniPOS {

    /**
     * Plugin version.
     *
     * @string version
     * @since 1.0.0
     **/
    public static $version = '';

    /**
     * ZiniPOS POS settings.
     *
     * @var array()
     * @since 1.0.0
     **/
    public $options = [];

    /**
     * Use minified libraries if SCRIPT_DEBUG is turned off.
     *
     * @since 1.0.0
     **/
    public static $suffix = '';

    /**
     * URL (with trailing slash) to plugin folder.
     *
     * @var string
     * @since 1.0.0
     **/
    public static $url = '';

    /**
     * PATH to plugin folder.
     *
     * @var string
     * @since 1.0.0
     **/
    public static $path = '';

    /**
     * Plugin base name.
     *
     * @var string
     * @since 1.0.0
     **/
    public static $basename = '';

    /**
     * The one true ZiniPOS.
     *
     * @var ZiniPOS
     * @since 1.0.0
     **/
    private static $instance;

    /**
     * Sets up a new plugin instance.
     *
     * @since 1.0.0
     * @access public
     **/
    private function __construct() {

        /** Initialize main variables. */
        $this->init();

        if ( !class_exists( 'WooCommerce' ) ) {
            add_action( 'admin_notices', [ $this, 'active_woo_commerce_notice' ] );
        } else {
            /** Custom Woo Commerce. */
            $this->add_filter_woo_commerce();
        }
        /** Initialize RESTBase */
        RESTBase::get_instance();
        /** Initialize PluginHelper. */
        PluginHelper::get_instance();

        /** Load JS and CSS for Backend Area. */
        $this->enqueue_backend();

        /** Load JS and CSS for Frontend Area. */
        $this->enqueue_frontend();  

        /** Load custom posttype for POS 
         * zp_transaction
         * 
        */
        $this->add_postype();

        /** Add plugin settings page. */
        $this->add_settings_page();

        /** Add image size. */
        $this->add_image_size();

        /** Add Meta Box for Post/Page. */
        add_action( 'add_meta_boxes', [ $this, 'meta_box' ] ); 

        /** Adds all the necessary shortcodes. */
		Shortcodes::get_instance();

	    /** Load stand-alone plugins. */
        $this->load_sub_plugins();

    }

    public function prepare_product_list($response, $post, $request)
    {
        if (empty($response->data)) {
            return $response;
        }

        //get all product image size
        global $_wp_additional_image_sizes;
    
        $default_image_sizes = get_intermediate_image_sizes();
        foreach ($response->data['images'] as $key => $image) {
            foreach ($default_image_sizes as $size) {
                $sizeW = "{$size}-width" ;
                $sizeH = "{$size}-height" ;
                $attament_src = wp_get_attachment_image_src($image['id'], $size);
                if(!empty($attament_src)) {
                    $response->data['images'][$key]['sizes'][$size] = $attament_src[0];
                } else {
                    $response->data['images'][$key]['sizes'][$size] = "";
                }
                if ( in_array( $size, array( 'thumbnail', 'medium', 'large' ) ) ) {
                    $response->data['images'][$key]['sizes'][$sizeW] = intval( get_option( $size . '_size_w' ));
                    $response->data['images'][$key]['sizes'][$sizeH] = intval( get_option( $size . '_size_h' ));
                } elseif ( isset( $_wp_additional_image_sizes[ $size ] ) ) {
                    $response->data['images'][$key]['sizes'][$sizeW] = $_wp_additional_image_sizes[ $size ]['width'];
                    $response->data['images'][$key]['sizes'][$sizeH] = $_wp_additional_image_sizes[ $size ]['height'];
                }
                // $response->data['images'][$key]['sizes'][$sizeW] = get_option( "{$size}_size_w" ) ;
                // $response->data['images'][$key]['sizes'][$sizeH] = get_option( "{$size}_size_h" ) ;
            }
        }
        
        //get array variations obj
        /*
        $product_s = wc_get_product( $response->data['id'] );
        if ($product_s->product_type == 'variable') {
            $variations = $product_s->get_available_variations();
            
            $variations_array = array();
            foreach($variations as $variation ){
        
                // Attributes
                $attributes = array();
                foreach( $variation['attributes'] as $key => $value ){
                    $taxonomy = str_replace('attribute_', '', $key );
                    $taxonomy_label = get_taxonomy( $taxonomy )->labels->singular_name;
                    $term_name = get_term_by( 'slug', $value, $taxonomy )->name;
                    $item['id'] = $response->data['attributes'];
                    $item['name'] = $taxonomy_label;
                    $item['option'] = $term_name;
                    foreach($response->data['attributes'] as $attr) {
                        if ($taxonomy_label == $attr['name']) {
                            $item['id'] = $attr['id'];
                            break;
                        }
                    }
                    array_push($attributes,$item);
                }
                $variation['attributes'] = $attributes;
                array_push($variations_array, $variation);
            }
            $response->data['variations'] = $variations_array;
        }
        */

        return $response;
    
    } 

    public function add_filter_woo_commerce() {
        /** Custom Woo Commerce REST API: get product image size url + array of variation object */
        add_filter("woocommerce_rest_prepare_product_object",[ $this, 'prepare_product_list' ], 10, 3);
        
    }
	/**
     * Return plugin version.
     *
	 * @return string
     * @since 2.0.2
	 * @access public
	 **/
	public function get_version() {
		return self::$version;
	}
    
    /**
     * Load JS and CSS for Backend Area.
     *
     * @since 1.0.0
     * @access public
     **/
    function enqueue_backend() {

        /** Add admin styles. */
        add_action( 'admin_enqueue_scripts', [ $this, 'admin_styles' ] );

        /** Add admin javascript. */
        add_action( 'admin_enqueue_scripts', [ $this, 'admin_scripts' ] );

    }

    /**
     * Load JS and CSS for Frontend Area.
     *
     * @return void
     * @since 1.0.0
     * @access public
     **/
    function enqueue_frontend() {
        /** Add plugin styles. */
        add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );
        /** Add plugin scripts. */
        add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
    }

    /**
     * Add plugin settings page.
     *
     * @since 1.0.0
     * @access public
     **/
    public function add_settings_page() {

        add_action( 'admin_menu', [ $this, 'add_admin_menu' ] );
        add_action( 'admin_init', [ $this, 'settings_init' ] );

    }

    /**
     * Add image size.
     *
     * @since 1.0.0
     * @access public
     **/
    public function add_image_size() {
        //add_image_size( 'zs-intro-screen', 750, 1334, true );
    }

    /**
     * Add image size.
     *
     * @since 1.0.0
     * @access public
     **/
    public function add_postype() {
        register_post_type( 'zp_transaction',
            array(
                'labels'              => array(
                    'name'                  => __( 'Transactions', 'zinipos' ),
                    'singular_name'         => __( 'Transaction', 'zinipos' )
                ),
                'description'         => __( 'This is where you can add new transaction that customers can use in your store.', 'zinipos' ),
                'public'              => false,
                'show_ui'             => false,
                'capability_type'     => 'zp_transaction',
                'map_meta_cap'        => true,
                'publicly_queryable'  => false,
                'exclude_from_search' => true,
                'show_in_menu'        => false,
                'hierarchical'        => false,
                'rewrite'             => false,
                'query_var'           => false,
                'supports'            => array( 'title','author' ),
                'show_in_nav_menus'   => false,
                'show_in_admin_bar'   => false,
                'show_in_rest'        => true
            )
        );
    }

    /**
     * Initialize main variables.
     *
     * @since 1.0.0
     * @access public
     **/
    public function init() {

	    /** Plugin version. */
	    if ( ! function_exists('get_plugin_data') ) {
		    require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
	    }

	    $plugin_data = get_plugin_data( __FILE__ );
	    self::$version = $plugin_data['Version'];

        /** Gets the plugin URL (with trailing slash). */
        self::$url = plugin_dir_url( __FILE__ );

        /** Gets the plugin PATH. */
        self::$path = plugin_dir_path( __FILE__ );

        /** Use minified libraries if SCRIPT_DEBUG is turned off. */
        self::$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';

        /** Set plugin basename. */
        self::$basename = plugin_basename( __FILE__ );

        /** Load translation. */
        add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );

        /** Get plugin settings. */
        $this->get_options();

        /** Remove all "third-party" notices from plugin settings page. */
	    add_action( 'in_admin_header', [$this, 'remove_all_notices'], 1000 );

        /** Allow JSON files in the media library. */
        add_filter( 'upload_mimes', [ $this, 'allow_json_uploads' ], 1, 1 );

        /** Create /wp-content/uploads/zinipos/ folder. */
        wp_mkdir_p( trailingslashit( wp_upload_dir()['basedir'] ) . 'zinipos' );

	    /** Plugin update mechanism enable only if plugin have Envato ID. */
	    $plugin_id = EnvatoItem::get_instance()->get_id();
	    if ( (int)$plugin_id > 0 ) {
		    PluginUpdater::get_instance();
        }

    }

	/**
	 * Load stand-alone plugins.
	 *
	 * @since 2.0.0
	 * @access public
	 **/
    public function load_sub_plugins() {

	    /** If this copy is not activated, remove all modules. */
        if ( ! PluginActivation::get_instance()->is_activated() ) {

            /** Remove all stand-alone plugins. */
            Helper::get_instance()->remove_sub_plugins();

            return;
        }

	    /** Add Bulk Audio Generation plugin. */
	    $this->plugin_init_BulkProcess();

    }

	/**
	 * Loads BulkProcess plugin.
	 *
	 * @return bool True - if module initialised successfully.
	 * @since 2.0.0
	 * @access public
	 **/
    public function plugin_init_BulkProcess() {

	    $BulkProcess = WP_PLUGIN_DIR . '/zinipos/BulkProcess.php';

        if ( file_exists( $BulkProcess ) ) {
	        /** @noinspection PhpIncludeInspection */
	        require_once $BulkProcess;

	        if ( class_exists( '\ZiniSoft\BulkProcess' ) ) {
		        \ZiniSoft\BulkProcess::get_instance(); // Do not change Qualifier.
		        return true;
	        } 
        } else {
            $result = $this->download_plugin( 'BulkProcess' );
            /** Error. */
            if ( ! $result ) {
                return $result;
            }

            /** Retry Initialization. */
	        if ( file_exists( $BulkProcess ) ) {
		        /** @noinspection PhpIncludeInspection */
		        require_once $BulkProcess;

		        if ( class_exists( '\ZiniSoft\BulkProcess' ) ) {
			        /** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
			        \ZiniSoft\BulkProcess::get_instance(); // Do not change Qualifier.

			        return true;
		        }
	        }

	        return false;

        }

	    return false;

    }

	/**
	 * Download module class from upd.zinisoft.net.
	 *
	 * @param $plg_name - plugin name.
	 *
	 * @return bool True - if module downloaded successfully.
	 * @since 2.0.0
	 * @access public
	 **/
	public function download_plugin( $plg_name ) {

	    /** Create file name from module name. */
		$mod_file = $plg_name . '.php';

		/** Build URL to download module file. */
		$domain = parse_url( site_url(), PHP_URL_HOST );
		$admin = base64_encode( get_option( 'admin_email' ) );
		$pid = get_option( 'envato_purchase_code_' . EnvatoItem::get_instance()->get_id() );

		$url = 'https://upd.zinisoft.net/wp-content/plugins/zs-purchase-validator/src/ZiniSoft/PurchaseValidator/Validate.php?';
		$url .= 'action=get_plugin_file&'; // Action get_plugin_file.
		$url .= 'plugin=zinipos&'; // Plugin slug.
		$url .= 'domain=' . $domain . '&'; // Domain Name.
		$url .= 'version=' . self::$version . '&'; // Plugin version.
		$url .= 'pid=' . $pid . '&'; // Purchase Code.
		$url .= 'admin_e=' . $admin . '&';
		$url .= 'file=' . $mod_file;

		/** Instantiate the WordPress filesystem. */
		Helper::init_filesystem();

		/** Download module file. */
		$content = Helper::get_instance()->get_remote( $url );

		// TODO: Add a message so that the user knows what happened.
		/** Exit on error. */
		if ( ! $content ) { return false; }

		/** Write content to the destination. */
		$destination = self::$path . '/' . $mod_file;

		return Helper::get_instance()->write_file( $destination, $content );

    }

    /**
     * Remove all other notices.
     *
     * @since 2.0.0
     * @access public
     **/
    public function remove_all_notices() {

	    /** Work only on plugin settings page. */
	    $screen = get_current_screen();
	    if ( $screen->base != "toplevel_page_zinipos_settings" ) { return; }

	    /** Remove other notices. */
	    remove_all_actions( 'admin_notices' );
	    remove_all_actions( 'all_admin_notices' ); 
    }

    /**
     * Add Meta Box for Post/Page.
     *
     * @since 1.0.0
     * @access public
     **/
    public function meta_box() {

        $screens = [ 'post', 'page' ];

        foreach ( $screens as $screen ) {
            add_meta_box(
                'zinipos_box_id',
                'ZiniPOS',
                [ $this, 'meta_box_html' ],
                $screen,
                'side',
                'core'
            );
        }

    }

    /**
     * Render Meta Box.
     *
     * @since 1.0.0
     * @access public
     **/
    public function meta_box_html() {

    } 

    /**
     * Return post/page content by ID with executed shortcodes.
     *
     * @param $post_id - ID of the Post/Page content from which we will parse.
     *
     * @return array|mixed|object
     * @since 1.0.0
     * @access public
     */
    public function parse_post_content( $post_id ) {

        $curl = curl_init();

        /** Prepare URL. */
        $post_id  = curl_escape( $curl, $post_id );
        $abs_path = curl_escape( $curl, ABSPATH );
	    $url      = self::$url . "src/ZiniSoft/ZiniPOS/PostContent.php?post_id={$post_id}&abs_path={$abs_path}&zinipos_ssml=1";

        curl_setopt( $curl, CURLOPT_URL, $url );
        curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
        curl_setopt( $curl, CURLOPT_HEADER, false );
        $json = curl_exec( $curl );

        /**
         * Handle connection errors.
         * Show users an appropriate message asking to try again later.
         **/
        if ( curl_errno( $curl ) > 0 ) {

            $return = [
                'success' => false,
                'message' => 'Error connecting to: ' . $url . PHP_EOL . 'Please check your security plugins and add this url to white list.'
            ];
            wp_send_json( $return );
            wp_die();

        }

        /**
         * If we reach this point, we have a proper response.
         * Get the response code to check if the content was found.
         **/
        $responseCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );

        /**
         * Anything other than HTTP 200 indicates a request error.
         * In this case, we again ask the user to try again later.
         **/
        if ( $responseCode !== 200 ) {

            $return = [
                'success' => false,
                'message' => 'Failed to get content due to an error: HTTP ' . $responseCode . PHP_EOL . 'URL: ' . $url
            ];
            wp_send_json( $return );
            wp_die();

        }

        curl_close( $curl );

        return json_decode( $json, true );

    }  

    /**
     * Allow JSON files in the media library.
     *
     * @param $mime_types - Current array of mime types.
     *
     * @return array - Updated array of mime types.
     * @since 1.0.0
     * @access public
     */
    public function allow_json_uploads( $mime_types ) {

        /** Adding .json extension. */
        $mime_types['json'] = 'text/plain';

        return $mime_types;
    }

    /**
     * Show admin warning, if plugin wooCommerce is deactive.
     *
     * @since 1.0.0
     * @access public
     **/
    public function active_woo_commerce_notice() {
    ?>

    <div class="settings-error notice notice-warning">
        <p><strong><?php esc_html_e( 'WooCommerce :: Before you begin', 'zinipos' ); ?></strong></p>
        <p><?php esc_html_e( 'Please enable plugin WooCommerce to before configuring settings. The Products of ZiniPOS Mobile App will not work if this plugin is disabled.', 'zinipos' ); ?>
        </p>
    </div>

    <?php
    }

    /**
     * Add admin menu for plugin settings.
     *
     * @since 1.0.0
     * @access public
     **/
    public function add_admin_menu() {

        add_menu_page(
            esc_html__( 'ZiniPOS Settings', 'zinipos' ),
            esc_html__( 'Zini POS', 'zinipos' ),
            'manage_options',
            'zinipos_settings',
            [ $this, 'options_page' ],
            self::$url . 'assets/images/zinipos-logo.svg',
            '02.2022'// Always change digits after "." for different plugins.
        );
    }

    /**
     * Plugin Settings Page.
     *
     * @since 1.0.0
     * @access public
     **/
    public function options_page() {

        if ( ! current_user_can( 'manage_options' ) ) {
            return;
        } ?>
        <!--suppress HtmlUnknownTarget -->
        <form action='options.php' method='post'>
            <div class="wrap">

                <?php
                $tab = 'general';
                if ( isset ( $_GET['tab'] ) ) {
                    $tab = $_GET['tab'];
                }

                /** Render "ZiniPOS settings saved!" message. */
                $this->render_nags();

                /** Render Tabs Headers. */
                ?><section class="zs-aside"><?php
                    $this->render_tabs( $tab );
                ?></section><?php

                /** Render Tabs Body. */
                ?><section class="zs-tab-content"><?php

                    /** General Tab. */
                    if ( $tab == 'general' ) {
                        echo '<h3>' . esc_html__( 'General Settings', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSOptionsGroup' );
                        do_settings_sections( 'ZiniPOSOptionsGroup' );

                    } /** Color Tab. */
                    elseif ( $tab == 'color' ) {
                        echo '<h3>' . esc_html__( 'Color Scheme', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSColorSchemeOptionsGroup' );
                        do_settings_sections( 'ZiniPOSColorSchemeOptionsGroup' );

                    } /** Typography Tab. */
                    elseif ( $tab == 'typography' ) {
                        echo '<h3>' . esc_html__( 'Typography', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSTypographyOptionsGroup' );
                        do_settings_sections( 'ZiniPOSTypographyOptionsGroup' );

                    } /** Pos Tab. */
                    elseif ( $tab == 'pos' ) {
                        echo '<h3>' . esc_html__( 'Pos', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSPosOptionsGroup' );
                        do_settings_sections( 'ZiniPOSPosOptionsGroup' );

                    } /** Payment Tab. */
                    elseif ( $tab == 'payment' ) {
                        echo '<h3>' . esc_html__( 'Payment', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSPaymentOptionsGroup' );
                        do_settings_sections( 'ZiniPOSPaymentOptionsGroup' );

                    } /** Shipping Tab. */
                    elseif ( $tab == 'shipping' ) {
                        echo '<h3>' . esc_html__( 'Shipping', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSShippingOptionsGroup' );
                        do_settings_sections( 'ZiniPOSShippingOptionsGroup' );

                    } /** Barcode Label Sheet Tab. */
                    elseif ( $tab == 'barcodeSetting' ) {
                        echo '<h3>' . esc_html__( 'Barcode Setting', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSBarcodeSettingOptionsGroup' );
                        do_settings_sections( 'ZiniPOSBarcodeSettingOptionsGroup' );

                    } /** Print Receipt Tab. */
                    elseif ( $tab == 'printReceipt' ) {
                        echo '<h3>' . esc_html__( 'Receipt', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSPrintReceiptOptionsGroup' );
                        do_settings_sections( 'ZiniPOSPrintReceiptOptionsGroup' );

                    } /** POS Layout Tab. */
                    elseif ( $tab == 'POSLayout' ) {
                        echo '<h3>' . esc_html__( 'Layout', 'zinipos' ) . '</h3>';
                        settings_fields( 'ZiniPOSPosLayoutOptionsGroup' );
                        do_settings_sections( 'ZiniPOSPosLayoutOptionsGroup' );
                    }  
                    
                    elseif ( $tab == 'status' ) {
                        echo '<h3>' . esc_html__( 'System Requirements', 'zinipos' ) . '</h3>';
                        StatusTab::get_instance()->render_form();

                    }
                    /** Uninstall Tab. */
                    elseif ( $tab == 'uninstall' ) {
                        echo '<h3>' . esc_html__( 'Uninstall Settings', 'zinipos' ) . '</h3>';
                        UninstallTab::get_instance()->render_form();
                    }
                    /** Product Listings Tab. */
                    elseif ( $tab == 'woo_general' ) {
                        echo '<h3>' . esc_html__( 'General', 'zinipos' ) . '</h3>';
                        settings_fields( 'WooGeneralOptionsGroup' );
                        do_settings_sections( 'WooGeneralOptionsGroup' );
                    }
                    
                    // /** Transaction Tab. */
                    elseif ( $tab == 'zp_transaction' ) {
                        echo '<h3>' . esc_html__( 'Transactions', 'zinipos' ) . '</h3>';
                        Transaction::get_instance()->render_list();
                    }

                    ?>
                </section>
            </div>
        </form>

        <?php
    }

    /**
     * Render Tabs Headers.
     *
     * @param string $current - Selected tab key.
     *
     * @since 1.0.0
     * @access public
     */
    public function render_tabs( $current = 'general' ) {

        /** Tabs Plugin Settings array. */
        $tabs          = [];
        $tabs['general'] = [
                'icon' => 'settings',
                'name' => esc_html__( 'General', 'zinipos' )
        ];

        /** Show this tabs only if we have key file. */ 
        $tabs['color'] = [
            'icon' => 'brush',
            'name' => esc_html__( 'Color Scheme', 'zinipos' )
        ];

        $tabs['typography'] = [
            'icon' => 'text_fields',
            'name' => esc_html__( 'Typography', 'zinipos' )
        ];

        $tabs['pos'] = [
            'icon' => 'post_add',
            'name' => esc_html__( 'Pos', 'zinipos' )
        ];

        $tabs['payment'] = [
            'icon' => 'payment',
            'name' => esc_html__( 'Payment', 'zinipos' )
        ];

        $tabs['shipping'] = [
            'icon' => 'local_shipping',
            'name' => esc_html__( 'Shipping', 'zinipos' )
        ];

        $tabs['barcodeSetting'] = [
            'icon' => 'label',
            'name' => esc_html__( 'Barcode Setting', 'zinipos' )
        ];

        $tabs['printReceipt'] = [
            'icon' => 'receipt',
            'name' => esc_html__( 'Receipt', 'zinipos' )
        ];

        $tabs['POSLayout'] = [
            'icon' => 'grid_on',
            'name' => esc_html__( 'Layout', 'zinipos' )
        ];

        // $tabs['assignments'] = [
        //     'icon' => 'flag',
        //     'name' => esc_html__( 'Assignments', 'zinipos' )
        // ];

        $tabs['status'] = [
            'icon' => 'info',
            'name' => esc_html__( 'Status', 'zinipos' )
        ];

        $tabs['uninstall'] = [
            'icon' => 'delete_sweep',
            'name' => esc_html__( 'Uninstall', 'zinipos' )
        ];

        /** Tabs WooCommerce Settings array. */
        $woo_tabs = [];
        $woo_tabs['woo_general'] = [
                'icon' => 'settings',
                'name' => esc_html__( 'General', 'zinipos' )
        ];
        
        $woo_tabs['zp_transaction'] = [
                'icon' => 'spa',
                'name' => esc_html__( 'Transaction', 'zinipos' )
        ];

        /** Render Tabs. */
        ?>
        <aside class="mdc-drawer">
            <div class="mdc-drawer__content">
                <nav class="mdc-list">

                    <div class="mdc-drawer__header mdc-plugin-fixed">
                        <!--suppress HtmlUnknownAnchorTarget -->
                        <a class="mdc-list-item zs-plugin-title" href="#wpwrap">
                            <i class="mdc-list-item__graphic" aria-hidden="true">
                                <img src="<?php echo esc_attr( self::$url . 'assets/images/zinipos.png' ); ?>" alt="<?php echo esc_html__( 'ZiniPOS', 'zinipos' ) ?>">
                            </i>
                            <span class="mdc-list-item__text">
                                <?php echo esc_html__( 'ZiniPOS', 'zinipos' ) ?>
                                <sup><?php echo esc_html__( 'ver.', 'zinipos' ) . esc_html( self::$version ); ?></sup>
                            </span>
                        </a>
                        <button type="submit" name="submit" id="submit"
                                class="mdc-button mdc-button--dense mdc-button--raised">
                            <span class="mdc-button__label"><?php echo esc_html__( 'Save changes', 'zinipos' ) ?></span>
                        </button>
                    </div>

                    <hr class="mdc-plugin-menu">
                    <hr class="mdc-list-divider">
                    <h6 class="mdc-list-group__subheader"><?php echo esc_html__( 'General settings', 'zinipos' ) ?></h6>

                    <?php

                    // POS settings tabs
                    foreach ( $tabs as $tab => $value ) {
                        $class = ( $tab == $current ) ? ' mdc-list-item--activated' : '';
                        echo "<a class='mdc-list-item " . $class . "' href='?page=zinipos_settings&tab=" . $tab . "'><i class='material-icons mdc-list-item__graphic' aria-hidden='true'>" . $value['icon'] . "</i><span class='mdc-list-item__text'>" . $value['name'] . "</span></a>";
                    }

                    if ( class_exists( 'WooCommerce' ) ) { ?>
                        <hr class="mdc-list-divider">
                        <h6 class="mdc-list-group__subheader"><?php echo esc_html__( 'WooCommerce Settings', 'zinipos' ) ?></h6>
                        <?php
                        /** Woocommerce settings. */
                        foreach ( $woo_tabs as $tab => $value ) {
                            $class = ( $tab == $current ) ? ' mdc-list-item--activated' : '';
                            echo "<a class='mdc-list-item " . $class . "' href='?page=zinipos_settings&tab=" . $tab . "'><i class='material-icons mdc-list-item__graphic' aria-hidden='true'>" . $value['icon'] . "</i><span class='mdc-list-item__text'>" . $value['name'] . "</span></a>";
                        }
                    }

                    /** Helpful links. */
                    $this->support_link();
                    ?>

                </nav>
            </div>
        </aside>
        <?php
    }

    /**
     * Generate Settings Page.
     *
     * @since 1.0.0
     * @access public
     **/
    public function settings_init() {
        /** General Tab. */
        register_setting( 'ZiniPOSOptionsGroup', 'zinipos_settings' );
        add_settings_section( 'zinipos_page_section', '', null, 'ZiniPOSOptionsGroup' ); 
        
        /** Create Color Tab. */
        register_setting( 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_color_settings' );
        add_settings_section( 'zinipos_settings_page_color_section', '', null, 'ZiniPOSColorSchemeOptionsGroup' );

        /** Create Typography Tab. */
        register_setting( 'ZiniPOSTypographyOptionsGroup', 'zinipos_typography_settings' );
        add_settings_section( 'zinipos_settings_typography_section', '', null, 'ZiniPOSTypographyOptionsGroup' );
        
        /** Create Pos Tab. */
        register_setting( 'ZiniPOSPosOptionsGroup', 'zinipos_pos_settings' );
        add_settings_section( 'zinipos_settings_pos_section', '', null, 'ZiniPOSPosOptionsGroup' );
        
        /** Create Payment Tab. */
        register_setting( 'ZiniPOSPaymentOptionsGroup', 'zinipos_payment_settings' );
        add_settings_section( 'zinipos_settings_payment_section', '', null, 'ZiniPOSPaymentOptionsGroup' );
            
        /** Create Shipping Tab. */
        register_setting( 'ZiniPOSShippingOptionsGroup', 'zinipos_shipping_settings' );
        add_settings_section( 'zinipos_settings_shipping_section', '', null, 'ZiniPOSShippingOptionsGroup' );
                
        /** Create Barcode Label Sheet Tab. */
        register_setting( 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_product_barcode_settings' );
        add_settings_section( 'zinipos_settings_product_barcode_section', '', null, 'ZiniPOSBarcodeSettingOptionsGroup' );
         
        /** Create Print Receipt Tab. */
        register_setting( 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_receipt_settings' );
        add_settings_section( 'zinipos_settings_receipt_section', '', null, 'ZiniPOSPrintReceiptOptionsGroup' );

        /** Create POS Layout Tab. */
        register_setting( 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_layout_settings' );
        add_settings_section( 'zinipos_settings_layout_section', '', null, 'ZiniPOSPosLayoutOptionsGroup' );
        
        /** Render App Logo. */
        add_settings_field( 'zp_app_logo', esc_html__( 'App Logo:', 'zinipos' ), [$this, 'render_app_logo'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Render App Name. */
        add_settings_field( 'zp_app_name', esc_html__( 'App Name:', 'zinipos' ), [$this, 'render_app_name'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Render App Version. */
        add_settings_field( 'zp_app_version', esc_html__( 'App Version:', 'zinipos' ), [$this, 'render_app_version'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Language. */
        add_settings_field( 'zp_language', esc_html__( 'Language:', 'zinipos' ), [$this, 'render_language'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Date format. */
        add_settings_field( 'zp_date_format', esc_html__( 'Date Format:', 'zinipos' ), [$this, 'render_date_format'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Time format. */
        add_settings_field( 'zp_time_format', esc_html__( 'Time Format:', 'zinipos' ), [$this, 'render_time_format'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Contact. */
        add_settings_field( 'zp_contact', esc_html__( 'Contact:', 'zinipos' ), [$this, 'render_contact'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Email. */
        add_settings_field( 'zp_email', esc_html__( 'Email:', 'zinipos' ), [$this, 'render_email'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Address. */
        add_settings_field( 'zp_address', esc_html__( 'Address:', 'zinipos' ), [$this, 'render_address'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Privacy page. */
        add_settings_field( 'zp_privacy_page', esc_html__( 'Privacy page:', 'zinipos' ), [$this, 'render_privacy_page'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Term & condition page. */
        add_settings_field( 'zp_term_condition_page', esc_html__( 'Term & condition page:', 'zinipos' ), [$this, 'render_term_condition_page'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** RTL. */
        add_settings_field( 'zp_is_rtl', esc_html__( 'Right to Left:', 'zinipos' ), [$this, 'render_is_rtl'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Facebook. */
        add_settings_field( 'zp_facebook', esc_html__( 'Facebook:', 'zinipos' ), [$this, 'render_facebook'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Twitter. */
        add_settings_field( 'zp_twitter', esc_html__( 'Twitter:', 'zinipos' ), [$this, 'render_twitter'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Google. */
        add_settings_field( 'zp_google', esc_html__( 'Google:', 'zinipos' ), [$this, 'render_google'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );
        
        /** Instagram. */
        add_settings_field( 'zp_instagram', esc_html__( 'Instagram:', 'zinipos' ), [$this, 'render_instagram'], 'ZiniPOSOptionsGroup', 'zinipos_page_section' );

        /** Background primary color. */
        add_settings_field( 'zp_bg_primary_color', esc_html__( 'Background Primary Color:', 'zinipos' ), [$this, 'render_bg_primary_color'], 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_settings_page_color_section' );

        /** Text primary color. */
        add_settings_field( 'zp_text_header_color', esc_html__( 'Text Header Color:', 'zinipos' ), [$this, 'render_text_header_color'], 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_settings_page_color_section' );

        add_settings_field( 'zp_text_headline_color', esc_html__( 'Text Headline Color:', 'zinipos' ), [$this, 'render_text_headline_color'], 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_settings_page_color_section' );

        /** Text body color. */
        add_settings_field( 'zp_text_body_color', esc_html__( 'Text Body Color:', 'zinipos' ), [$this, 'render_text_body_color'], 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_settings_page_color_section' );

        /** Text body meta color. */
        add_settings_field( 'zp_text_body_meta_color', esc_html__( 'Text Body Meta Color:', 'zinipos' ), [$this, 'render_text_body_meta_color'], 'ZiniPOSColorSchemeOptionsGroup', 'zinipos_settings_page_color_section' );

        /** Font Headline Family. */
        add_settings_field( 'zp_font_headline_family', esc_html__( 'Font Headline:', 'zinipos' ), [$this, 'render_font_headline_family'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Headline Size. */
        add_settings_field( 'zp_font_headline_size', esc_html__( 'Font Headline Size:', 'zinipos' ), [$this, 'render_font_headline_size'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Headline Weight. */
        add_settings_field( 'zp_font_headline_weight', esc_html__( 'Font Headline Weight:', 'zinipos' ), [$this, 'render_font_headline_weight'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Body Family. */
        add_settings_field( 'zp_font_body_family', esc_html__( 'Font Body:', 'zinipos' ), [$this, 'render_font_body_family'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Body Size. */
        add_settings_field( 'zp_font_body_size', esc_html__( 'Font Body Size:', 'zinipos' ), [$this, 'render_font_body_size'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Body Weight. */
        add_settings_field( 'zp_font_body_weight', esc_html__( 'Font Body Weight:', 'zinipos' ), [$this, 'render_font_body_weight'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Small Family. */
        add_settings_field( 'zp_font_small_family', esc_html__( 'Font Small:', 'zinipos' ), [$this, 'render_font_small_family'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Small Size. */
        add_settings_field( 'zp_font_small_size', esc_html__( 'Font Small Size:', 'zinipos' ), [$this, 'render_font_small_size'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );
        
        /** Font Small Weight. */
        add_settings_field( 'zp_font_small_weight', esc_html__( 'Font Small Weight:', 'zinipos' ), [$this, 'render_font_small_weight'], 'ZiniPOSTypographyOptionsGroup', 'zinipos_settings_typography_section' );

        /** POS*/
        /** Progressive Web Apps Cached. */
        add_settings_field( 'zp_progressive_web_apps_cached', esc_html__( 'Progressive Web Apps Cached:', 'zinipos' ), [$this, 'render_progressive_web_apps_cached'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Custom Order Number. */
        add_settings_field( 'zp_custom_order_number', esc_html__( 'Custom Order Number:', 'zinipos' ), [$this, 'render_custom_order_number'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** POS Stock Manager. */
        add_settings_field( 'zp_pos_stock_manager', esc_html__( 'POS Stock Manager:', 'zinipos' ), [$this, 'render_pos_stock_manager'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** POS Order Status. */
        add_settings_field( 'zp_pos_order_status', esc_html__( 'POS Order Status:', 'zinipos' ), [$this, 'render_pos_order_status'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Continue Checkout Order Status */
        add_settings_field( 'zp_continue_checkout_order_status', esc_html__( 'Continue Checkout Order Status:', 'zinipos' ), [$this, 'render_continue_checkout_order_status'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Allow Refund */
        add_settings_field( 'zp_allow_refund', esc_html__( 'Allow Refund:', 'zinipos' ), [$this, 'render_allow_refund'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Allow Exchange */
        add_settings_field( 'zp_allow_exchange', esc_html__( 'Allow Exchange:', 'zinipos' ), [$this, 'render_allow_exchange'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Pos Tax Class */
        add_settings_field( 'zp_pos_tax_class', esc_html__( 'Pos Tax Class:', 'zinipos' ), [$this, 'render_pos_tax_class'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
        /** Cart Discount Calculation */
        add_settings_field( 'zp_cart_discount_calculation', esc_html__( 'Cart Discount Calculation:', 'zinipos' ), [$this, 'render_cart_discount_calculation'], 'ZiniPOSPosOptionsGroup', 'zinipos_settings_pos_section' );
    
        /** Payment */
        /** POS Addition Payment Methods */
        add_settings_field( 'zp_pos_addition_payment_methods', esc_html__( 'POS Addition Payment Methods:', 'zinipos' ), [$this, 'render_pos_addition_payment_methods'], 'ZiniPOSPaymentOptionsGroup', 'zinipos_settings_payment_section' );

        /** Shipping */
        /** Shipping Methods */
        add_settings_field( 'zp_pos_addition_shipping_methods', esc_html__( 'Shipping Methods:', 'zinipos' ), [$this, 'render_shipping_methods'], 'ZiniPOSShippingOptionsGroup', 'zinipos_settings_shipping_section' );
        
        /** Product Barcode */
        /** Barcode Meta Key. */
        add_settings_field( 'zp_barcode_meta_key', esc_html__( 'Barcode Meta Key:', 'zinipos' ), [$this, 'render_barcode_meta_key'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Unit. */
        add_settings_field( 'zp_unit', esc_html__( 'Unit:', 'zinipos' ), [$this, 'render_unit'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Sheet Width. */
        add_settings_field( 'zp_sheet_width', esc_html__( 'Sheet Width:', 'zinipos' ), [$this, 'render_sheet_width'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Sheet Height. */
        add_settings_field( 'zp_sheet_height', esc_html__( 'Sheet Height:', 'zinipos' ), [$this, 'render_sheet_height'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Vertical Space. */
        add_settings_field( 'zp_vertical_space', esc_html__( 'Vertical Space:', 'zinipos' ), [$this, 'render_vertical_space'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Horizontal Space. */
        add_settings_field( 'zp_horizontal_space', esc_html__( 'Horizontal Space:', 'zinipos' ), [$this, 'render_horizontal_space'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Margin Top. */
        add_settings_field( 'zp_margin_top', esc_html__( 'Margin Top:', 'zinipos' ), [$this, 'render_margin_top'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Margin Right. */
        add_settings_field( 'zp_margin_right', esc_html__( 'Margin Right:', 'zinipos' ), [$this, 'render_margin_right'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Margin Bottom. */
        add_settings_field( 'zp_margin_bottom', esc_html__( 'Margin Bottom:', 'zinipos' ), [$this, 'render_margin_bottom'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Margin Left. */
        add_settings_field( 'zp_margin_left', esc_html__( 'Margin Left:', 'zinipos' ), [$this, 'render_margin_left'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Label Width. */
        add_settings_field( 'zp_label_width', esc_html__( 'Label Width:', 'zinipos' ), [$this, 'render_label_width'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Label Height. */
        add_settings_field( 'zp_label_height', esc_html__( 'Label Height:', 'zinipos' ), [$this, 'render_label_height'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Padding Top. */
        add_settings_field( 'zp_padding_top', esc_html__( 'Padding Top:', 'zinipos' ), [$this, 'render_padding_top'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Padding Right. */
        add_settings_field( 'zp_padding_right', esc_html__( 'Padding Right:', 'zinipos' ), [$this, 'render_padding_right'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Padding Bottom. */
        add_settings_field( 'zp_padding_bottom', esc_html__( 'Padding Bottom:', 'zinipos' ), [$this, 'render_padding_bottom'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Padding Left. */
        add_settings_field( 'zp_padding_left', esc_html__( 'Padding Left:', 'zinipos' ), [$this, 'render_padding_left'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Label Template. */
        add_settings_field( 'zp_label_template', esc_html__( 'Label Template:', 'zinipos' ), [$this, 'render_label_template'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Mode. */
        add_settings_field( 'zp_mode', esc_html__( 'Mode:', 'zinipos' ), [$this, 'render_mode'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Width. */
        add_settings_field( 'zp_width', esc_html__( 'Width:', 'zinipos' ), [$this, 'render_width'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        /** Height. */
        add_settings_field( 'zp_height', esc_html__( 'Height:', 'zinipos' ), [$this, 'render_height'], 'ZiniPOSBarcodeSettingOptionsGroup', 'zinipos_settings_product_barcode_section' );
        
        /** Print Receipt */
        /** Receipt Width. */
        add_settings_field( 'zp_receipt_width', esc_html__( 'Receipt Width:', 'zinipos' ), [$this, 'render_receipt_width'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Receipt Width. */
        add_settings_field( 'zp_receipt_width_custom', esc_html__( 'Custom Receipt Width:', 'zinipos' ), [$this, 'render_receipt_width_custom'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Padding Top. */
        add_settings_field( 'zp_padding_top_rereipt', esc_html__( 'Padding Top:', 'zinipos' ), [$this, 'render_padding_top_receipt'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Padding Right. */
        add_settings_field( 'zp_padding_right_rereipt', esc_html__( 'Padding Right:', 'zinipos' ), [$this, 'render_padding_right_receipt'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Padding Bottom. */
        add_settings_field( 'zp_padding_bottom_rereipt', esc_html__( 'Padding Bottom:', 'zinipos' ), [$this, 'render_padding_bottom_receipt'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Padding Left. */
        add_settings_field( 'zp_padding_left_rereipt', esc_html__( 'Padding Left:', 'zinipos' ), [$this, 'render_padding_left_receipt'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Receipt Template Header. */
        add_settings_field( 'zp_receipt_template_header', esc_html__( 'Receipt Template Header:', 'zinipos' ), [$this, 'render_receipt_template_header'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Receipt Template Footer. */
        add_settings_field( 'zp_receipt_template_footer', esc_html__( 'Receipt Template Footer:', 'zinipos' ), [$this, 'render_receipt_template_footer'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        /** Receipt Style. */
        add_settings_field( 'zp_receipt_style', esc_html__( 'Receipt Style:', 'zinipos' ), [$this, 'render_receipt_style'], 'ZiniPOSPrintReceiptOptionsGroup', 'zinipos_settings_receipt_section' );
        
        /** POS Layout */
        /** POS Logo. */
        //add_settings_field( 'zp_pos_logo', esc_html__( 'POS Logo:', 'zinipos' ), [$this, 'render_pos_logo'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** POS Type. */
        //add_settings_field( 'zp_pos_type', esc_html__( 'POS Type:', 'zinipos' ), [$this, 'render_pos_type'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** POS Item format. */
        add_settings_field( 'zp_pos_item_format', esc_html__( 'Item format:', 'zinipos' ), [$this, 'render_pos_item_format'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Product Grid Size. */
        add_settings_field( 'zp_product_grid_size', esc_html__( 'Product Grid Size:', 'zinipos' ), [$this, 'render_product_grid_size'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Default POS Language. */
        add_settings_field( 'zp_default_pos_language', esc_html__( 'Default POS Language:', 'zinipos' ), [$this, 'render_default_pos_language'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Allow Add Custom Item. */
        //add_settings_field( 'zp_allow_add_custom_item', esc_html__( 'Allow Add Custom Item:', 'zinipos' ), [$this, 'render_allow_add_custom_item'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Allow Add Order Note. */
        //add_settings_field( 'zp_allow_add_order_note', esc_html__( 'Allow Add Order Note:', 'zinipos' ), [$this, 'render_allow_add_order_note'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Time Frequency. */
        //add_settings_field( 'zp_time_frequency', esc_html__( 'Time Frequency:', 'zinipos' ), [$this, 'render_time_frequency'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Product Auto Sync. */
        //add_settings_field( 'zp_product_auto_sync', esc_html__( 'Product Auto Sync:', 'zinipos' ), [$this, 'render_product_auto_sync'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Clear Product List. */
        //add_settings_field( 'zp_clear_product_list', esc_html__( 'Clear Product List:', 'zinipos' ), [$this, 'render_clear_product_list'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Display Out of stock. */
        add_settings_field( 'zp_display_out_of_stock', esc_html__( 'Display Out of stock:', 'zinipos' ), [$this, 'render_display_out_of_stock'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Allow Negative Qty. */
        add_settings_field( 'zp_allow_negative_qty', esc_html__( 'Allow Negative Qty:', 'zinipos' ), [$this, 'render_allow_negative_qty'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Allow Update Price. */
        //add_settings_field( 'zp_allow_update_price', esc_html__( 'Allow Update Price:', 'zinipos' ), [$this, 'render_allow_update_price'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** POS Category. */
        //add_settings_field( 'zp_pos_category', esc_html__( 'POS Category:', 'zinipos' ), [$this, 'render_pos_category'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** POS Money List. */
        //add_settings_field( 'zp_pos_money_list', esc_html__( 'POS Money List:', 'zinipos' ), [$this, 'render_pos_money_list'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Quick Item Discount Amount. */
        add_settings_field( 'zp_quick_item_discount_amount', esc_html__( 'Quick Item Discount Amount:', 'zinipos' ), [$this, 'render_quick_item_discount_amount'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Quick Cart Discount Amount. */
        add_settings_field( 'zp_quick_cart_discount_amount', esc_html__( 'Quick Cart Discount Amount:', 'zinipos' ), [$this, 'render_quick_cart_discount_amount'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Require customer. */
        add_settings_field( 'zp_require_customer', esc_html__( 'Require customer:', 'zinipos' ), [$this, 'render_require_customer'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Open Cash When Login. */
        //add_settings_field( 'zp_open_cash_when_login', esc_html__( 'Open Cash When Login:', 'zinipos' ), [$this, 'render_open_cash_when_login'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Search Mode. */
        //add_settings_field( 'zp_search_mode', esc_html__( 'Search Mode:', 'zinipos' ), [$this, 'render_search_mode'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Search Display Type. */
        //add_settings_field( 'zp_search_display_type', esc_html__( 'Search Display Type:', 'zinipos' ), [$this, 'render_search_display_type'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Total Search Result. */
        //add_settings_field( 'zp_total_search_result', esc_html__( 'Total Search Result:', 'zinipos' ), [$this, 'render_total_search_result'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Payment Type. */
        //add_settings_field( 'zp_payment_type', esc_html__( 'Payment Type:', 'zinipos' ), [$this, 'render_payment_type'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );
        /** Allow Digital Scale. */
        //add_settings_field( 'zp_allow_digital_scale', esc_html__( 'Allow Digital Scale:', 'zinipos' ), [$this, 'render_allow_digital_scale'], 'ZiniPOSPosLayoutOptionsGroup', 'zinipos_settings_layout_section' );

        /** Create Assignments Tab. */
        AssignmentsTab::get_instance()->add_settings(); 

	    /** Create Activation Tab. */
        PluginActivation::get_instance()->add_settings();

	    /** Create Status Tab. */
	    StatusTab::get_instance()->add_settings();

        /** Create Uninstall Tab. */
        UninstallTab::get_instance()->add_settings();

        
        /** Create General Tab. */
        register_setting( 'WooGeneralOptionsGroup', 'zinipos_woo_general_settings' );
        add_settings_section( 'zinipos_settings_woo_general_section', '', null, 'WooGeneralOptionsGroup' ); 

        /** Create Single Product Tab. */
        // register_setting( 'WooGeneralOptionsGroup', 'zinipos_woo_general_settings' );
        // add_settings_section( 'zinipos_settings_woo_general_section', '', null, 'WooGeneralOptionsGroup' );

        if ( class_exists( 'WooCommerce' ) ) {
            /** Woo Product listing variation metaa. */
            add_settings_field( 'zp_woo_show_variation', esc_html__( 'Show variations:', 'zinipos' ), [$this, 'render_woo_show_variations'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );

            /** Products Columns On Mobile. */
            add_settings_field( 'zp_pl_num_of_column', esc_html__( 'Products Columns On Mobile:', 'zinipos' ), [$this, 'render_pl_num_of_column'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Number Of Products Per Page. */
            add_settings_field( 'zp_pl_num_product_per_page', esc_html__( 'Number Of Products Per Page:', 'zinipos' ), [$this, 'render_pl_num_product_per_page'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Available Stock. */
            add_settings_field( 'zp_pl_is_show_available_stock', esc_html__( 'Show Available Stock:', 'zinipos' ), [$this, 'render_pl_is_show_available_stock'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Out Of Stock Category. */
            add_settings_field( 'zp_pl_is_show_out_of_stock', esc_html__( 'Show Out Of Stock:', 'zinipos' ), [$this, 'render_pl_is_show_out_of_stock'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Filter. */
            add_settings_field( 'zp_pl_is_show_filter', esc_html__( 'Show Filter:', 'zinipos' ), [$this, 'render_pl_is_show_filter'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Product Thumbnail Position. */
            add_settings_field( 'zp_sp_thumb_position', esc_html__( 'Product Thumbnail Position:', 'zinipos' ), [$this, 'render_sp_thumb_position'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Fullscreen Product View. */
            add_settings_field( 'zp_sp_is_fullscreen_view', esc_html__( 'Fullscreen Product View:', 'zinipos' ), [$this, 'render_sp_is_fullscreen_view'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Share Button. */
            add_settings_field( 'zp_sp_is_show_share_button', esc_html__( 'Show Share Button:', 'zinipos' ), [$this, 'render_sp_is_show_share_button'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Short Description. */
            add_settings_field( 'zp_sp_is_show_short_description', esc_html__( 'Show Short Description:', 'zinipos' ), [$this, 'render_sp_is_show_short_description'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Show Up Sells Products. */
            add_settings_field( 'zp_sp_show_upsells_products', esc_html__( 'Show Up Sells Products:', 'zinipos' ), [$this, 'render_sp_show_upsells_products'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
    
            /** Number Of Up Sells Product Per Page. */
            add_settings_field( 'zp_sp_upsells_product_per_page', esc_html__( 'Number Of Up Sells Product Per Page:', 'zinipos' ), [$this, 'render_sp_upsells_product_per_page'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
        } else {
            add_settings_field( 'zp_plugin_woo_commerce_required', esc_html__( 'Error:', 'zinipos' ), [$this, 'render_plugin_woo_commerce_required'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
            // add_settings_field( 'zp_plugin_woo_commerce_required', esc_html__( 'Error:', 'zinipos' ), [$this, 'render_plugin_woo_commerce_required'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );
            add_settings_field( 'zp_plugin_woo_commerce_required', esc_html__( 'Error:', 'zinipos' ), [$this, 'render_plugin_woo_commerce_required'], 'WooGeneralOptionsGroup', 'zinipos_settings_woo_general_section' );

        }
        

    }

    /**
     * Render "Settings Saved" nags.
     *
     * @since    2.0.0
     **/
    public function render_nags() {

        if ( ! isset( $_GET['settings-updated'] ) ) { return; }

	    if ( strcmp( $_GET['settings-updated'], "true" ) == 0 ) {

		    /** Render "Settings Saved" message. */
		    UI::get_instance()->render_snackbar( esc_html__( 'Settings saved!', 'zinipos' ) );

	    }

	    if ( ! isset( $_GET['tab'] ) ) { return; }

        if ( strcmp( $_GET['tab'], "activation" ) == 0 ) {

            if ( PluginActivation::get_instance()->is_activated() ) {

	            /** Render "Activation success" message. */
	            UI::get_instance()->render_snackbar( esc_html__( 'Plugin activated successfully.', 'zinipos' ), 'success', 5500 );

            } else {

	            /** Render "Activation failed" message. */
	            UI::get_instance()->render_snackbar( esc_html__( 'Invalid purchase code.', 'zinipos' ), 'error', 5500 );

            }

        }

    }

    /**
     * Render Download link field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_link() {

        $options = [
            'none' => esc_html__( 'Do not show', 'zinipos' ),
            'backend' => esc_html__( 'Backend Only', 'zinipos' ),
            'frontend' => esc_html__( 'Frontend Only', 'zinipos' ),
            'backend-and-frontend' => esc_html__( 'Backend and Frontend', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['link'], // Selected option.
            esc_html__( 'Download link', 'zinipos' ),
            esc_html__( 'Position of the Download audio link', 'zinipos' ),
            ['name' => 'zinipos_color_settings[link]']
        );
    }

    /**
     * Render App Logo field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_app_logo() {

        if ( isset($this->options['app_logo'] )) {
            $key_path = get_attached_file( $this->options['app_logo'] );
            $url_app_logo = wp_get_attachment_url($this->options['app_logo']);
            $key_name = basename( $key_path );
        }

        ?>
        <div class="zs-upload">
            <div>
                <input type="hidden" name="zinipos_settings[app_logo]"
                       id="zinipos_settings[app_logo]"
                       value="<?php echo esc_attr( $this->options['app_logo'] ); ?>"/>
                
                <div class="zs-key-file-name">
                    <?php if ( isset( $key_name ) ) : ?>
                        <img alt="<?php echo esc_html( $key_name ); ?>" width="100" src="<?php echo esc_html( $url_app_logo ); ?>"/>
                        
                    <?php endif; ?>
                </div>
                &nbsp;<button class="zs-select-key-file-btn mdc-button mdc-button--outlined"><?php esc_html_e( 'Select Logo', 'zinipos' ); ?></button>
            </div>
        </div>

        <?php
    }

    /**
     * Render App Name field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_app_name() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['app_name'],
            esc_html__( 'App name', 'zinipos'),
            esc_html__( 'App name on mobile.', 'zinipos' ),
            ['name' => 'zinipos_settings[app_name]']
        );

    }

    /**
     * Render App Version field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_app_version() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['app_version'],
            esc_html__( 'App version', 'zinipos'),
            esc_html__( 'App version on mobile.', 'zinipos' ),
            ['name' => 'zinipos_settings[app_version]']
        );

    } 

    /**
     * Render Required plugin field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_plugins_required() {

        $html = esc_html__( 'This plugin uses the Advance Custom Field Pro. You need to install before using ZiniPOS.', 'zinipos' );
        /** Render input. */
        UI::get_instance()->render_html($html);

    }

    /**
     * Render Required plugin wooCommerce field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_plugin_woo_commerce_required() {

        $html = esc_html__( 'Please enable plugin WooCommerce to before configuring settings. The ZiniPOS Mobile App will not work if this plugin is disabled.', 'zinipos' );
        /** Render input. */
        UI::get_instance()->render_html($html);

    }

    /**
     * Render Background Primary Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_bg_primary_color() {

        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['bg_primary_color'],
            esc_html__( 'Background Primary Color', 'zinipos' ),
            esc_html__( 'Set main theme color and main background color.', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[bg_primary_color]',
                'id' => 'zs-zinipos-bg-primary-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Background Secondary Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_bg_secondary_color() {

        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['bg_secondary_color'],
            esc_html__( 'Background Secondary Color', 'zinipos' ),
            esc_html__( '', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[bg_secondary_color]',
                'id' => 'zs-zinipos-bg-secondary-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Text Header Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_text_header_color() {
        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['text_header_color'],
            esc_html__( 'Text Header Color', 'zinipos' ),
            esc_html__( 'Used for all header text.', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[text_header_color]',
                'id' => 'zs-zinipos-text-header-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Text Headline Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_text_headline_color() {
        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['text_headline_color'],
            esc_html__( 'Text Headline Color', 'zinipos' ),
            esc_html__( 'Used for all headline text on white backgrounds.', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[text_headline_color]',
                'id' => 'zs-zinipos-text-headline-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Text Body Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_text_body_color() {
        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['text_body_color'],
            esc_html__( 'Text Body Color', 'zinipos' ),
            esc_html__( 'Used for all body text on white backgrounds.', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[text_body_color]',
                'id' => 'zs-zinipos-text-body-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Text Base Color field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_text_body_meta_color() {

        /** Render colorpicker. */
        UI::get_instance()->render_colorpicker(
            $this->options['text_body_meta_color'],
            esc_html__( 'Text Body Meta Color', 'zinipos' ),
            esc_html__( 'Used for all meta texts.', 'zinipos' ),
            [
                'name' => 'zinipos_color_settings[text_body_meta_color]',
                'id' => 'zs-zinipos-text-body-meta-color',
                'readonly' => 'readonly'
            ]
        );

    }

    /**
     * Render Speaking Rate/Speed field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_speaking_rate() {

        /** Render slider. */
	    UI::get_instance()->render_slider(
		    $this->options['speaking-rate'],
		    0.25,
		    4.0,
		    0.25,
		    esc_html__( 'Speaking Rate/Speed', 'zinipos'),
		    esc_html__( 'Speaking rate:', 'zinipos') . ' <strong>' . esc_html( $this->options['speaking-rate'] ) . '</strong><br>',
		    [
			    'name' => 'zinipos_settings[speaking-rate]',
			    'class' => 'mdc-slider-width',
                'id' => 'zinipos_settings_rate'
		    ],
		    false
	    );

    }

    /**
     * Render Language field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_language() {
        $options = [
            'en' => esc_html__( 'English', 'zinipos' ),
            'es' => esc_html__( 'Spanish', 'zinipos' ),
            // 'fr' => esc_html__( 'Français', 'zinipos' ),
            // 'pt' => esc_html__( 'Portuguese', 'zinipos' ),
            // 'ru' => esc_html__( 'Russian', 'zinipos' ),
            'vi' => esc_html__( 'Vietnamese', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['language'], // Selected option.
	        esc_html__( 'Language', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[language]']
        );
    }

    /**
     * Render Date Format field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_date_format() {
        $options = [
            'MMM, DD, YYYY' => esc_html__( 'MMM, DD, YYYY', 'zinipos' ),
            'MM-DD-YYYY' => esc_html__( 'MM-DD-YYYY', 'zinipos' ),
            'DD-MM-YYYY' => esc_html__( 'DD-MM-YYYY', 'zinipos' ),
            'YYYY-MM-DD' => esc_html__( 'YYYY-MM-DD', 'zinipos' ),
            'F j, Y' => esc_html__( 'MMM DD, YYYY', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['date_format'], // Selected option.
	        esc_html__( 'Date Format', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[date_format]']
        );
    }

    /**
     * Render Time Format field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_time_format() {
        $options = [
            'HH:mm' => esc_html__( 'HH:mm', 'zinipos' ),
            'HH:mm:ss' => esc_html__( 'HH:mm:ss', 'zinipos' ),
            'hh:mm A' => esc_html__( 'hh:mm A', 'zinipos' ),
            'hh:mm:ss A' => esc_html__( 'hh:mm:ss A', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['time_format'], // Selected option.
	        esc_html__( 'Time Format', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[time_format]']
        );

    }   

    /**
     * Render Contact field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_contact() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['contact'],
            esc_html__( 'Contact', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[contact]']
        );

    } 
    
    /**
     * Render Email field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_email() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['email'],
            esc_html__( 'Email', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[email]']
        );

    } 
    
    /**
     * Render Address field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_address() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['address'],
            esc_html__( 'Address', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[address]']
        );

    } 


    /**
     * Render Privacy page field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_privacy_page() {
        $pages = get_pages(array(
            'post_type'    => 'page',
            'post_status'  => 'publish'
        ));
        $options = array();
        foreach($pages as $page) {
            $options[$page->ID] = esc_html__( $page->post_title, 'zinipos' );
        }

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['privacy_page'], // Selected option.
	        esc_html__( 'Privacy page', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[privacy_page]']
        );
    }
    
    /**
     * Render Term & Condition Page field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_term_condition_page() {
        $pages = get_pages(array(
            'post_type'    => 'page',
            'post_status'  => 'publish'
        ));
        $options = array();
        foreach($pages as $page) {
            $options[$page->ID] = esc_html__( $page->post_title, 'zinipos' );
        }

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['term_condition_page'], // Selected option.
	        esc_html__( 'Term & condition page', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[term_condition_page]']
        );
    }

     /**
     * Render Address field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_is_rtl() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['is_rtl'], // checked or not.
            esc_html__( 'Write characters from right to left', 'zinipos' ), // help text.
            ['name' => 'zinipos_settings[is_rtl]']
        );
    }

    /**
     * Render Facebook field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_facebook() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['facebook'],
            esc_html__( 'Facebook', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[facebook]']
        );

    }
    
    /**
     * Render Twitter field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_twitter() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['twitter'],
            esc_html__( 'Twitter', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[twitter]']
        );

    }

    /**
     * Render Google field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_google() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['google'],
            esc_html__( 'Google', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[google]']
        );

    }

    /**
     * Render Instagram field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_instagram() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['instagram'],
            esc_html__( 'Instagram', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_settings[instagram]']
        );

    }

    /**
     * Render Font Headline Family field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_headline_family() { 
        global $wp_filesystem;
        $file = plugin_dir_path( __FILE__ ) . 'assets/fonts/webfonts.json';
        $json_content = '';
		if ( ! empty( $file ) ) {
			if ( isset( $wp_filesystem ) && is_object( $wp_filesystem ) ) {
				$file = str_replace( ABSPATH, $wp_filesystem->abspath(), $file );

				$json_content = $wp_filesystem->get_contents( $file );
			}
        }
        
        $decoded_google_fonts = json_decode( $json_content , true ); 
        sort( $decoded_google_fonts['items'] );
		$webfonts             = [];
		if(!empty($decoded_google_fonts)) {
			foreach ( $decoded_google_fonts['items'] as $key => $value ) {
				$font_family                          = $decoded_google_fonts['items'][ $key ]['family'];
				$webfonts[ $font_family ]             = $font_family;
			}
		}
        /** Render select. */
        UI::get_instance()->render_select(
            $webfonts,
            $this->options['font_headline_family'], // Selected option.
	        esc_html__( 'Font Headline Family', 'zinipos' ),
	        esc_html__( 'Select font from Google Font. Refer: https://fonts.google.com.', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_headline_family]']
        );
    }

    /**
     * Render Font Headline Size field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_font_headline_size() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['font_headline_size'],
            esc_html__( 'Font Headline Size (px)', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_headline_size]']
        );

    } 

    /**
     * Render Font Headline Weight field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_headline_weight() {
        $options = [
            'light' => esc_html__( 'Light', 'zinipos' ), 
            'regular' => esc_html__( 'Regular', 'zinipos' ),   
            'bold' => esc_html__( 'Bold', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['font_headline_weight'], // Selected option.
	        esc_html__( 'Font Headline Weight', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_headline_weight]']
        );
    }

    /**
     * Render Font Body Family field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_body_family() {
        global $wp_filesystem;
        $file = plugin_dir_path( __FILE__ ) . 'assets/fonts/webfonts.json';
        $json_content = '';
		if ( ! empty( $file ) ) {
			if ( isset( $wp_filesystem ) && is_object( $wp_filesystem ) ) {
				$file = str_replace( ABSPATH, $wp_filesystem->abspath(), $file );

				$json_content = $wp_filesystem->get_contents( $file );
			}
        }
        
        $decoded_google_fonts = json_decode( $json_content , true ); 
        sort( $decoded_google_fonts['items'] );
		$webfonts             = [];
		if(!empty($decoded_google_fonts)) {
			foreach ( $decoded_google_fonts['items'] as $key => $value ) {
				$font_family                          = $decoded_google_fonts['items'][ $key ]['family'];
				$webfonts[ $font_family ]             = $font_family;
			}
		}

        /** Render select. */
        UI::get_instance()->render_select(
            $webfonts,
            $this->options['font_body_family'], // Selected option.
	        esc_html__( 'Font Body Family', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_body_family]']
        );
    }

    /**
     * Render Font Body Size field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_font_body_size() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['font_body_size'],
            esc_html__( 'Font Body Size (px)', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_body_size]']
        );

    } 

    /**
     * Render Font Body Weight field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_body_weight() {
        $options = [
            'light' => esc_html__( 'Light', 'zinipos' ), 
            'regular' => esc_html__( 'Regular', 'zinipos' ), 
            'bold' => esc_html__( 'Bold', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['font_body_weight'], // Selected option.
	        esc_html__( 'Font Body Weight', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_body_weight]']
        );
    }

    /**
     * Render Font Small Family field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_small_family() {
        global $wp_filesystem;
        $file = plugin_dir_path( __FILE__ ) . 'assets/fonts/webfonts.json';
        $json_content = '';
		if ( ! empty( $file ) ) {
			if ( isset( $wp_filesystem ) && is_object( $wp_filesystem ) ) {
				$file = str_replace( ABSPATH, $wp_filesystem->abspath(), $file );

				$json_content = $wp_filesystem->get_contents( $file );
			}
        }
        
        $decoded_google_fonts = json_decode( $json_content , true ); 
        sort( $decoded_google_fonts['items'] );
		$webfonts             = [];
		if(!empty($decoded_google_fonts)) {
			foreach ( $decoded_google_fonts['items'] as $key => $value ) {
				$font_family                          = $decoded_google_fonts['items'][ $key ]['family'];
				$webfonts[ $font_family ]             = $font_family;
			}
		}

        /** Render select. */
        UI::get_instance()->render_select(
            $webfonts,
            $this->options['font_small_family'], // Selected option.
	        esc_html__( 'Font Small', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_small_family]']
        );
    }

    /**
     * Render Font Small Size field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_font_small_size() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['font_small_size'],
            esc_html__( 'Font Small Size (px)', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_small_size]']
        );

    } 

    /**
     * Render Font Small Weight field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_font_small_weight() {
        $options = [
            'light' => esc_html__( 'Light', 'zinipos' ), 
            'regular' => esc_html__( 'Regular', 'zinipos' ), 
            'bold' => esc_html__( 'Bold', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['font_small_weight'], // Selected option.
	        esc_html__( 'Font Small Weight', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_typography_settings[font_small_weight]']
        );
    }

     /**
     * Render Progressive Web Apps Cached field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_progressive_web_apps_cached() {
        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['progressive_web_apps_cached'], // Selected option.
	        esc_html__( 'Progressive Web Apps Cached', 'zinipos' ),
	        esc_html__( 'ZiniPOS Progressive Web Apps on Desktop can be ‘installed’ on the user’s device much like native apps. It’s fast. Feel integrated because they launched in the same way as other apps, and run in an app window, without an address bar or tabs. It is reliable because service workers can cache all of the assets they need to run. And it create an engaging experience for users.', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[progressive_web_apps_cached]']
        );
    }

    /** */
    /**
     * Render Custom Order Number field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_custom_order_number() {
        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['custom_order_number'], // Selected option.
	        esc_html__( 'Custom Order Number', 'zinipos' ),
	        esc_html__( 'Custom Sequential Order Numbers for Order create via POS', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[custom_order_number]']
        );
    }

    /** */
    /**
     * Render POS Stock Manager field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pos_stock_manager() {
        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pos_stock_manager'], // Selected option.
	        esc_html__( 'Pos Stock Manager', 'zinipos' ),
	        esc_html__( 'Dont allow checkout out of stock product in POS', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[pos_stock_manager]']
        );
    }

    /** */
    /**
     * Render POS Order Status field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pos_order_status() {
        $options = [
            'pending_payment' => esc_html__( 'Pending Payment', 'zinipos' ),
            'processing' => esc_html__( 'Processing', 'zinipos' ),
            'driver_assigned' => esc_html__( 'Driver Assigned', 'zinipos' ),
            'out_for_delivery' => esc_html__( 'Out For Delivery', 'zinipos' ),
            'order_returned' => esc_html__( 'Order Returned', 'zinipos' ),
            'on_hold' => esc_html__( 'On Hold', 'zinipos' ),
            'completed' => esc_html__( 'Completed', 'zinipos' ),
            'cancelled' => esc_html__( 'Cancelled', 'zinipos' ),
            'refunded' => esc_html__( 'Refunded', 'zinipos' ),
            'failed' => esc_html__( 'Failed', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pos_order_status'], // Selected option.
	        esc_html__( 'POS Order Status', 'zinipos' ),
	        esc_html__( 'status for those order created by POS', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[pos_order_status]']
        );
    }

    /**
     * Render Continue Checkout Order Status field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_continue_checkout_order_status() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['continue_checkout_order_status'],
            esc_html__( 'Continue Checkout Order Status', 'zinipos'),
            esc_html__( 'Status of online order allow continue checkout on POS. Enter status name to search', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[continue_checkout_order_status]']
        );

    }
    

    /** */
    /**
     * Render Allow Refund field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_allow_refund() {
        $options = [
            'allways_allow' => esc_html__( 'Always allow', 'zinipos' ),
            'allow_with_durations' => esc_html__( 'Allow with durations', 'zinipos' ),
            'no_refund' => esc_html__( 'No Refund', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_refund'], // Selected option.
	        esc_html__( 'Allow Refund', 'zinipos' ),
	        esc_html__( 'Refund offline via pos panel', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[allow_refund]']
        );
    }

    /** */
    /**
     * Render Allow Exchange field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_allow_exchange() {
        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_exchange'], // Selected option.
	        esc_html__( 'Allow Exchange', 'zinipos' ),
	        esc_html__( 'Allow exchange for order made by current session', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[allow_exchange]']
        );
    }


    /** */
    /**
     * Render Pos Tax Class field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pos_tax_class() {
        $options = [
            'ues_product_tax_class' => esc_html__( 'Ues Product Tax Class', 'zinipos' ),
            'no_tax' => esc_html__( 'No Tax', 'zinipos' ),
            'standard' => esc_html__( 'Standard', 'zinipos' ),
            'reduced_rate' => esc_html__( 'Reduced rate', 'zinipos' ),
            'zero_rate' => esc_html__( 'Zero rate', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pos_tax_class'], // Selected option.
	        esc_html__( 'Pos Tax Class', 'zinipos' ),
	        esc_html__( 'Tax Class assign for POS system. Require refresh product list to take effect.', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[pos_tax_class]']
        );
    }

    
    /** */
    /**
     * Render Cart Discount Calculation field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_cart_discount_calculation() {
        $options = [
            'after_tax' => esc_html__( 'After Tax', 'zinipos' ),
            'before_tax' => esc_html__( 'Before Tax', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['cart_discount_calculation'], // Selected option.
	        esc_html__( 'Cart Discount Calculation', 'zinipos' ),
	        esc_html__( 'Cart discount calculation base on', 'zinipos' ),
            ['name' => 'zinipos_pos_settings[cart_discount_calculation]']
        );
    }

    /**
     * Render POS Addition Payment Methods field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pos_addition_payment_methods() {
        $options = [
            'cash_on_delivery' => esc_html__( 'Cash on delivery', 'zinipos' ),
            'direct_bank_transfer' => esc_html__( 'Direct bank transfer', 'zinipos' ),
            'stripe_payment' => esc_html__( 'Stripe payment', 'zinipos' ),
            'paypal' => esc_html__( 'Paypal', 'zinipos' ),
            'chip_pin' => esc_html__( 'Chip & PIN', 'zinipos' ),
            'credit_card_online_payment_for_pos_only' => esc_html__( 'Credit Card ( Strip ) - Online Payment for POS only', 'zinipos' ),
        ];

        /** Render checkboxes. */
        UI::get_instance()->render_checkboxes(
            $options,
            $this->options['pos_addition_payment_methods'], // checked checkbox.
            ['name' => 'zinipos_payment_settings[pos_addition_payment_methods]']
        );
    }

        /**
     * Render Shipping Methods field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_shipping_methods() {
        $options = [
            'flat_rate' => esc_html__( 'Flat rate', 'zinipos' ),
            'free_shipping' => esc_html__( 'Free shipping', 'zinipos' ),
            'local_pickup' => esc_html__( 'Local pickup', 'zinipos' )
        ];

        /** Render checkboxes. */
        UI::get_instance()->render_checkboxes(
            $options,
            $this->options['shipping_methods'], // checked checkbox.
            ['name' => 'zinipos_shipping_settings[shipping_methods]']
        );
    }

    /** */
    /**
     * Render Barcode Meta Key field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_barcode_meta_key() {
        $options = [
            'zp_barcode' => esc_html__( 'ZiniPOS Barcode', 'zinipos' ),
            'product_id' => esc_html__( 'Product ID', 'zinipos' ),
            'product_sku' => esc_html__( 'Product SKU', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['barcode_meta_key'], // Selected option.
	        esc_html__( 'Barcode Meta Key', 'zinipos' ),
	        esc_html__( 'Barcode field. Make sure the data is unique on meta key you are selected', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[barcode_meta_key]']
        );
    }

    /** */
    /**
     * Render Unit field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_unit() {
        $options = [
            'inch' => esc_html__( 'Inch', 'zinipos' ),
            'millimeter' => esc_html__( 'Millimeter', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['unit'], // Selected option.
	        esc_html__( 'Unit', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[unit]']
        );
    }

    /**
     * Render Sheet Height field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_sheet_width() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['sheet_width'],
            esc_html__( 'Sheet Width', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[sheet_width]']
        );

    }

    /**
     * Render Sheet Height field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_sheet_height() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['sheet_height'],
            esc_html__( 'Sheet Height', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[sheet_height]']
        );

    }
    
    /**
     * Render Vertical Space field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_vertical_space() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['vertical_space'],
            esc_html__( 'Vertical Space', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[vertical_space]']
        );

    }

    /**
     * Render Horizontal Space field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_horizontal_space() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['horizontal_space'],
            esc_html__( 'Horizontal Space', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[horizontal_space]']
        );

    }

    /**
     * Render Margin Top field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_margin_top() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['margin_top'],
            esc_html__( 'Margin Top', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[margin_top]']
        );

    }

    /**
     * Render Margin Right field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_margin_right() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['margin_right'],
            esc_html__( 'Margin Right', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[margin_right]']
        );

    }

    /**
     * Render Margin Bottom field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_margin_bottom() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['margin_bottom'],
            esc_html__( 'Margin Bottom', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[margin_bottom]']
        );

    }


    /**
     * Render Margin Left field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_margin_left() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['margin_left'],
            esc_html__( 'Margin Left', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[margin_left]']
        );

    }

    /**
     * Render Label Width field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_label_width() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['label_width'],
            esc_html__( 'Label Width', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[label_width]']
        );

    }

    /**
     * Render Label Height field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_label_height() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['label_height'],
            esc_html__( 'Label Height', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[label_height]']
        );

    }

    /**
     * Render Padding Top field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_top() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_top'],
            esc_html__( 'Padding Top', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[padding_top]']
        );

    }

     /**
     * Render Padding Right field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_right() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_right'],
            esc_html__( 'Padding Right', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[padding_right]']
        );

    }

    /**
     * Render Padding Bottom field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_bottom() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_bottom'],
            esc_html__( 'Padding Bottom', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[padding_bottom]']
        );

    }

     /**
     * Render Padding Right field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_left() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_left'],
            esc_html__( 'Padding Left', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[padding_left]']
        );

    }

    /**
     * Render Label Template field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_label_template() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['label_template'],
            esc_html__( 'Label Template', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[label_template]']
        );

    }

    /**
     * Render Mode field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_mode() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['mode'],
            esc_html__( 'Mode', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[mode]']
        );

    }

    /**
     * Render Width field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_width() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['width'],
            esc_html__( 'Width', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[width]']
        );

    }

    /**
     * Render Height field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_height() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['height'],
            esc_html__( 'Height', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_product_barcode_settings[height]']
        );

    }



    /**
     * Render Receipt Width field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_receipt_width() {
        $options = [
            '52' => esc_html__( 'A8 (52 x 74 mm) - (2.0 x 2.9 in)', 'zinipos' ),
            '74' => esc_html__( 'A7 (74 x 105 mm) - (2.9 x 4.1 in)', 'zinipos' ),
            '105' => esc_html__( 'A6 (105 x 148 mm) - (4.1 x 5.8 in)', 'zinipos' ),
            '148' => esc_html__( 'A5 (148 x 210 mm) - (4.1 x 5.8 in)', 'zinipos' ),
            '210' => esc_html__( 'A4 (210 x 297 mm) - (8.3 x 11.7 in)', 'zinipos' ),
            '0' => esc_html__( 'Custom', 'zinipos' ),
        ];
        /** Render input. */
        UI::get_instance()->render_select(
            $options,
            $this->options['receipt_width'],
            esc_html__( 'Receipt Width', 'zinipos'),
            esc_html__( 'Custom Reciept Width is used when you select Custom', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[receipt_width]']
        );

    }
    /**
     * Render Receipt Width field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_receipt_width_custom() {
        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['receipt_width_custom'],
            esc_html__( 'Receipt Width (milimeter)', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[receipt_width_custom]']
        );

        

    }
    /**
     * Render Padding Top _ Receipt field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_top_receipt() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_top_receipt'],
            esc_html__( 'Padding Top', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[padding_top_receipt]']
        );

    }

    /**
     * Render Padding Right _ Receipt field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_right_receipt() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_right_receipt'],
            esc_html__( 'Padding Right', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[padding_right_receipt]']
        );

    }

    /**
     * Render Padding Bottom _ Receipt field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_bottom_receipt() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_bottom_receipt'],
            esc_html__( 'Padding Bottom', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[padding_bottom_receipt]']
        );

    }

    /**
     * Render Padding Left _ Receipt field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_padding_left_receipt() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['padding_left_receipt'],
            esc_html__( 'Padding Left', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[padding_left_receipt]']
        );

    }

    /**
     * Render Receipt Template Header field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_receipt_template_header() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['receipt_template_header'],
            esc_html__( 'Receipt Template Header', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[receipt_template_header]']
        );

    }

    /**
     * Render Receipt Template Footer field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_receipt_template_footer() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['receipt_template_footer'],
            esc_html__( 'Receipt Template Footer', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[receipt_template_footer]']
        );

    }

    /**
     * Render Receipt Style field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_receipt_style() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['receipt_style'],
            esc_html__( 'Receipt Style', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_receipt_settings[receipt_style]']
        );

    }

    /**
     * Render POS Logo field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_logo() {
        if ( isset($this->options['pos_logo'] )) {
            $key_path = get_attached_file( $this->options['pos_logo'] );
            $url_pos_logo = wp_get_attachment_url($this->options['pos_logo']);
            $key_name = basename( $key_path );
        }

        ?>
        <div class="zs-upload">
            <div>
                <input type="hidden" name="zinipos_layout_settings[pos_logo]"
                       id="zinipos_layout_settings[pos_logo]"
                       value="<?php echo esc_attr( $this->options['pos_logo'] ); ?>"/>
                
                <div class="zs-key-file-name">
                    <?php if ( isset( $key_name ) ) : ?>
                        <img alt="<?php echo esc_html( $key_name ); ?>" width="100" src="<?php echo esc_html( $url_pos_logo ); ?>"/>
                        
                    <?php endif; ?>
                </div>
                &nbsp;<button class="zs-select-key-file-btn mdc-button mdc-button--outlined"><?php esc_html_e( 'Choose File', 'zinipos' ); ?></button>
            </div>
        </div>

        <?php
    }

    /**
     * Render Pos Type field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_type() {

        $options = [
            'grocery' => esc_html__( 'Grocery', 'zinipos' ),
            'cafe_restaurant' => esc_html__( 'Cafe / Restaurant', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pos_type'], // Selected option.
	        esc_html__( 'Pos Type', 'zinipos' ),
	        esc_html__( 'Default display for POS , their are table management in cafe/restaurant type', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_type]']
        );
    }

    /**
     * Render Pos Type field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_item_format() {

        $options = [
            'grid' => esc_html__( 'Grid', 'zinipos' ),
            'list' => esc_html__( 'List', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pos_item_format'], // Selected option.
	        esc_html__( 'Pos Item Format', 'zinipos' ),
	        esc_html__( 'Default item display format for POS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_item_format]']
        );
    }

    /**
     * Render Default Dashboard Display field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_default_dashboard_display() {

        $options = [
            'new_dashboard' => esc_html__( 'New Dashboard', 'zinipos' ),
            'products' => esc_html__( 'Products', 'zinipos' ),
            'categories' => esc_html__( 'Categories', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['default_dashboard_display'], // Selected option.
	        esc_html__( 'Default Dashboard Display', 'zinipos' ),
	        esc_html__( 'Default display for POS , in case category please set category item on category setting', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[default_dashboard_display]']
        );

    }

    /**
     * Render Product Grid Size field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_product_grid_size() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['product_grid_size_column'],
            esc_html__( 'Column', 'zinipos'),
            esc_html__( 'Grid Size for Products (column x row) on POS Panel', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[product_grid_size_column]']
        ); 

    }

    /**
     * Render Default Pos Language field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_default_pos_language() {

        $options = [
            'en' => esc_html__( 'English', 'zinipos' ),
            'vi' => esc_html__( 'Vietnamese', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['default_pos_language'], // Selected option.
	        esc_html__( 'Pos Language', 'zinipos' ),
	        esc_html__( 'Default language for POS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[default_pos_language]']
        );

    }

    /* Render Allow Add Custom Item field.
    *
    * @since 2.0.0
    * @access public
    **/
   public function render_allow_add_custom_item() {

       $options = [
           'yes' => esc_html__( 'Yes', 'zinipos' ),
           'no' => esc_html__( 'No', 'zinipos' )
       ];

       /** Render select. */
       UI::get_instance()->render_select(
           $options,
           $this->options['allow_add_custom_item'], // Selected option.
           esc_html__( 'Allow Add Custom Item', 'zinipos' ),
           esc_html__( 'Add custom item , the item do not exist in your system from POS', 'zinipos' ),
           ['name' => 'zinipos_layout_settings[allow_add_custom_item]']
       );

   }

    /* Render Allow Add Order Note field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_allow_add_order_note() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_add_order_note'], // Selected option.
            esc_html__( 'Allow Add Order Note', 'zinipos' ),
            esc_html__( 'Add order note from POS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[allow_add_order_note]']
        );
 
    }

    /**
     * Render Time Frequency field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_time_frequency() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['time_frequency'],
            esc_html__( 'Time Frequency', 'zinipos'),
            esc_html__( 'Time duration POS state checking (in mini seconds)', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[time_frequency]']
        );

    }

    /* Render Product Auto Sync field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_product_auto_sync() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['product_auto_sync'], // Selected option.
            esc_html__( 'Product Auto Sync', 'zinipos' ),
            esc_html__( 'Auto sync product qty by running process in background', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[product_auto_sync]']
        );
 
    }

    /* Render Clear Product List field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_clear_product_list() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['clear_product_list'], // Selected option.
            esc_html__( 'Clear Product List', 'zinipos' ),
            esc_html__( 'Auto clear product list on your local data after logout. Recommend set to "No" if you have > 500 products.', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[clear_product_list]']
        );
 
    }

    /* Render Display Out of stock field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_display_out_of_stock() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['display_out_of_stock'], // Selected option.
            esc_html__( 'Display Out of stock', 'zinipos' ),
            esc_html__( 'Display out of stock product in POS panel', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[display_out_of_stock]']
        );
 
    }

    /* Render Allow Negative Qty field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_allow_negative_qty() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_negative_qty'], // Selected option.
            esc_html__( 'Allow Negative Qty', 'zinipos' ),
            esc_html__( 'Allow negative qty , grand total use as refund', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[allow_negative_qty]']
        );
 
    }

    /* Render Allow Update Price field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_allow_update_price() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_update_price'], // Selected option.
            esc_html__( 'Allow Update Price', 'zinipos' ),
            esc_html__( 'Allow change product price on POS panel. Require refresh product list to take effect.', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[allow_update_price]']
        );
 
    }

    /**
     * Render POS Image Width field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_image_width() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['pos_image_width'],
            esc_html__( 'POS Image Width', 'zinipos'),
            esc_html__( 'Width of image in pos in px', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_image_width]']
        );

    }

    /**
     * Render POS Image Height field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_image_height() {

        /** Render input. */
        UI::get_instance()->render_input_number(
            $this->options['pos_image_height'],
            esc_html__( 'POS Image Height', 'zinipos'),
            esc_html__( 'Height of image in pos in px', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_image_height]']
        );

    }

    /**
     * Render POS Custom CSS field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_custom_css() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['pos_custom_css'],
            esc_html__( 'POS Custom Css', 'zinipos'),
            esc_html__( 'Custom style for POS with CSS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_custom_css]']
        );

    }

    /**
     * Render POS Money List field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_pos_money_list() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['pos_category'],
            esc_html__( 'POS Money List', 'zinipos'),
            esc_html__( 'List of money values in your pos. Separate by "|" character. Example: 10|20|30', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[pos_category]']
        );

    }

    /**
     * Render Quick Item Discount Amount field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_quick_item_discount_amount() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['quick_item_discount_amount'],
            esc_html__( 'Quick Item Discount Amount', 'zinipos'),
            esc_html__( 'List of quick discount values in your pos. Separate by "|" character. Example: 5|5%|10%', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[quick_item_discount_amount]']
        );

    }

    /**
     * Render Quick Cart Discount Amount field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_quick_cart_discount_amount() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['quick_cart_discount_amount'],
            esc_html__( 'Quick Cart Discount Amount', 'zinipos'),
            esc_html__( 'List of quick discount values in your pos. Separate by "|" character. Example: 5|5%|10%', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[quick_cart_discount_amount]']
        );

    }

    /* Render Require customer field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_require_customer() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['require_customer'], // Selected option.
            esc_html__( 'Require customer', 'zinipos' ),
            esc_html__( 'Require checkout with customer added only in POS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[require_customer]']
        );
 
    }

    /* Render Open Cash When Login field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_open_cash_when_login() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['open_cash_when_login'], // Selected option.
            esc_html__( 'Open Cash When Login', 'zinipos' ),
            esc_html__( 'Open Cash Adjustment Popup when login to POS', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[open_cash_when_login]']
        );
 
    }

    /* Render Payment Type field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_payment_type() {

        $options = [
            'split_multi_payment' => esc_html__( 'Split Multi Payment', 'zinipos' ),
            'single_payment' => esc_html__( 'Single Payment', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['payment_type'], // Selected option.
            esc_html__( 'Payment Type', 'zinipos' ),
            esc_html__( 'Logic for Payment method type use in POS checkout', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[payment_type]']
        );
 
    }

    /* Render Allow Digital Scale field.
    *
    * @since 2.0.0
    * @access public
    **/
    public function render_allow_digital_scale() {

        $options = [
            'yes' => esc_html__( 'Yes', 'zinipos' ),
            'no' => esc_html__( 'No', 'zinipos' )
        ];
 
        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['allow_digital_scale'], // Selected option.
            esc_html__( 'Allow Digital Scale', 'zinipos' ),
            esc_html__( 'Allow scan barcode with label generate by digital scale', 'zinipos' ),
            ['name' => 'zinipos_layout_settings[allow_digital_scale]']
        );
 
    }

    /**
     * Render Is  Show Share buttons.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_featured_image() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_featured_image'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_featured_image]']
        );
    }

    /**
     * Render Is  Show Excerpt.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_show_excerpt() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_show_excerpt'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_show_excerpt]']
        );
    }

    /**
     * Render Is  Show Description.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_show_description() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_show_description'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_show_description]']
        );
    }

    /**
     * Render Is Show Tag fields.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_show_tags() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_show_tags'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_show_tags]']
        );
    }

    /**
     * Render Is Show Related Posts field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_related_posts() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_related_posts'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_related_posts]']
        );
    }

     /**
     * Render Is Show comments field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_is_show_comments() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['is_show_comments'], // checked or not.
            esc_html__( 'Show / Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[is_show_comments]']
        );
    }

    /**
     * Render Is Show Posts by author field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_single_author_details() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['single_author_details'], // checked or not.
            esc_html__( 'Show / Hide link posts by author', 'zinipos' ), // help text.
            ['name' => 'zinipos_blog_settings[single_author_details]']
        );
    }

    /**
     * Render Is Show Blog Ads Header field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_is_show_blog_ads_header () {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['is_show_blog_ads_header'], // checked or not.
            esc_html__( 'Is Show Blog Ads Header', 'zinipos' ), // help text.
            ['name' => 'zinipos_ads_settings[is_show_blog_ads_header]']
        );
    }

    /**
     * Render Blog Ads Header Id field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_blog_ads_header_id() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['blog_ads_header_id'],
            esc_html__( 'Blog Ads Header Id', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_ads_settings[blog_ads_header_id]']
        );

    } 

    /**
     * Render Is Show Blog Ads Footer field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_is_show_blog_ads_footer () {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['is_show_blog_ads_footer'], // checked or not.
            esc_html__( 'Is Show Blog Ads Footer', 'zinipos' ), // help text.
            ['name' => 'zinipos_ads_settings[is_show_blog_ads_footer]']
        );
    }
    
    /**
     * Render Blog Ads Footer Id field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_blog_ads_footer_id() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['blog_ads_footer_id'],
            esc_html__( 'Blog Ads Footer Id', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_ads_settings[blog_ads_footer_id]']
        );

    } 

    /**
     * Render Is Show Intersititial Blog Ads field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_is_show_blog_interstitial_ads () {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['is_show_blog_interstitial_ads'], // checked or not.
            esc_html__( 'Is Show Interstitial Blog Ads', 'zinipos' ), // help text.
            ['name' => 'zinipos_ads_settings[is_show_blog_interstitial_ads]']
        );
    }
    
    /**
     * Render Blog Interstitial Ads Id field.
     *
     * @since 2.0.0
     * @access public
     **/
    public function render_blog_interstitial_ads_id() {

        /** Render input. */
        UI::get_instance()->render_input(
            $this->options['blog_interstitial_ads_id'],
            esc_html__( 'Blog Interstitial Ads Id', 'zinipos'),
            esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_ads_settings[blog_interstitial_ads_id]']
        );

    }

    /**
     * Render Woo Show Variations field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_woo_show_variations() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['woo_show_variations'], // checked or not.
            esc_html__( 'Show/Hide', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_general_settings[woo_show_variations]']
        );
    } 

    /**
     * Render Product Column On Mobile field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_num_of_column() {
        $options = [
            '1' => esc_html__( '1 Column', 'zinipos' ),
            '2' => esc_html__( '2 Column', 'zinipos' ),
            '3' => esc_html__( '3 Column', 'zinipos' ),
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['pl_num_of_column'], // Selected option.
	        esc_html__( 'Number Column', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_woo_product_listings_settings[pl_num_of_column]']
        );
    }

    /**
     * Render Number Of Product Per page field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_num_product_per_page() {

        /** Render slider. */
        UI::get_instance()->render_slider(
            $this->options['pl_num_product_per_page'],
            10,
            50,
            1,
            esc_html__( 'Number Of Product Per Page', 'zinipos'),
            esc_html__( 'Current numebr of product per page:', 'zinipos') . ' <strong>' . esc_html( $this->options['pl_num_product_per_page'] ) . '</strong>',
            [
                'name' => 'zinipos_woo_product_listings_settings[pl_num_product_per_page]',
                'class' => 'mdc-slider-width',
                'id' => 'zinipos_woo_product_listings_settings_pl_num_product_per_page'
            ],
            false
        );

    }

    /**
     * Render Is Show Product Category field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_is_show_category() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['pl_is_show_category'], // checked or not.
            esc_html__( 'Show/Hide product category on shop header', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_product_listings_settings[pl_is_show_category]']
        );
    }

    /**
     * Render Is Show Available Stock field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_is_show_available_stock() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['pl_is_show_available_stock'], // checked or not.
            esc_html__( 'Show/Hide available stock on count label', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_product_listings_settings[pl_is_show_available_stock]']
        );
    }

    /**
     * Render Is Show Out Of Stock field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_is_show_out_of_stock() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['pl_is_show_out_of_stock'], // checked or not.
            esc_html__( 'Show/Hide out of stock label', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_product_listings_settings[pl_is_show_out_of_stock]']
        );
    }

    /**
     * Render Is Show Filter field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_pl_is_show_filter() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['pl_is_show_filter'], // checked or not.
            esc_html__( 'Show/Hide filter', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_product_listings_settings[pl_is_show_filter]']
        );
    }

    /**
     * Render Thumbnail Position field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_thumb_position() {
        $options = [
            'bottom' => esc_html__( 'Bottom', 'zinipos' ),
            'top' => esc_html__( 'Top', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['sp_thumb_position'], // Selected option.
	        esc_html__( 'Position', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_woo_general_settings[sp_thumb_position]']
        );
    }

    /**
     * Render Is Fullscreen Product View field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_is_fullscreen_view() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['sp_is_fullscreen_view'], // checked or not.
            esc_html__( 'Is Fullscreen View', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_general_settings[sp_is_fullscreen_view]']
        );
    }

    /**
     * Render Is Show Share Button field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_is_show_share_button() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['sp_is_show_share_button'], // checked or not.
            esc_html__( 'Is Show Share Button', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_general_settings[sp_is_show_share_button]']
        );
    }

    /**
     * Render Is Show Short Description field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_is_show_short_description() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['sp_is_show_short_description'], // checked or not.
            esc_html__( 'Is Show Short Description', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_general_settings[sp_is_show_short_description]']
        );
    }

    /**
     * Render Is Show Up Sells Products field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_show_upsells_products() {
        /** Render single checkbox. */
        UI::get_instance()->render_checkbox(
            $this->options['sp_show_upsells_products'], // checked or not.
            esc_html__( 'Is Show Related Products', 'zinipos' ), // help text.
            ['name' => 'zinipos_woo_general_settings[sp_show_upsells_products]']
        );
    }

    /**
     * Render Number Of Up Sells Products per Page field.
     *
     * @since 1.0.0
     * @access public
     **/
    public function render_sp_upsells_product_per_page() {
        $options = [
            4 => esc_html__( '4', 'zinipos' ),
            6 => esc_html__( '6', 'zinipos' ),
            8 => esc_html__( '8', 'zinipos' ),
            10 => esc_html__( '10', 'zinipos' )
        ];

        /** Render select. */
        UI::get_instance()->render_select(
            $options,
            $this->options['sp_upsells_product_per_page'], // Selected option.
	        esc_html__( 'Number Of Up Sells Product Per Page', 'zinipos' ),
	        esc_html__( '', 'zinipos' ),
            ['name' => 'zinipos_woo_general_settings[sp_upsells_product_per_page]']
        );

    }

    /**
     * Get plugin settings with default values.
     *
     * @access public
     * @since 1.0.0
     * @return void
     **/
    public function get_options() {

        /** Voice tab settings. */
        $options = get_option( 'zinipos_settings' );

        /** Color tab settings. */
        $color_settings = get_option( 'zinipos_color_settings' );

        /** Typography tab settings. */
        $typography_settings = get_option( 'zinipos_typography_settings' );
           
        /** Pos tab settings. */
        $pos_settings = get_option( 'zinipos_pos_settings' );

        /** Payment tab settings. */
        $payment_settings = get_option( 'zinipos_payment_settings' );
        
        /** Shipping tab settings. */
        $shipping_settings = get_option( 'zinipos_shipping_settings' );

        /** Barcode Label Sheet tab settings. */
        $barcode_label_settings = get_option( 'zinipos_product_barcode_settings' );
       
        /** Print Receipt tab settings. */
        $receipt_settings = get_option( 'zinipos_receipt_settings' );

        /** POS Layout tab settings. */
        $layout_settings = get_option( 'zinipos_layout_settings' );

             

        /** Blog tab settings. */
        $blog_settings = get_option( 'zinipos_blog_settings' );

        /** Ads tab settings. */
        //$ads_settings = get_option( 'zinipos_ads_settings' );

        /** Woo General settings. */
        $woo_general_settings = get_option( 'zinipos_woo_general_settings' );

        /** Product Listings settings. */
        $woo_product_listings_settings = get_option( 'zinipos_woo_product_listings_settings' );

        /** General settings. */
        $woo_general_settings = get_option( 'zinipos_woo_general_settings' );

        /** Default values. */
        $defaults = [ 
            'language'      => 'en-US-Standard-D', // Language.
            'language-code' => 'en-US', // Language Code.
            
            'position'      => 'before-content', // Position.
            'style'         => 'zinipos-round', // Default style.
            
            /** General Tab. */
            'app_name'         => 'ZiniPOS', // Default app name.
            'app_version'         => '1.0.1', // Default app version.
            'language'         => 'en', // Default language.
            'date_format'         => 'MMM, DD, YYYY', // Default date format.
            'time_format'         => 'HH:mm', // Default time format. 
            'contact'         => '(+84) 095 82 77 07', // Default contact.
            'email'         => 'hi@zinisoft.net', // Default email.
            'address'         => '70, Street 13, Van Phuc Residence, Thu Duc City, HCMC, Vietnam', // Default address.
            'privacy_page'         => '0', // Default privacy page.
            'term_condition_page'      => '0', // Default condition page. 
            'is_rtl'                   => false, // Default right to left
            'facebook'                 => 'https://www.facebook.com/', // Default facebook.
            'twitter'                  => 'https://twitter.com/',       // Default twitter.
            'google'                   => 'https://www.google.com/',    // Default google.
            'instagram'                => 'https://www.instagram.com/', // Default instagram. 
            /** Color Tab. */
            'bg_primary_color'       => 'rgba(2, 83, 238, 1)', // Default background primary color.
            'bg_secondary_color'       => 'rgba(2, 83, 238, 1)', // Default background secondary color.
            'text_header_color'       => 'rgba(2, 83, 238, 1)', // Default text header color.
            'text_headline_color'       => 'rgba(2, 83, 238, 1)', // Default text headline color.
            'text_body_color'       => 'rgba(2, 83, 238, 1)', // Default text body color.
            'text_body_meta_color'       => 'rgba(2, 83, 238, 1)', // Default text body meta color.

            /** Typography Tab. */
            'font_headline_family'       => 'Roboto', // Default font headline family.
            'font_headline_size'       => '16', // Default font headline size.
            'font_headline_weight'       => 'bold', // Default font headline weight.
            'font_body_family'       => 'Roboto', // Default font body family.
            'font_body_size'       => '12', // Default font body size.
            'font_body_weight'       => 'zsMedium', // Default font body weight.
            'font_small_family'       => 'Roboto', // Default font small family.
            'font_small_size'       => '10', // Default font small size.
            'font_small_weight'       => 'zsLight', // Default font small weight.

            /** Pos Tab. */
            'progressive_web_apps_cached'       => 'yes',   // Default progressive web apps cached
            'custom_order_number'               => 'yes',   // Default custom order number
            'pos_stock_manager'                 => 'yes',   // Default pos stock manager
            'pos_order_status'                  => 'completed',   // Default pos order status
            'continue_checkout_order_status'                  => '',   // Default continue chcekout order status
            'allow_refund'  => 'always_allow',   // Default allow refund
            'allow_exchange' => 'yes',   // Default allow exchange
            'pos_tax_class' => 'ues_product_tax_class',   // Default pos tax class
            'cart_discount_calculation' => 'after_tax',   // Default cart discount calculation
            
            /** Payment */
            'pos_addition_payment_methods' => 'cash_on_delivery',   // Default pos addition payment methods

            /** Shipping */
            'shipping_methods'             => 'flat_rate',   // Default shipping methods

            /** Barcode Label Sheet */
            'barcode_meta_key'             => 'zp_barcode',   // Default barcode meta key
            'unit'                         => 'inch',   // Default unit
            'sheet_width'                  => '0',   // Default sheet width
            'sheet_height'                 => '0',   // Default sheet height
            'vertical_space'                => '0',   // Default vertical space
            'horizontal_space'                => '0',   // Default horizontal space
            'margin_top'               => '0',   // Default margin top
            'margin_right'              => '0',   // Default margin right
            'margin_bottom'               => '0',   // Default margin bottom
            'margin_left'               => '0',   // Default margin left
            'label_width'              => '0',   // Default label width
            'label_height'               => '0',   // Default label height
            'padding_top'               => '0',   // Default padding top
            'padding_right'              => '0',   // Default padding right
            'padding_bottom'               => '0',   // Default padding bottom
            'padding_left'              => '0',   // Default paddding left
            'label_template'               => '0',   // Default label template
            'mode'                  => '0',   // Default mode
            'width'                  => '0',   // Default width
            'height'                 => '0',   // Default height

            /** Print Receipt */
            'receipt_width'               => '210',   // Default receipt width
            'receipt_width_custom'               => '0',   // Default visiable receipt width
            'padding_top_receipt'              => '0',   // Default padding top receipt
            'padding_right_receipt'               => '0',   // Default padding right receipt
            'padding_bottom_receipt'               => '0',   // Default bottom receipt
            'padding_left_receipt'              => '0',   // Default left receipt
            'receipt_template_header'               => '0',   // Default template header
            'receipt_template_footer'               => '0',   // Default template footer
            'receipt_style'              => '0',   // Default receipt style
            
            /** POS Layout */
            'pos_type'              =>  'grocery',   // Default pos type
            'pos_item_format'              =>  'grid',   // Default pos grid
            'default_dashboard_display'              => 'new_dashboard',   // Default default dashboard display
            'product_grid_size_column'               =>  '5',   // Default product grid size column
            'default_pos_language'              =>  'en',   // Default pos language
            'allow_add_custom_item'              =>  'yes',   // Default allow add custom item
            'allow_add_order_note'              =>  'yes',   // Default add order note
            'time_frequency'              =>  '0',   // Default time frequency
            'product_auto_sync'              =>  'yes',   // Default product auto sync
            'clear_product_list'              =>   'yes',   // Default clear product list
            'display_out_of_stock'               => 'yes',   // Default display out of stock
            'allow_negative_qty'              =>  'yes',   // Default allow negative qty
            'allow_update_price'              =>  'yes',   // Default allow update price
            'pos_image_width'              =>  '0',   // Default pos image width
            'pos_image_height'              =>  '0',   // Default image height
            'pos_custom_css'              =>  '',   // Default pos custom css
            'pos_category'              =>  '',   // Default pos category
            'pos_money_list'              =>  '',   // Default pos money list
            'quick_item_discount_amount'              =>  '',   // Default quick item discount amount
            'quick_cart_discount_amount'              =>  '',   // Default quick cart discount amount
            'require_customer'              =>  'yes',   // Default require customer
            'open_cash_when_login'              =>  'yes',   // Default open cash when login
            'payment_type'              => 'split_multi_payment',   // Default payment style
            'allow_digital_scale'              =>  'yes',   // Default allow digital scale

            /** Woo General Tab */
            'woo_general_content_type'       => 'posts', // Default Woo General Content Type. 
            'woo_show_variations'       => false, // Default Woo Show Variations.

            /** Product Listings Tab. */
            'pl_num_of_column'       => '1', // Default number of column.
            'pl_num_product_per_page'       => '12', // Default number of product per page.
            'pl_is_show_category'       => false, // Default show category.
            'pl_is_show_available_stock'       => false, // Default show available stock.
            'pl_is_show_out_of_stock'       => false, // Default show out of stock.
            'pl_is_show_filter'       => false, // Default show filter.

            /**Single Product Tab */
            'sp_thumb_position'       => 'bottom', // Default Thumbnail Position.
            'sp_is_fullscreen_view'       => false, // Default Fullscreen Product View.
            'sp_is_show_share_button'       => false, // Default Show Share Button.
            'sp_is_show_short_description'       => false, // Default Show Short Description.
            'sp_show_upsells_products'       => false, // Default Show Up Sells Products.
            'sp_upsells_product_per_page'       => '12', // Default Number Of Up Sells Products Per Page.
            'link'          => 'none', // Download Link.
        ]; 

        /** Color Tab. */
        /** position. */
        if ( isset( $color_settings['position'] ) ) {
            $options['position'] = $color_settings['position'];
        }

        /** Style. */
        if ( isset( $color_settings['style'] ) ) {
            $options['style'] = $color_settings['style'];
        }

        /** Background Primary Color. */
        if ( isset( $color_settings['bg_primary_color'] ) ) {
            if ( $color_settings['bg_primary_color'] == '' ) {
                $options['bg_primary_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['bg_primary_color'] = $color_settings['bg_primary_color'];
            }
        }

        /** Background Secondary Color. */
        if ( isset( $color_settings['bg_secondary_color'] ) ) {
            if ( $color_settings['bg_secondary_color'] == '' ) {
                $options['bg_secondary_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['bg_secondary_color'] = $color_settings['bg_secondary_color'];
            }
        }

        /** Text HeaderColor. */
        if ( isset( $color_settings['text_header_color'] ) ) {
            if ( $color_settings['text_header_color'] == '' ) {
                $options['text_header_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['text_header_color'] = $color_settings['text_header_color'];
            }
        }

        /** Text Headline Color. */
        if ( isset( $color_settings['text_headline_color'] ) ) {
            if ( $color_settings['text_headline_color'] == '' ) {
                $options['text_headline_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['text_headline_color'] = $color_settings['text_headline_color'];
            }
        }

        /** Text Body Color. */
        if ( isset( $color_settings['text_body_color'] ) ) {
            if ( $color_settings['text_body_color'] == '' ) {
                $options['text_body_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['text_body_color'] = $color_settings['text_body_color'];
            }
        }

        /** Text Body Meta Color. */
        if ( isset( $color_settings['text_body_meta_color'] ) ) {
            if ( $color_settings['text_body_meta_color'] == '' ) {
                $options['text_body_meta_color'] = 'rgba(2, 83, 238, 1)';
            } else {
                $options['text_body_meta_color'] = $color_settings['text_body_meta_color'];
            }
        }
        
        /** Typography tab */
        /** Font Headline Family. */
        if ( isset( $typography_settings['font_headline_family'] ) ) {
            if ( $typography_settings['font_headline_family'] == '' ) {
                $options['font_headline_family'] = 'Roboto';
            } else {
                $options['font_headline_family'] = $typography_settings['font_headline_family'];
            }
        }
        
        /** Font Headline Size. */
        if ( isset( $typography_settings['font_headline_size'] ) ) {
            if ( $typography_settings['font_headline_size'] == '' ) {
                $options['font_headline_size'] = '16';
            } else {
                $options['font_headline_size'] = $typography_settings['font_headline_size'];
            }
        }
        
        /** Font Headline Weight. */
        if ( isset( $typography_settings['font_headline_weight'] ) ) {
            if ( $typography_settings['font_headline_weight'] == '' ) {
                $options['font_headline_weight'] = '700';
            } else {
                $options['font_headline_weight'] = $typography_settings['font_headline_weight'];
            }
        }
        
        /** Font Body Family. */
        if ( isset( $typography_settings['font_body_family'] ) ) {
            if ( $typography_settings['font_body_family'] == '' ) {
                $options['font_body_family'] = 'Roboto';
            } else {
                $options['font_body_family'] = $typography_settings['font_body_family'];
            }
        }
        
        /** Font Body Size. */
        if ( isset( $typography_settings['font_body_size'] ) ) {
            if ( $typography_settings['font_body_size'] == '' ) {
                $options['font_body_size'] = '16';
            } else {
                $options['font_body_size'] = $typography_settings['font_body_size'];
            }
        }
        
        /** Font Body Weight. */
        if ( isset( $typography_settings['font_body_weight'] ) ) {
            if ( $typography_settings['font_body_weight'] == '' ) {
                $options['font_body_weight'] = '700';
            } else {
                $options['font_body_weight'] = $typography_settings['font_body_weight'];
            }
        }
        
        /** Font Small Family. */
        if ( isset( $typography_settings['font_small_family'] ) ) {
            if ( $typography_settings['font_small_family'] == '' ) {
                $options['font_small_family'] = 'Roboto';
            } else {
                $options['font_small_family'] = $typography_settings['font_small_family'];
            }
        }
        
        /** Font Small Size. */
        if ( isset( $typography_settings['font_small_size'] ) ) {
            if ( $typography_settings['font_small_size'] == '' ) {
                $options['font_small_size'] = '16';
            } else {
                $options['font_small_size'] = $typography_settings['font_small_size'];
            }
        }
        
        /** Font Small Weight. */
        if ( isset( $typography_settings['font_small_weight'] ) ) {
            if ( $typography_settings['font_small_weight'] == '' ) {
                $options['font_small_weight'] = 'zsLight';
            } else {
                $options['font_small_weight'] = $typography_settings['font_small_weight'];
            }
        }

        /** Pos tab */
        /** Progressive Web Apps Cached. */
        if ( isset( $pos_settings['progressive_web_apps_cached'] ) ) {
            if ( $pos_settings['progressive_web_apps_cached'] == '' ) {
                $options['progressive_web_apps_cached'] = 'yes';
            } else {
                $options['progressive_web_apps_cached'] = $pos_settings['progressive_web_apps_cached'];
            }
        }

        /** Custom Order Number. */
        if ( isset( $pos_settings['custom_order_number'] ) ) {
            if ( $pos_settings['custom_order_number'] == '' ) {
                $options['custom_order_number'] = 'yes';
            } else {
                $options['custom_order_number'] = $pos_settings['custom_order_number'];
            }
        }

        /** Pos Stock Manager. */
        if ( isset( $pos_settings['pos_stock_manager'] ) ) {
            if ( $pos_settings['pos_stock_manager'] == '' ) {
                $options['pos_stock_manager'] = 'yes';
            } else {
                $options['pos_stock_manager'] = $pos_settings['pos_stock_manager'];
            }
        }
        
        /** Pos Order Status */
        if ( isset( $pos_settings['pos_order_status'] ) ) {
            if ( $pos_settings['pos_order_status'] == '' ) {
                $options['pos_order_status'] = 'completed';
            } else {
                $options['pos_order_status'] = $pos_settings['pos_order_status'];
            }
        }
     
        /** Continue Checkout Order Status */
        if ( isset( $pos_settings['continue_checkout_order_status'] ) ) {
            $options['continue_checkout_order_status'] = $pos_settings['continue_checkout_order_status'];
            
        }
       
        /** Payment Meta Fields. */
        if ( isset( $payment_settings['pos_addition_payment_methods'] ) ) {
         $options['pos_addition_payment_methods'] = $payment_settings['pos_addition_payment_methods'];
        }

        /** Shipping Meta Fields. */
        if ( isset( $shipping_settings['shipping_methods'] ) ) {
            $options['shipping_methods'] = $shipping_settings['shipping_methods'];
        }
        
        /** Barcode Meta Key */
        if ( isset( $barcode_label_settings['barcode_meta_key'] ) ) {
            if ( $barcode_label_settings['barcode_meta_key'] == '' ) {
                $options['barcode_meta_key'] = 'zp_barcode';
            } else {
                $options['barcode_meta_key'] = $barcode_label_settings['barcode_meta_key'];
            }
        }

        /** Unit */
        if ( isset( $barcode_label_settings['unit'] ) ) {
            if ( $barcode_label_settings['unit'] == '' ) {
                $options['unit'] = 'inch';
            } else {
                $options['unit'] = $barcode_label_settings['unit'];
            }
        }

        /** Sheet Width */
        if ( isset( $barcode_label_settings['sheet_width'] ) ) {
            $options['sheet_width'] = $barcode_label_settings['sheet_width'];
        }
        
        /** Sheet Height */
        if ( isset( $barcode_label_settings['sheet_height'] ) ) {
            $options['sheet_height'] = $barcode_label_settings['sheet_height'];
        }

        /** Vertical Space */
        if ( isset( $barcode_label_settings['vertical_space'] ) ) {
            $options['vertical_space'] = $barcode_label_settings['vertical_space'];
        }

        /** Horizontal Space */
        if ( isset( $barcode_label_settings['horizontal_space'] ) ) {
            $options['horizontal_space'] = $barcode_label_settings['horizontal_space'];
        }

        /** Margin Top */
        if ( isset( $barcode_label_settings['margin_top'] ) ) {
            $options['margin_top'] = $barcode_label_settings['margin_top'];
        }

        /** Margin Right */
        if ( isset( $barcode_label_settings['margin_right'] ) ) {
            $options['margin_right'] = $barcode_label_settings['margin_right'];
        }

        /** Margin Bottom */
        if ( isset( $barcode_label_settings['margin_bottom'] ) ) {
            $options['margin_bottom'] = $barcode_label_settings['margin_bottom'];
        }

        /** Margin Left */
        if ( isset( $barcode_label_settings['margin_left'] ) ) {
            $options['margin_left'] = $barcode_label_settings['margin_left'];
        }

         /** Label Width */
         if ( isset( $barcode_label_settings['label_width'] ) ) {
            $options['label_width'] = $barcode_label_settings['label_width'];
        }

        /** Label Height */
        if ( isset( $barcode_label_settings['label_height'] ) ) {
            $options['label_height'] = $barcode_label_settings['label_height'];
        }

        /** Padding Top */
        if ( isset( $barcode_label_settings['padding_top'] ) ) {
            $options['padding_top'] = $barcode_label_settings['padding_top'];
        }

        /** Padding Right */
        if ( isset( $barcode_label_settings['padding_right'] ) ) {
            $options['padding_right'] = $barcode_label_settings['padding_right'];
        }

        /** Padding Bottom */
        if ( isset( $barcode_label_settings['padding_bottom'] ) ) {
            $options['padding_bottom'] = $barcode_label_settings['padding_bottom'];
        }

        /** Padding Left */
        if ( isset( $barcode_label_settings['padding_left'] ) ) {
            $options['padding_left'] = $barcode_label_settings['padding_left'];
        }

        /** Label Template */
        if ( isset( $barcode_label_settings['label_template'] ) ) {
            $options['label_template'] = $barcode_label_settings['label_template'];
        }

        /** Mode */
        if ( isset( $barcode_label_settings['mode'] ) ) {
            $options['mode'] = $barcode_label_settings['mode'];
        }

        /** Width */
        if ( isset( $barcode_label_settings['width'] ) ) {
            $options['width'] = $barcode_label_settings['width'];
        }

        /** Height */
        if ( isset( $barcode_label_settings['height'] ) ) {
            $options['height'] = $barcode_label_settings['height'];
        }

        /** Receipt Width */
        // if ( isset( $receipt_settings['receipt_width'] ) ) {
        //     $options['receipt_width'] = $receipt_settings['receipt_width'];
        // }

        if ( isset( $receipt_settings['receipt_width'] ) ) {
            if ( $receipt_settings['receipt_width'] == '' ) {
                $options['receipt_width'] = '210';
            } else {
                $options['receipt_width'] = $receipt_settings['receipt_width'];
            }
        }
        /** Padding Top Receipt */
        if ( isset( $receipt_settings['receipt_width_custom'] ) ) {
            $options['receipt_width_custom'] = $receipt_settings['receipt_width_custom'];
        }
        /** Padding Top Receipt */
        if ( isset( $receipt_settings['padding_top_receipt'] ) ) {
            $options['padding_top_receipt'] = $receipt_settings['padding_top_receipt'];
        }

        /** Padding Right Receipt */
        if ( isset( $receipt_settings['padding_right_receipt'] ) ) {
            $options['padding_right_receipt'] = $receipt_settings['padding_right_receipt'];
        }

        /** Padding Bottom Receipt */
        if ( isset( $receipt_settings['padding_bottom_receipt'] ) ) {
            $options['padding_bottom_receipt'] = $receipt_settings['padding_bottom_receipt'];
        }

        /** Padding Left Receipt */
        if ( isset( $receipt_settings['padding_left_receipt'] ) ) {
            $options['padding_left_receipt'] = $receipt_settings['padding_left_receipt'];
        }

        /** Receipt Template Header */
        if ( isset( $receipt_settings['receipt_template_header'] ) ) {
            $options['receipt_template_header'] = $receipt_settings['receipt_template_header'];
        }

        /** Receipt Template Footer */
        if ( isset( $receipt_settings['receipt_template_footer'] ) ) {
            $options['receipt_template_footer'] = $receipt_settings['receipt_template_footer'];
        }

        /** Receipt Style */
        if ( isset( $receipt_settings['receipt_style'] ) ) {
            $options['receipt_style'] = $receipt_settings['receipt_style'];
        }

        /** POS Type */
        if ( isset( $layout_settings['pos_type'] ) ) {
            if ( $layout_settings['pos_type'] == '' ) {
                $options['pos_type'] = 'grocery';
            } else {
                $options['pos_type'] = $layout_settings['pos_type'];
            }
        }
        /** POS Item format */
        if ( isset( $layout_settings['pos_item_format'] ) ) {
            if ( $layout_settings['pos_item_format'] == '' ) {
                $options['pos_item_format'] = 'grid';
            } else {
                $options['pos_item_format'] = $layout_settings['pos_item_format'];
            }
        }

        /** Default Dashboard Display */
        if ( isset( $layout_settings['default_dashboard_display'] ) ) {
            if ( $layout_settings['default_dashboard_display'] == '' ) {
                $options['default_dashboard_display'] = 'new_dashboard';
            } else {
                $options['default_dashboard_display'] = $layout_settings['default_dashboard_display'];
            }
        }

        /** Product Grid Size */
        if ( isset( $layout_settings['product_grid_size_column'] ) ) {
            $options['product_grid_size_column'] = $layout_settings['product_grid_size_column'];
        }

        
        /** Default POS Language */
        if ( isset( $layout_settings['default_pos_language'] ) ) {
            if ( $layout_settings['default_pos_language'] == '' ) {
                $options['default_pos_language'] = 'en';
            } else {
                $options['default_pos_language'] = $layout_settings['default_pos_language'];
            }
        }

        /** Allow Add Custom Item */
        if ( isset( $layout_settings['allow_add_custom_item'] ) ) {
            if ( $layout_settings['allow_add_custom_item'] == '' ) {
                $options['allow_add_custom_item'] = 'yes';
            } else {
                $options['allow_add_custom_item'] = $layout_settings['allow_add_custom_item'];
            }
        }

        /** Allow Add Order Note */
        if ( isset( $layout_settings['allow_add_order_note'] ) ) {
            if ( $layout_settings['allow_add_order_note'] == '' ) {
                $options['allow_add_order_note'] = 'yes';
            } else {
                $options['allow_add_order_note'] = $layout_settings['allow_add_order_note'];
            }
        }

        /** Time Frequency */
        if ( isset( $layout_settings['time_frequency'] ) ) {
            $options['time_frequency'] = $layout_settings['time_frequency'];
        }

        /** Product Auto Sync */
        if ( isset( $layout_settings['product_auto_sync'] ) ) {
            if ( $layout_settings['product_auto_sync'] == '' ) {
                $options['product_auto_sync'] = 'yes';
            } else {
                $options['product_auto_sync'] = $layout_settings['product_auto_sync'];
            }
        }

        /** Clear Product List */
        if ( isset( $layout_settings['clear_product_list'] ) ) {
            if ( $layout_settings['clear_product_list'] == '' ) {
                $options['clear_product_list'] = 'yes';
            } else {
                $options['clear_product_list'] = $layout_settings['clear_product_list'];
            }
        }

        /** Display Out of stock */
        if ( isset( $layout_settings['display_out_of_stock'] ) ) {
            if ( $layout_settings['display_out_of_stock'] == '' ) {
                $options['display_out_of_stock'] = 'yes';
            } else {
                $options['display_out_of_stock'] = $layout_settings['display_out_of_stock'];
            }
        }

        /** Allow Negative Qty */
        if ( isset( $layout_settings['allow_negative_qty'] ) ) {
            if ( $layout_settings['allow_negative_qty'] == '' ) {
                $options['allow_negative_qty'] = 'yes';
            } else {
                $options['allow_negative_qty'] = $layout_settings['allow_negative_qty'];
            }
        }

        /** Allow Update Price */
        if ( isset( $layout_settings['allow_update_price'] ) ) {
            if ( $layout_settings['allow_update_price'] == '' ) {
                $options['allow_update_price'] = 'yes';
            } else {
                $options['allow_update_price'] = $layout_settings['allow_update_price'];
            }
        }

        /** POS Image Width */
        if ( isset( $layout_settings['pos_image_width'] ) ) {
            $options['pos_image_width'] = $layout_settings['pos_image_width'];
        }
        
        /** POS Image Height */
        if ( isset( $layout_settings['pos_image_height'] ) ) {
            $options['pos_image_height'] = $layout_settings['pos_image_height'];
        }

        /** POS Custom CSS */
        if ( isset( $layout_settings['pos_custom_css'] ) ) {
            $options['pos_custom_css'] = $layout_settings['pos_custom_css'];
        }

        /** POS Category */
        if ( isset( $layout_settings['pos_category'] ) ) {
            $options['pos_category'] = $layout_settings['pos_category'];
        }

        /** POS Money List */
        if ( isset( $layout_settings['pos_money_list'] ) ) {
            $options['pos_money_list'] = $layout_settings['pos_money_list'];
        }

        /** Quick Item Discount Amount */
        if ( isset( $layout_settings['quick_item_discount_amount'] ) ) {
            $options['quick_item_discount_amount'] = $layout_settings['quick_item_discount_amount'];
        }

        /** Quick Cart Discount Amount */
        if ( isset( $layout_settings['quick_cart_discount_amount'] ) ) {
            $options['quick_cart_discount_amount'] = $layout_settings['quick_cart_discount_amount'];
        }

        /** Require customer */
        if ( isset( $layout_settings['require_customer'] ) ) {
            if ( $layout_settings['require_customer'] == '' ) {
                $options['require_customer'] = 'yes';
            } else {
                $options['require_customer'] = $layout_settings['require_customer'];
            }
        }

        /** Open Cash When Login */
        if ( isset( $layout_settings['open_cash_when_login'] ) ) {
            if ( $layout_settings['open_cash_when_login'] == '' ) {
                $options['open_cash_when_login'] = 'yes';
            } else {
                $options['open_cash_when_login'] = $layout_settings['open_cash_when_login'];
            }
        }

        /** Payment Type */
        if ( isset( $layout_settings['payment_type'] ) ) {
            if ( $layout_settings['payment_type'] == '' ) {
                $options['payment_type'] = 'split_multi_payment';
            } else {
                $options['payment_type'] = $layout_settings['payment_type'];
            }
        }

        /** Allow Digital Scale */
        if ( isset( $layout_settings['allow_digital_scale'] ) ) {
            if ( $layout_settings['allow_digital_scale'] == '' ) {
                $options['allow_digital_scale'] = 'yes';
            } else {
                $options['allow_digital_scale'] = $layout_settings['allow_digital_scale'];
            }
        }


        // $barcode_label_settings = get_option( 'zinipos_product_barcode_settings' );
       
        // /** Print Receipt tab settings. */
        // $receipt_settings = get_option( 'zinipos_receipt_settings' );
        
        /** Woo General Tab */
        /** Woo Show variations. */
        if ( isset( $woo_general_settings['woo_show_variations'] ) ) {
            $options['woo_show_variations'] = $woo_general_settings['woo_show_variations'];
        }

        /** Product Listings Tab */
        /** Product Columns On Mobile */
        if ( isset( $woo_product_listings_settings['pl_num_of_column'] ) ) {
            $options['pl_num_of_column'] = $woo_product_listings_settings['pl_num_of_column'];
        }

        /** Number Of Product Per Page */
        if ( isset( $woo_product_listings_settings['pl_num_product_per_page'] ) ) {
            $options['pl_num_product_per_page'] = $woo_product_listings_settings['pl_num_product_per_page'];
        }

        /** DisPlay Available Stock */
        if ( isset( $woo_product_listings_settings['pl_is_show_available_stock'] ) ) {
            $options['pl_is_show_available_stock'] = $woo_product_listings_settings['pl_is_show_available_stock'];
        }

        /** Display Out Of Stock */
        if ( isset( $woo_product_listings_settings['pl_is_show_out_of_stock'] ) ) {
            $options['pl_is_show_out_of_stock'] = $woo_product_listings_settings['pl_is_show_out_of_stock'];
        }

        /** Show Filter */
        if ( isset( $woo_product_listings_settings['pl_is_show_filter'] ) ) {
            $options['pl_is_show_filter'] = $woo_product_listings_settings['pl_is_show_filter'];
        } 

        /** Thumbnail Position */
        if ( isset( $woo_general_settings['sp_thumb_position'] ) ) {
            $options['sp_thumb_position'] = $woo_general_settings['sp_thumb_position'];
        }

        /** Fullscreen Product View */
        if ( isset( $woo_general_settings['sp_is_fullscreen_view'] ) ) {
            $options['sp_is_fullscreen_view'] = $woo_general_settings['sp_is_fullscreen_view'];
        }

        /** Show Share Button */
        if ( isset( $woo_general_settings['sp_is_show_share_button'] ) ) {
            $options['sp_is_show_share_button'] = $woo_general_settings['sp_is_show_share_button'];
        }

        /** Show Short Description */
        if ( isset( $woo_general_settings['sp_is_show_short_description'] ) ) {
            $options['sp_is_show_short_description'] = $woo_general_settings['sp_is_show_short_description'];
        }

        /** Show Up Sells Product */
        if ( isset( $woo_general_settings['sp_show_upsells_products'] ) ) {
            $options['sp_show_upsells_products'] = $woo_general_settings['sp_show_upsells_products'];
        }

        /** Number Of Up Sells Product Per Page */
        if ( isset( $woo_general_settings['sp_upsells_product_per_page'] ) ) {
            $options['sp_upsells_product_per_page'] = $woo_general_settings['sp_upsells_product_per_page'];
        }



        /**  Download Link. */
        if ( isset( $color_settings['link'] ) ) {
            $options['link'] = $color_settings['link'];
        }

        $results = wp_parse_args( $options, $defaults );

        $this->options = $results;
    }

    /**
     * Loads the ZiniPOS translated strings.
     *
     * @access public
     * @since 1.0.0
     * @return void
     **/
    public function load_textdomain() {
        load_plugin_textdomain( 'zinipos', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    }

    /**
     * Add plugin styles.
     *
     * @since   1.0.0
     * @return void
     */
    public function enqueue_styles() {
        wp_enqueue_style( 'zs-zinipos', self::$url . 'assets/css/zinipos' . self::$suffix . '.css', [], self::$version );
    }

    /**
     * Add plugin scripts.
     *
     * @return void
     * @since   1.0.0
     **/
    public function enqueue_scripts() {
        wp_enqueue_script( 'jquery' );
    }

    /**
     * Remove media element styles and scripts.
     *
     * @return string
     * @since   1.0.0
     */
    public function remove_media_element() {
        return '';
    }

    /**
     * Add CSS for admin area.
     *
     * @return void
     * @since   1.0.0
     **/
    public function admin_styles() {

        /** Add styles only on setting page */
        $screen = get_current_screen();

        /** ZiniPOS Settings Page. */
        if ( $screen->base === "toplevel_page_zinipos_settings" ) {
            wp_enqueue_style( 'main-ui', self::$url . 'assets/css/main-ui.min.css', array(), self::$version );
            wp_enqueue_style( 'dataTables', self::$url . 'assets/datatables/datatables' . self::$suffix . '.css', [], self::$version );
            wp_enqueue_style( 'zs-zinipos-admin', self::$url . 'assets/css/admin' . self::$suffix . '.css', [], self::$version );
        /** Edit Post/Page. */
        } elseif ( in_array( $screen->post_type, [ 'post', 'page' ] ) && $screen->base != 'edit' ) {
            wp_enqueue_style( 'zs-zinipos-admin-post', self::$url . 'assets/css/admin-post' . self::$suffix . '.css', [], self::$version );
        /** Plugin install page, for style "View version details" popup. */
        } elseif ( 'plugin-install' === $screen->base ) {
            /** Styles only for our plugin. */
	        if ( isset( $_GET['plugin'] )  AND $_GET['plugin'] === 'zinipos' ) {
		        wp_enqueue_style( 'zs-zinipos-plugin-install', self::$url . 'assets/css/plugin-install' . self::$suffix . '.css', [], self::$version );
	        }
        }

    }

    /**
     * Add JS for admin area.
     *
     * @return void
     * @since   1.0.0
     **/
    public function admin_scripts() {

        /** Add styles only on setting page */
        $screen = get_current_screen();

        /** ZiniPOS Settings Page. */
        if ( $screen->base == "toplevel_page_zinipos_settings" ) {
            wp_enqueue_script( 'main-ui', self::$url . 'assets/js/main-ui' . self::$suffix . '.js', array(), self::$version, true );
            wp_enqueue_media(); // WordPress Image library.
            wp_enqueue_script( 'dataTables', self::$url . 'assets/datatables/datatables' . self::$suffix . '.js', [ 'jquery' ], self::$version, true );
            wp_enqueue_script( 'zs-zinipos-admin', self::$url . 'assets/js/admin' . self::$suffix . '.js', ['jquery', 'dataTables'], self::$version, true );

            /** Remove "Thank you for creating with WordPress" and WP version from plugin settings page. */
            add_filter( 'admin_footer_text', '__return_empty_string', 11 );
            add_filter( 'update_footer', '__return_empty_string', 11 );

            /** Edit Post/Page. */
        } elseif ( in_array( $screen->post_type, [ 'post', 'page' ] ) && $screen->base != 'edit' ) {
            wp_enqueue_script( 'zs-admin-post', self::$url . 'assets/js/admin-post' . self::$suffix . '.js', [ 'jquery' ], self::$version, true );
        }

    }

    /**
     * Displays useful links for an activated and non-activated plugin.
     *
     * @since 1.0.3
     **/
    public function support_link() { ?>

        <hr class="mdc-list-divider">
        <h6 class="mdc-list-group__subheader"><?php echo esc_html__( 'Helpful links', 'zinipos' ) ?></h6>

        <a class="mdc-list-item" href="https://zinisoft-net.gitbook.io/zinipos-docs/" target="_blank">
            <i class="material-icons mdc-list-item__graphic" aria-hidden="true"><?php echo esc_html__( 'collections_bookmark' ) ?></i>
            <span class="mdc-list-item__text"><?php echo esc_html__( 'Documentation', 'zinipos' ) ?></span>
        </a>

        <a class="mdc-list-item" href="/wp-admin/admin.php/?page=zinipos_settings&tab=change-log">
            <i class="material-icons mdc-list-item__graphic" aria-hidden="true"><?php echo esc_html__( 'collections_bookmark' ) ?></i>
            <span class="mdc-list-item__text"><?php echo esc_html__( 'Change log', 'zinipos' ) ?></span>
        </a> 
            <a class="mdc-list-item" href="https://codecanyon.net/user/zinisoft" target="_blank">
                <i class="material-icons mdc-list-item__graphic" aria-hidden="true"><?php echo esc_html__( 'mail' ) ?></i>
                <span class="mdc-list-item__text"><?php echo esc_html__( 'Get help', 'zinipos' ) ?></span>
            </a>
            <a class="mdc-list-item" href="https://1.envato.market/cc-downloads" target="_blank">
                <i class="material-icons mdc-list-item__graphic" aria-hidden="true"><?php echo esc_html__( 'thumb_up' ) ?></i>
                <span class="mdc-list-item__text"><?php echo esc_html__( 'Rate this plugin', 'zinipos' ) ?></span>
            </a> 

        <a class="mdc-list-item" href="https://codecanyon.net/user/zinisoft/portfolio" target="_blank">
            <i class="material-icons mdc-list-item__graphic" aria-hidden="true"><?php echo esc_html__( 'store' ) ?></i>
            <span class="mdc-list-item__text"><?php echo esc_html__( 'More plugins', 'zinipos' ) ?></span>
        </a>
        <?php

    }

    /**
     * Run when the plugin is activated.
     *
     * @static
     * @since 2.0.0
     **/
    public static function on_activation() {

        /** Security checks. */
        if ( ! current_user_can( 'activate_plugins' ) ) {
            return;
        }

        $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';
        check_admin_referer( "activate-plugin_{$plugin}" );

	    /** Send install Action to our host. */
	    Helper::get_instance()->send_action( 'install', 'zinipos', self::$version );

    }

    /**
     * Main ZiniPOS Instance.
     *
     * Insures that only one instance of ZiniPOS exists in memory at any one time.
     *
     * @static
     * @return ZiniPOS
     * @since 1.0.0
     **/
    public static function get_instance() {
        if ( ! isset( self::$instance ) && ! ( self::$instance instanceof ZiniPOS ) ) {
            self::$instance = new ZiniPOS;
        }

        return self::$instance;
    }

    /**
     * Throw error on object clone.
     *
     * The whole idea of the singleton design pattern is that there is a single
     * object therefore, we don't want the object to be cloned.
     *
     * @return void
     * @since 1.0.0
     * @access protected
     **/
    public function __clone() {
        /** Cloning instances of the class is forbidden. */
        _doing_it_wrong( __FUNCTION__, esc_html__( 'The whole idea of the singleton design pattern is that there is a single object therefore, we don\'t want the object to be cloned.', 'zinipos' ), self::$version );
    }

    /**
     * Disable unserializing of the class.
     *
     * The whole idea of the singleton design pattern is that there is a single
     * object therefore, we don't want the object to be unserialized.
     *
     * @return void
     * @since 1.0.0
     * @access protected
     **/
    public function __wakeup() {
        /** Unserializing instances of the class is forbidden. */
        _doing_it_wrong( __FUNCTION__, esc_html__( 'The whole idea of the singleton design pattern is that there is a single object therefore, we don\'t want the object to be unserialized.', 'zinipos' ), self::$version );
    }

} // End Class ZiniPOS.

/** Run when the plugin is activated. */
register_activation_hook( __FILE__, ['ZiniSoft\ZiniPOS', 'on_activation'] );

/** Run ZiniPOS class. */
ZiniPOS::get_instance();

Youez - 2016 - github.com/yon3zu
LinuXploit