Plugin Directory

Changeset 2407508


Ignore:
Timestamp:
10/27/2020 11:22:45 AM (5 years ago)
Author:
doorhub2020
Message:

release the version 1.1.1

Location:
doorhub
Files:
41 added
6 edited

Legend:

Unmodified
Added
Removed
  • doorhub/tags/1.1.0/wc-doorhub.php

    r2405210 r2407508  
    1414 * Plugin Name:       Doorhub
    1515 * Description:       You can easily integrate Doorhub.io using this plugin
    16  * Version:           1.1.0
     16 * Version:           1.1.1
    1717 * Author:            Doorhub
    1818 * Author URI:        https://doorhub.io
  • doorhub/trunk/README.md

    r2405210 r2407508  
    44Requires at least: 3.0.1
    55Tested up to: 5.4.1
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • doorhub/trunk/includes/class-wc-doorhub-communicator.php

    r2405210 r2407508  
    3131        $this->api_key = get_option( 'wc_doorhub_api' );
    3232        $this->api_url = 'https://doorhub.io';
     33
    3334    }
    3435
     
    4647        }
    4748
    48 
    49         $address = WC()->countries->get_formatted_address( $order->get_address( 'shipping' ), ', ' );
    50 
    51         $pickup_date = $order->get_meta( 'shipping_pickup' );
    52         $pickup_date = $pickup_date ? $pickup_date : current_time( 'Y-m-d' );
    53 
    54         $data = array(
    55             'dropOffAddress' => $address,
    56             'customerName'   => $order->get_shipping_first_name() . ' ' . $order->get_shipping_last_name(),
    57             'customerPhone'  => $order->get_billing_phone(),
    58             'customerFloor'  => 1,
    59             'productSize'    => 'medium',
    60             'warehouseId'    => get_option('wc_doorhub_warehouse'),
    61             'deliveryId'     => $order->get_id(),
    62             'dateForDropOff' => $pickup_date,
    63             'distributionId' => 1,
    64             'deliveryType'  =>  1,
    65             'plugin' => ['name' => 'woocommerce']
    66         );
    67 
    68         $response = $this->request( $this->api_url.'/api/sameday/v1/warehouse/order/checkout', $data );
    69 
    70         //Update Information Back to Order
    71         update_post_meta( $order->get_id(), 'doorhub_response', $response );
    72         if ( isset( $response->success ) && $response->success ) {
    73             update_post_meta( $order->get_id(), 'doorhub_order_ref', $response->data->orderRef );
    74             update_post_meta( $order->get_id(), 'doorhub_service', $response->data->serviceName );
    75         }
    76 
    77         return $response;
     49        $shipping_method = $order->get_shipping_method();
     50
     51        //error_log($shipping_method);
     52
     53        if($shipping_method == 'Doorhub Shipping'){
     54            $address = WC()->countries->get_formatted_address( $order->get_address( 'shipping' ), ', ' );
     55
     56            $pickup_date = $order->get_meta( 'shipping_pickup' );
     57            $pickup_date = $pickup_date ? $pickup_date : current_time( 'Y-m-d' );
     58
     59            $data = array(
     60                'dropOffAddress' => $address,
     61                'customerName'   => $order->get_shipping_first_name() . ' ' . $order->get_shipping_last_name(),
     62                'customerPhone'  => $order->get_billing_phone(),
     63                'customerFloor'  => 1,
     64                'productSize'    => 'medium',
     65                'warehouseId'    => get_option('wc_doorhub_warehouse'),
     66                'deliveryId'     => $order->get_id(),
     67                'dateForDropOff' => $pickup_date,
     68                'distributionId' => 1,
     69                'deliveryType'  =>  1,
     70                'plugin' => ['name' => 'woocommerce']
     71            );
     72
     73            $response = $this->request( $this->api_url.'/api/sameday/v1/warehouse/order/checkout', $data );
     74
     75            //Update Information Back to Order
     76            update_post_meta( $order->get_id(), 'doorhub_response', $response );
     77            if ( isset( $response->success ) && $response->success ) {
     78                update_post_meta( $order->get_id(), 'doorhub_order_ref', $response->data->orderRef );
     79                update_post_meta( $order->get_id(), 'doorhub_service', $response->data->serviceName );
     80            }
     81
     82            return $response;
     83        }
    7884    }
    7985
     
    141147        $data['storeId'] = get_option('wc_doorhub_warehouse');
    142148
    143         return $this->request( $this->api_url.'/api/sameday/v1/warehouse/customer/address/check', $data );
     149        $response = $this->request( $this->api_url.'/api/sameday/v1/warehouse/customer/address/check', $data );
     150
     151        return $response;
    144152    }
    145153
  • doorhub/trunk/includes/class-wc-doorhub.php

    r2313026 r2407508  
    7676            $this->version = WC_DOORHUB_VERSION;
    7777        } else {
    78             $this->version = '1.0.0';
     78            $this->version = '1.1.0';
    7979        }
    8080        $this->plugin_name = 'wc-doorhub';
  • doorhub/trunk/readme.txt

    r2405210 r2407508  
    44Requires at least: 3.0.1
    55Tested up to: 5.4.1
    6 Stable tag: 1.1.0
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • doorhub/trunk/wc-doorhub.php

    r2405210 r2407508  
    1414 * Plugin Name:       Doorhub
    1515 * Description:       You can easily integrate Doorhub.io using this plugin
    16  * Version:           1.1.0
     16 * Version:           1.1.1
    1717 * Author:            Doorhub
    1818 * Author URI:        https://doorhub.io
     
    3333 * Rename this for your plugin and update it as you release new versions.
    3434 */
    35 define( 'WC_DOORHUB_VERSION', '1.1.0' );
     35define( 'WC_DOORHUB_VERSION', '1.1.1' );
    3636
    3737/**
Note: See TracChangeset for help on using the changeset viewer.