Plugin Directory

Changeset 2503287


Ignore:
Timestamp:
03/25/2021 01:47:41 PM (5 years ago)
Author:
transdirect
Message:

Performance Improvement

Location:
transdirect-shipping
Files:
36 added
8 edited

Legend:

Unmodified
Added
Removed
  • transdirect-shipping/trunk/includes/order_sync.php

    r2352210 r2503287  
    44 *
    55 * @author      Transdirect
    6  * @version     7.5
     6 * @version     7.6
    77 */
    88
     
    6262        }
    6363
     64            if(empty(get_post_meta($order->id,'_shipping_company',true)))
     65            {
     66                $buyer_name = $order->shipping_first_name .' '. $order->shipping_last_name;
     67            }
     68            else
     69            {
     70                $buyer_name = get_post_meta($order->id,'_shipping_company',true);
     71            }
     72            if(empty($order->completed_date))
     73            {
     74              $date = $order->get_date_paid();
     75              if(!empty($date))
     76              {
     77                $paid_date = $date->format('Y-m-d H:i:s'); 
     78              }
     79            }
     80            else
     81            {
     82              $paid_date = $order->completed_date;
     83            }
     84
    6485        $sku = substr($sku, 1);
    6586        $item_des = substr($item_des, 1);
     
    7899            $api_array['selected_courier']      = strtolower($selected_courier);
    79100            $api_array['courier_price']         = $order->get_total_shipping();
    80             $api_array['paid_time']             = $order->completed_date;
    81             $api_array['buyer_name']            = get_post_meta($order->id,'_shipping_company',true);
     101            $api_array['paid_time']             = $paid_date;
     102            $api_array['buyer_name']            = $buyer_name;
    82103           // $api_array['buyer_name']        = $order->billing_first_name .' '. $order->billing_last_name;
    83104            $api_array['buyer_email']           = $order->billing_email;
     
    135156            }
    136157
     158            if(empty(get_post_meta($order->id,'_shipping_company',true)))
     159            {
     160                $buyer_name = $order->shipping_first_name .' '. $order->shipping_last_name;
     161            }
     162            else
     163            {
     164                $buyer_name = get_post_meta($order->id,'_shipping_company',true);
     165            }
     166            if(empty($order->completed_date))
     167            {
     168              $date = $order->get_date_paid();
     169              if(!empty($date))
     170              {
     171                $paid_date = $date->format('Y-m-d H:i:s'); 
     172              }
     173            }
     174            else
     175            {
     176              $paid_date = $order->completed_date;
     177            }
     178
    137179            $api_array['order_id']          = $order->id;
    138180            $api_array['imported_from']     = 'Woocommerce';
     
    140182            $api_array['sale_price']        = number_format($sale_price, 2);
    141183            $api_array['courier_price']     = $order->get_total_shipping();
    142             $api_array['paid_time']         = $order->completed_date;
    143              $api_array['buyer_name']      = get_post_meta($order->id,'_shipping_company',true);
     184            $api_array['paid_time']         =  $paid_date;
     185             $api_array['buyer_name']      = $buyer_name;
    144186           // $api_array['buyer_name']        = $order->billing_first_name .' '. $order->billing_last_name;
    145187            $api_array['buyer_email']       = $order->billing_email;
     
    161203    // Sync new order in transdirect when cron running
    162204    public function td_create_order(){ 
    163 
     205       
    164206        if((isset(td_getApiDetails()->enable_sync) && td_getApiDetails()->enable_sync == 'on') || (isset(td_getApiDetails()->sync_all_order) && td_getApiDetails()->sync_all_order == 'on' || td_getApiDetails()->mode == 'no_display_mode')){
    165207
  • transdirect-shipping/trunk/includes/product_sync.php

    r2352210 r2503287  
    44 *
    55 * @author      Transdirect
    6  * @version     7.5
     6 * @version     7.6
    77 */
    88
  • transdirect-shipping/trunk/includes/quotes.php

    r2352210 r2503287  
    44 *
    55 * @author      Transdirect
    6  * @version     7.5
     6 * @version     7.6
    77 */
    88
  • transdirect-shipping/trunk/includes/scripts.php

    r2352210 r2503287  
    44 *
    55 * @author      Transdirect
    6  * @version    7.5
     6 * @version    7.6
    77 */
    88
  • transdirect-shipping/trunk/readme.txt

    r2314894 r2503287  
    33Tags: transdirect, quote, quotes, quick quotes, courier, couriers, freight, freights, shipping, delivery, toll, toll ipec, fastway, couriers please, toll priority, northline, cart, checkout, configurable, woocommerce, woo-commerce, ecommerce, e-commerce, commerce, wordpress ecommerce
    44Requires at least: 4.2
    5 Tested up to: 5.4.1
     5Tested up to: 5.7
    66License: GPLv3
    77License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • transdirect-shipping/trunk/templates/part_htm.php

    r2352210 r2503287  
    55 *
    66 * @author      Transdirect
    7  * @version     7.5
     7 * @version     7.6
    88 */
    99
  • transdirect-shipping/trunk/templates/transdirect-calculator.php

    r2352210 r2503287  
    44 *
    55 * @author      Transdirect
    6  * @version     7.5
     6 * @version     7.6
    77 */
    88
  • transdirect-shipping/trunk/transdirect_shipping.php

    r2352210 r2503287  
    66 * Description: This plugin allows you to calculate shipping as per your delivery location.
    77 * FAQ: https://www.transdirect.com.au/e-commerce/woo-commerce/
    8  * Version: 7.5
     8 * Version: 7.6
    99 * Author: Transdirect
    1010 * Author URI: https://transdirect.com.au/
     
    188188                       
    189189                        $rate = array(
    190                             'id'        => $this->id,
     190                             'id'        => $this->id,
    191191                            'label'     => $label,
    192192                            'cost'      => $_COOKIE['price'],
Note: See TracChangeset for help on using the changeset viewer.