Plugin Directory

Changeset 2403263


Ignore:
Timestamp:
10/20/2020 02:38:54 PM (5 years ago)
Author:
doorhub2020
Message:

updated removed the datetime

Location:
doorhub/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • doorhub/trunk/README.md

    r2377291 r2403263  
    44Requires at least: 3.0.1
    55Tested up to: 5.4.1
    6 Stable tag: 1.0.7
     6Stable tag: 1.0.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • doorhub/trunk/admin/partials/order-doorhub-metabox.php

    r2313026 r2403263  
    1818                <span><?php echo $dhOrder->order->deliveryCharge ?></span>
    1919            </p>
    20             <p class="form-field ">
    21                 <label><?php echo __( 'Pickup Date:', 'wc-doorhub' ) ?></label>
    22                 <span><?php echo $order->get_meta( 'dropoff_date' ) ?></span>
    23             </p>
     20            <!--<p class="form-field ">
     21                <label><?php /*echo __( 'Pickup Date:', 'wc-doorhub' ) */?></label>
     22                <span><?php /*echo $order->get_meta( 'dropoff_date' ) */?></span>
     23            </p>-->
    2424            <p class="form-field ">
    2525                <label><?php echo __( 'Distribution:', 'wc-doorhub' ) ?></label>
  • doorhub/trunk/includes/class-wc-doorhub-communicator.php

    r2377289 r2403263  
    44 * The file that defines the communication class for Doorhub
    55 *
    6  * @link       https://doorhub.io
     6 * @link       http://doorhub.io
    77 * @since      1.0.0
    88 *
     
    2121     */
    2222    protected $api_key;
     23    protected $api_url;
    2324
    2425    /**
     
    2930    public function __construct() {
    3031        $this->api_key = get_option( 'wc_doorhub_api' );
     32        $this->api_url = 'https://test.doorhub.io';
    3133    }
    3234
     
    5456            'customerName'   => $order->get_shipping_first_name() . ' ' . $order->get_shipping_last_name(),
    5557            'customerPhone'  => $order->get_billing_phone(),
    56             'customerFloor'  => 11,
     58            'customerFloor'  => 1,
    5759            'productSize'    => 'medium',
    58             'companyId'      => 1,
    5960            'warehouseId'    => get_option('wc_doorhub_warehouse'),
    60 //          "description"    => "this is test",
    6161            'deliveryId'     => $order->get_id(),
    62 //          'deliveryId'     => $order->get_id() + 1,
    6362            'dateForDropOff' => $pickup_date,
    64             'distributionId' => $order->get_meta('doorhub_distribution'),
    65 //          'regionId'       => 2,
     63            'distributionId' => 1,
    6664            'deliveryType'  =>  1,
     65            'plugin' => ['name' => 'woocommerce']
    6766        );
    6867
    69         $response = $this->request( 'https://doorhub.io/api/sameday/v1/warehouse/order/checkout', $data );
     68        $response = $this->request( $this->api_url.'/api/sameday/v1/warehouse/order/checkout', $data );
    7069
    7170        //Update Information Back to Order
     
    9392        if($this->has_doorhub($order) && $data['orderRef']) {
    9493            if($data['orderRef']) {
    95                 $response = $this->request('https://doorhub.io/api/sameday/v1/warehouse/order/cancel', $data, 'patch');
     94                $response = $this->request($this->api_url.'/api/sameday/v1/warehouse/order/cancel', $data, 'patch');
    9695                update_post_meta( $order->get_id(), 'doorhub_response', $response );
    9796            }
     
    105104     */
    106105    public function get_current_warehouse() {
    107         $response = $this->request('https://doorhub.io/api/sameday/v1/company/warehouse', array(), 'get');
     106        $response = $this->request($this->api_url.'/api/sameday/v1/company/warehouse/'.get_option('wc_doorhub_warehouse'), array(), 'get');
    108107
    109108        if ( isset( $response->success ) && $response->success ) {
    110             foreach ($response->data->warehouse as $warehouse) {
    111                 if($warehouse->warehouseId == get_option('wc_doorhub_warehouse')) {
    112                     return $warehouse;
    113                 }
    114             }
     109            return $response->data;
    115110        }
    116111
     
    126121    public function get_single_order($orderRef) {
    127122
    128         $response = $this->request("https://doorhub.io/api/sameday/v1/warehouse/order/$orderRef/show", array(), 'get');
     123        $response = $this->request($this->api_url."/api/sameday/v1/warehouse/order/$orderRef/show", array(), 'get');
    129124
    130125        if ( isset( $response->success ) && $response->success ) {
     
    146141        $data['storeId'] = get_option('wc_doorhub_warehouse');
    147142
    148         return $this->request( 'https://doorhub.io/api/sameday/v1/warehouse/customer/address/check', $data );
     143        return $this->request( $this->api_url.'/api/sameday/v1/warehouse/customer/address/check', $data );
    149144    }
    150145
  • doorhub/trunk/public/class-wc-doorhub-public.php

    r2339711 r2403263  
    107107
    108108            //Loading jQuery UI for datepicker
    109             wp_enqueue_script( 'jquery-ui-datepicker' );
     109            //wp_enqueue_script( 'jquery-ui-datepicker' );
    110110
    111111            //verification of order datetime js file
    112             $response = $this->api->get_current_warehouse();
     112            /*$response = $this->api->get_current_warehouse();
    113113            wp_register_script( 'datejs', plugin_dir_url( __FILE__ ) . 'js/wc-doorhub-checkout-date.js', array( 'jquery' ), $this->version, false );
    114114            wp_enqueue_script( 'datejs' );
    115             wp_localize_script( 'datejs', 'date_data', json_encode( $response ) );
     115            wp_localize_script( 'datejs', 'date_data', json_encode( $response ) );*/
    116116        }
    117117
     
    140140    public function register_query_vars( $vars ) {
    141141        $vars[] = 'dh-order-id';
     142
    142143        $vars[] = 'dh-redirect';
    143144
     
    175176        }
    176177
    177         $response = $this->api->get_current_warehouse();
     178        /*$response = $this->api->get_current_warehouse();
    178179        $distriId = $order->get_meta( 'doorhub_distribution' );
    179180        foreach ($response->distribution as $distribution) {
     
    185186        if ( $order->get_meta( 'dropoff_date' )) {
    186187            require_once plugin_dir_path( __FILE__ ) . 'partials/wc-doorhub-public-display.php';
    187         }
     188        }*/
    188189    }
    189190
     
    211212    public function delivery_date_field_new( $fields ) {
    212213
    213         $fields['order']['dropoff_date'] = array(
     214        /*$fields['order']['dropoff_date'] = array(
    214215            'label'       => __( 'Dropoff Date <span class="required">*</span>', 'wc-doorhub' ),
    215216            'placeholder' => _x( 'YYYY-MM-DD', 'placeholder', 'wc-doorhub' ),
     
    221222            'type'        => 'text',
    222223            'default'     => current_time( 'Y-m-d' )
    223         );
     224        );*/
    224225
    225226        $distributions = [];
    226         $response = $this->api->get_current_warehouse();
     227        /*$response = $this->api->get_current_warehouse();
    227228
    228229        if(!isset($response->distribution)) {
     
    232233        foreach ($response->distribution as $distribution) {
    233234            $distributions[$distribution->id] = $distribution->starTime . ' - ' . $distribution->endTime;
    234         }
     235        }*/
    235236
    236237        $fields['order']['doorhub_distribution'] = array(
     
    250251     * Validate Dropoff date and time
    251252     */
    252     public function delivery_date_field_validate() {
     253    /*public function delivery_date_field_validate() {
    253254        if(in_array('wc_doorhub', $_POST['shipping_method'])) {
    254255            if ( !isset( $_POST['dropoff_date'] ) ||
     
    265266        }
    266267
    267     }
     268    }*/
    268269
    269270    /**
     
    271272     * @param $order_id
    272273     */
    273     public function delivery_date_field_store( $order_id ) {
     274    /*public function delivery_date_field_store( $order_id ) {
    274275        if(in_array('wc_doorhub', $_POST['shipping_method'])) {
    275276            update_post_meta( $order_id, 'dropoff_date', sanitize_text_field($_POST['dropoff_date']) );
    276277            update_post_meta( $order_id, 'doorhub_distribution', sanitize_text_field($_POST['doorhub_distribution']) );
    277278        }
    278     }
     279    }*/
    279280
    280281
  • doorhub/trunk/public/partials/wc-doorhub-public-display.php

    r2313026 r2403263  
    11<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
    22
    3     <li class="woocommerce-order-overview__order order">
    4         <?php echo __( 'Dropoff Date:', 'wc-doorhub' ) ?>
    5         <strong><?php echo $order->get_meta( 'dropoff_date' ) ?></strong>
    6     </li>
     3    <!--<li class="woocommerce-order-overview__order order">
     4        <?php /*echo __( 'Dropoff Date:', 'wc-doorhub' ) */?>
     5        <strong><?php /*echo $order->get_meta( 'dropoff_date' ) */?></strong>
     6    </li>-->
    77
    88    <li class="woocommerce-order-overview__order order">
  • doorhub/trunk/readme.txt

    r2377291 r2403263  
    44Requires at least: 3.0.1
    55Tested up to: 5.4.1
    6 Stable tag: 1.0.7
     6Stable tag: 1.0.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.