function meta_box() { global $woocommerce, $post; $order = new WC_Order($post->ID); $order_discount = $order->get_total_discount(); $order_tax = $order->get_total_tax(); $order_subtotal = $order->get_subtotal_to_display(); $order_total = $order->get_formatted_order_total(); get_payment_gateway_fields('paypal'); woocommerce_wp_select(array('id' => 'payment_type', 'label' => '', 'value' => 'default', 'options' => ins_get_payment_methods(), 'class' => 'chosen-select')); woocommerce_wp_select(array('id' => 'add_coupon', 'label' => '', 'value' => 'default', 'options' => ins_get_coupons(), 'class' => 'chosen-select')); woocommerce_wp_text_input(array('id' => 'sub_total', 'label' => __('Order Subtotal', 'instore'), 'placeholder' => 0.0, 'value' => $order_subtotal)); woocommerce_wp_text_input(array('id' => 'order_tax', 'label' => __('Order Tax', 'instore'), 'placeholder' => 0.0, 'value' => $order_tax)); woocommerce_wp_text_input(array('id' => 'applied_discount', 'label' => __('Applied Discount', 'instore'), 'placeholder' => 0.0, 'value' => $order_discount)); }
public function init_form_fields() { global $woocommerce; $this->form_fields = array('enabled' => array('title' => __('Enable In-Store Point of Sale', 'instore'), 'type' => 'checkbox', 'label' => __('Enable/Disable', 'instore'), 'default' => 'no'), 'title' => array('title' => __('Business Address Settings', 'instore'), 'type' => 'title', 'description' => __('Enter business address information for reports and receipts', 'instore')), 'business_name' => array('title' => __('Business Name', 'instore'), 'type' => 'text', 'description' => __('Enter legal business name, event title, etc', 'instore')), 'business_address_1' => array('title' => __('Business Address 1', 'instore'), 'type' => 'text', 'description' => __('Street Address, PO Box', 'instore')), 'business_address_2' => array('title' => __('Business Address 2', 'instore'), 'type' => 'text', 'description' => __('Suite, Unit, Apt', 'instore')), 'business_city' => array('title' => __('Business City', 'instore'), 'type' => 'text', 'description' => ''), 'business_state' => array('title' => __('Business State', 'instore'), 'type' => 'text', 'description' => ''), 'business_zipcode' => array('title' => __('Business City', 'instore'), 'type' => 'text', 'description' => ''), 'business_phone' => array('title' => __('Business Phone', 'instore'), 'type' => 'text', 'description' => __('Phone number will be formatted automatically', 'instore')), 'business_email' => array('title' => __('Business Email', 'instore'), 'type' => 'email', 'description' => __('Enter a valid email address', 'instore')), 'title' => array('title' => __('Security Settings', 'instore'), 'type' => 'title', 'description' => __('The following settings determine Point of Sale security options', 'instore')), 'timeout_enabled' => array('title' => __('Enable Security Timeout', 'instore'), 'type' => 'checkbox', 'label' => __('Recommended: Enable this option to lock out the Point of Sale page when inactive for a specified period of time.', 'instore'), 'default' => 'yes'), 'timeout' => array('title' => __('Security Timeout Settings', 'instore'), 'type' => 'select', 'description' => __('Select maximum period of inactivity before timeout', 'instore'), 'default' => '10min', 'options' => array('5min' => __('5 minutes', 'instore'), '10min' => __('10 minutes', 'instore'), '15min' => __('15 minutes', 'instore'), '20min' => __('20 minutes', 'instore'), '30min' => __('30 minutes', 'instore'), '1hour' => __('1 hour', 'instore'), 'manual' => __('Manual', 'instore'))), 'login_method' => array('title' => __('Login Method', 'instore'), 'type' => 'select', 'default' => 'login_password', 'options' => array('login_password' => __('WordPress Login'), 'password' => __('Wordpress Password'), 'user_pin' => __('User Pin'))), 'force_ssl' => array('title' => __('Force SSL Encryption', 'instore'), 'type' => 'checkbox', 'default' => 'no', 'description' => __('Forces Secure Socket Layer Security on Point of Sale page for added security and data transmission. Requires SSL Certificate.', 'instore')), 'address_on_receipt' => array('title' => __('Address On Receipt', 'instore'), 'type' => 'checkbox', 'default' => 'no', 'description' => __('Determines whether address in added to top of sales receipts', 'instore')), 'return_policy' => array('title' => __('Add Return Policy', 'instore'), 'type' => 'textarea', 'description' => __('Add your return/exchange policy here to be displayed on receipt footer.', 'instore'), 'default' => ''), 'receipt_message' => array('title' => __('Add Special Message', 'instore'), 'type' => 'textarea', 'description' => __('Add a special message for your customers. Great for holidays and store specials.', 'instore'), 'default' => ''), 'logo_on_receipt' => array('title' => __('Receipt Logo', 'instore'), 'type' => 'file', 'description' => __('Click to add your logo to the reciept header.', 'instore'), 'default' => ''), 'user_on_receipt' => array('title' => __('Include Cashier on Receipt', 'instore'), 'type' => 'checkbox', 'label' => __('Check if you would like cashier first name and last initial to appear on receipt.', 'instore'), 'default' => 'yes'), 'print_coupons' => array('title' => __('Print Coupons', 'instore'), 'type' => 'checkbox', 'label' => __('Check to print selected coupon with each sale.', 'instore'), 'default' => ''), 'current_coupon' => array('title' => __('Select Coupon', 'instore'), 'type' => 'select', 'description' => __('Select the desired coupon you would like to print', 'instore'), 'options' => ins_get_coupons()), 'authorized_devices' => array('type' => 'device_registration')); }