Plugin Directory

Changeset 3092301


Ignore:
Timestamp:
05/24/2024 08:16:02 PM (20 months ago)
Author:
printerco
Message:

Update plugin version

Location:
cloud-printing-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cloud-printing-for-woocommerce/trunk/includes/class-wc-iconnect.php

    r2952065 r3092301  
    1313require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/printerco-dokan.php';
    1414require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/printerco-plugins-support.php';
     15require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/Store-OpenClose.php';
    1516
    1617if ( ! class_exists( 'WC_Iconnect' ) ) :
     
    3031
    3132    const ICONNECT_DOMAIN = 'http://mypanel.printerco.net/';
    32     // const ICONNECT_DOMAIN = 'https://dev.printerco.net/';
    3333   
    3434    const ICONNECT_RESERVATION_ORDER_URL = self::ICONNECT_DOMAIN . 'api/submitreservationext';
     
    238238    }
    239239
    240 
     240    // IF PRINTER IS INACTIVE THEN ORDER WILL NOT CREATE
     241    public function check_printer_connection()
     242    {
     243        $params                        = array();
     244        $params['req_api_key']         = $this->get_option( 'iconnect_api_key' );
     245        $params['req_api_password']    = $this->get_option( 'iconnect_api_password' );
     246        $params['req_printer_id']      = $this->get_option( 'iconnect_printer_id' );
     247        if($params['req_api_key'] != "" && $params['req_api_password'] != "" && $params['req_printer_id'] != "" )
     248        {
     249        $response      = StoreOpenClose::find_shop_status($params);
     250        $xml           = simplexml_load_string($response);
     251        $printerStatus = (string)$xml->details->printer_status;
     252        if($printerStatus != 'active')
     253        {   
     254            return $printerStatus;
     255        }
     256        return $printerStatus;
     257        }
     258    }
     259   
    241260    public function woocommerce_send_order_to_iconnect($order_id)
    242261    {
     262        $printerStatus   =   "active";
    243263        $this->order = new WC_Order($order_id);
     264        $printerStatus = $this->check_printer_connection();
    244265
    245266        ob_start();
     
    262283        print_r($this->items);
    263284
    264         $this->set_items_info();
    265         $this->order_processing();
     285        if($printerStatus == "active")
     286        {
     287            $this->set_items_info();
     288            $this->order_processing();
     289        }
    266290    }
    267291
     
    507531
    508532        $baseOrder->currency = get_post_meta( $this->order->id, '_order_currency', true );
    509 
     533        if($this->order->currency)
     534        {
     535            $baseOrder->currency = $this->order->currency;
     536        }
     537
     538       
    510539
    511540        $baseOrder->payment_method = $paymentmethod1 = get_post_meta( $this->order->id, '_payment_method_title', true );
    512541        $paymentmethod2 = get_post_meta( $this->order->id, '_payment_method', true );
     542       
     543// updated code - start (19th Apr 2024)
     544        if($this->order->payment_method_title)
     545        {
     546        $baseOrder->payment_method = $paymentmethod1  = $this->order->payment_method_title;   
     547        }
     548       
     549        if($this->order->payment_method)
     550        {
     551        $paymentmethod2 = $this->order->payment_method;   
     552        }
     553// updated code - end
    513554        echo 'Payment method: '.esc_html($paymentmethod1).':'.esc_html($paymentmethod2);
    514555
     
    756797        $baseOrder->tax_amount = null;
    757798    }
     799
     800// VAT IS NOT ADDING THEREFORE ADD BELOW CODE(3rdMay2024):
     801    if($this->order->total_tax)
     802    {
     803        $baseOrder->tax_amount = number_format($this->order->total_tax,2,'.','');   
     804    }   
     805   
    758806// VAT - END
    759807
     
    859907                $item_info_arr['cat'] = '';
    860908            }
    861             $item_meta = new WC_Order_Item_Meta($item['item_meta'], $product);
     909            $item_meta = new WC_Order_Item_Meta($item, $product);
    862910            $item_option_arr = $item_meta->get_formatted();
    863911            $item_info_arr['item'] = $item['name'];
  • cloud-printing-for-woocommerce/trunk/includes/printerco-settings.php

    r2952065 r3092301  
    166166                'options'           => $all_gateway_list,
    167167            ),
     168
     169            'iconnect_shopclose_action' => array(
     170                'title'             => __( 'Allow checkout, if shop is closed?', 'woocommerce-iconnect-api-integration' ),
     171                'type'              => 'select',
     172                'description'       => __( 'Allow customers to checkout/place orders when the shop is closed. ', 'woocommerce-iconnect-api-integration' ),
     173                'desc_tip'          => true,
     174                'default'           => '',
     175                'options'           => array(
     176                    'no'=>'No',
     177                    'yes'=>'Yes',
     178
     179                )
     180            ),
     181            'iconnect_shopclose_message' => array(
     182                'title'             => __( 'Show message if shop is closed', 'woocommerce-iconnect-api-integration' ),
     183                'type'              => 'text',
     184                'description'       => __( 'If shop is closed then this message will show.', 'woocommerce-iconnect-api-integration' ),
     185                'desc_tip'          => true,
     186                'default'           => ''
     187            ),
     188            'iconnect_printer_disconnect' => array(
     189                'title'             => __( 'Allow checkout, if printer is disconnected?', 'woocommerce-iconnect-api-integration' ),
     190                'type'              => 'select',
     191                'description'       => __( 'Allow customers to checkout/place orders when the printer is disconnected. ', 'woocommerce-iconnect-api-integration' ),
     192                'desc_tip'          => true,
     193                'default'           => '',
     194                'options'           => array(
     195                    'no'=>'No',
     196                    'yes'=>'Yes',
     197
     198                )
     199            ),
     200            'iconnect_printerdisconnect_message' => array(
     201                'title'             => __( 'Show message if printer is disconnect', 'woocommerce-iconnect-api-integration' ),
     202                'type'              => 'text',
     203                'description'       => __( 'If printer is disconnect then this message will show.', 'woocommerce-iconnect-api-integration' ),
     204                'desc_tip'          => true,
     205                'default'           => ''
     206            ),
     207
     208
     209
     210           
    168211            'iconnect_debug_mode' => array(
    169212                'title'             => __( 'Debug Mode?', 'woocommerce-iconnect-api-integration' ),
  • cloud-printing-for-woocommerce/trunk/readme.txt

    r2952136 r3092301  
    11=== Cloud Printing for WooCommerce ===
    22Contributors:
    3 Tags: POS printer,Sunmi V2,thermal printer, POS system, WooCommerce POS, WooCommerce order printer, WooCommerce printer, PrinterCo, PrinterCo.net
     3Tags: POS printer,Sunmi V2, Woocommerce automatic order printing, POS system, WooCommerce POS, WooCommerce order printer, WooCommerce printer, PrinterCo, PrinterCo.net, add print button to woocommerce checkout page,restaurant ticket printer
     4
    45Author: PrinterCo.net
    56Requires at least: 4.1.1
    67Requires PHP: 7.0
    7 Tested up to: 6.3
     8Tested up to: 6.5.3
    89Stable tag: 4.1.1
    910License: GPLv2 or later License
    1011URI: http://www.gnu.org/licenses/gpl-2.0.html
    1112WC requires at least: 2.2.10
    12 WC tested up to: 6.0.10
    13 
    14 
    15 This plugin adds on-demand order printing features to the official WooCommerce plugin. Useful for restaurants and takeaways or online stores that need print on demand. It prints orders automatically from woocommerce. If you cancel an order from the printer app the order will be cancelled in woocommerce. An automatic refund can be set or cancelled orders. Compatible with popular restaurant ordering plugin.
    16 
     13WC tested up to: 8.9.1
     14
     15
     16The printing plugin allows orders to be printed manually, but this process is time-consuming and not suitable for restaurants and takeaways with short preparation times. However, the Automatic Order Printing Plugin for WooCommerce by PrinterCo solves this problem. To use it, you must have an account with PrinterCo. This plugin automatically prints orders from WooCommerce to the PrinterCo POS terminal or any POS printer you already have. The supported printers are listed here. It is compatible with popular restaurant ordering plugins and supports a variety of printers. With just a few clicks, this plugin enables automatic order printing for your WooCommerce store.
    1717== Description ==
    1818
    19 
    20 This plugin extends on top of the features provided by the official WooCommerce plugin.
    21 It enables your WooCommerce web store with cloud printing capabilities via a PrinterCo mini POS printer.
    22 It is the ideal solution for businesses that need their online orders printed out on demand!
     19The printing plugin allows orders to be printed manually, but this process is time-consuming and not suitable for restaurants and takeaways with short preparation times. However, the Automatic Order Printing Plugin for WooCommerce by PrinterCo solves this problem. To use it, you must have an account with PrinterCo. This plugin automatically prints orders from WooCommerce to the PrinterCo POS terminal or any POS printer you already have. The supported printers are listed here. It is compatible with popular restaurant ordering plugins and supports a variety of printers. With just a few clicks, this plugin enables automatic order printing for your WooCommerce store.
    2320
    2421
     
    2623Cancel an order from the printer app and it will be automatically cancelled on your woo-commerce website and will issue a refund.
    2724Set a delivery or collection time while accepting an order
     25Open/Close the shop from the printer app to allow or prevent the customer to checkout.
    2826Select and assign a driver to collect the item and deliver it.
    2927Set automated printing at a busy hour
     
    284282* Some known bugs and warnings were fixed
    285283
     284= 2.8.0
     285* Some known bugs were fixed.
     286* Now you can disble the checkout when the shop is closed from the app.
     287* Now you can prevent the checkout when the printer is disconnected.
     288
    286289== Upgrade Notice ==
    287290
  • cloud-printing-for-woocommerce/trunk/woocommerce-iconnect.php

    r2952065 r3092301  
    4040            require_once 'includes/PrintercoRefund.php';
    4141            require_once 'includes/PrintercoOrderCallback.php';
     42            require_once 'includes/Store-OpenClose.php';
    4243            // Register the integration.
    4344            add_filter( 'woocommerce_integrations', array( $this, 'add_integration' ) );
     
    5354        $integrations[] = 'WC_Iconnect';
    5455        $integrations[] = 'PrintercoEmailEditor';
     56        $integrations[] = 'StoreOpenClose';                                       
    5557        return $integrations;
    5658    }
Note: See TracChangeset for help on using the changeset viewer.