Changeset 3063365
- Timestamp:
- 04/03/2024 07:40:45 AM (2 years ago)
- Location:
- ship-depot/trunk
- Files:
-
- 36 edited
-
Ship_Depot_init.php (modified) (2 diffs)
-
assets/css/fe-checkout.css (modified) (1 diff)
-
assets/js/fe-checkout.js (modified) (1 diff)
-
helper/class-function-helper.php (modified) (5 diffs)
-
helper/class-ship-depot-log.php (modified) (3 diffs)
-
includes/Address/frontend/class-custom-checkout-fields.php (modified) (2 diffs)
-
includes/Model/FeeSetting/class-fee-markup-courier-condition.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-markup-courier-service.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-markup-option.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-markup-order-condition.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-markup-time-condition.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-markup.php (modified) (1 diff)
-
includes/Model/FeeSetting/class-fee-settings.php (modified) (1 diff)
-
includes/Model/ShippingFee/class-courier-response.php (modified) (1 diff)
-
includes/Model/ShippingFee/class-shipping-fee-info.php (modified) (1 diff)
-
includes/Model/ShippingFee/class-shipping-fee-response.php (modified) (1 diff)
-
includes/Model/class-cod-failed-notice.php (modified) (1 diff)
-
includes/Model/class-cod-failed.php (modified) (1 diff)
-
includes/Model/class-cod.php (modified) (1 diff)
-
includes/Model/class-coupon.php (modified) (1 diff)
-
includes/Model/class-courier.php (modified) (1 diff)
-
includes/Model/class-district.php (modified) (1 diff)
-
includes/Model/class-insurance.php (modified) (1 diff)
-
includes/Model/class-item.php (modified) (1 diff)
-
includes/Model/class-package.php (modified) (1 diff)
-
includes/Model/class-province.php (modified) (1 diff)
-
includes/Model/class-receiver.php (modified) (1 diff)
-
includes/Model/class-ship-from-station.php (modified) (1 diff)
-
includes/Model/class-ship-station.php (modified) (1 diff)
-
includes/Model/class-shop-info.php (modified) (1 diff)
-
includes/Order/class-order-shipping.php (modified) (7 diffs)
-
includes/class-ship-depot-general.php (modified) (2 diffs)
-
page/admin/orders/sd-order-detail.php (modified) (4 diffs)
-
page/frontend/sd-checkout-page.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
-
rest-api/class-shipdepot-webhook.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ship-depot/trunk/Ship_Depot_init.php
r3043421 r3063365 5 5 * Plugin URI: https://shipdepot.vn/ 6 6 * Description: Ship Depot support shipping couriers in Vietnam like GHN, GHTK, AhaMove. 7 * Version: 1.2.1 47 * Version: 1.2.15 8 8 * Author: ShipDepot.vn 9 9 * Text Domain: ship-depot-translate … … 35 35 36 36 if (!defined('SHIP_DEPOT_VERSION')) { 37 define('SHIP_DEPOT_VERSION', '1.2.1 4');37 define('SHIP_DEPOT_VERSION', '1.2.15'); 38 38 } 39 39 -
ship-depot/trunk/assets/css/fe-checkout.css
r3014505 r3063365 34 34 } 35 35 36 #sd_reload_shipping { 37 text-decoration: none; 38 background-color: #0064ff; 39 color: #ffffff; 40 border: none; 41 padding: 10px 20px; 42 border-radius: 10px; 43 cursor: pointer; 44 } 45 36 46 @media screen and (max-width: 599px) { 37 47 /* .courier-fee { -
ship-depot/trunk/assets/js/fe-checkout.js
r3014505 r3063365 521 521 }); 522 522 }); 523 524 $('form[name=checkout]').on('click', '#sd_reload_shipping', function (event) 525 { 526 $(document.body).trigger('update_checkout'); 527 }); 528 529 function CallValidate() 530 { 531 if ($('#sd_call_validate').length == 0) 532 { 533 $('form[name=checkout]').append('<input type="hidden" id="sd_call_validate" name="sd_call_validate" value="1">'); 534 } 535 else 536 { 537 $('#sd_call_validate').val('1'); 538 } 539 $('#place_order').click(); 540 } 541 523 542 } 524 543 -
ship-depot/trunk/helper/class-function-helper.php
r3015313 r3063365 172 172 { 173 173 Ship_Depot_Logger::wrlog('[http_post] url: ' . $url); 174 Ship_Depot_Logger::wrlog('[http_post] body_input: ' . print_r($body_input, true));174 // Ship_Depot_Logger::wrlog('[http_post] body_input: ' . print_r($body_input, true)); 175 175 Ship_Depot_Logger::wrlog('[http_post] json_body_input: ' . print_r(json_encode($body_input), true)); 176 176 Ship_Depot_Logger::wrlog('[http_post] header_input: ' . print_r($header_input, true)); 177 $header = array('Content-Type' => 'application/json'); 177 $header = array(); 178 $header['Expect'] = ''; 178 179 foreach ($header_input as $key => $value) { 179 $header = array($key => $value);180 $header[$key] = $value; 180 181 } 181 182 … … 184 185 esc_url($url), 185 186 array( 186 'timeout' => 45,187 187 'headers' => $header, 188 188 'body' => $body_input … … 195 195 Ship_Depot_Logger::wrlog('[http_post] output: ' . print_r($output, true)); 196 196 if (is_wp_error($response)) { 197 Ship_Depot_Logger::wrlog("[http_post] Reponse WP Error. ");197 Ship_Depot_Logger::wrlog("[http_post] Reponse WP Error. Message: " . print_r($response, true)); 198 198 $result->Code = -1000; 199 199 $result->Msg = $response->get_error_message(); … … 201 201 } else if (!$output || $http_code != 200) { 202 202 Ship_Depot_Logger::wrlog("[http_post] HTTP Error or Output error."); 203 Ship_Depot_Logger::wrlog("[http_post] http_code: " . $http_code); 203 204 $result->Code = -1001; 204 205 $msg = 'HTTP POST error. Error message: Connection Failure.'; … … 463 464 } 464 465 } 466 467 // add_action('http_api_debug', function ($response, $context, $class, $parsed_args, $url) { 468 // Ship_Depot_Logger::wrlog('[http_api_debug_hook] $url: ' . print_r($url, true)); 469 // Ship_Depot_Logger::wrlog('[http_api_debug_hook] $parsed_args: ' . print_r($parsed_args, true), 99999); 470 // Ship_Depot_Logger::wrlog('[http_api_debug_hook] $response: ' . print_r($response, true), 99999); 471 // }, 10, 5); -
ship-depot/trunk/helper/class-ship-depot-log.php
r2922618 r3063365 14 14 * @version 4.0.0 15 15 */ 16 public static function wrlog($message )16 public static function wrlog($message, $limit_length = 500) 17 17 { 18 18 if (!class_exists('WC_Logger')) { … … 27 27 if (empty(self::$logger)) { 28 28 self::$logger = wc_get_logger(); 29 } 30 31 if (strlen($message) > $limit_length) { 32 $message = '---------------- Sub string 0-' . $limit_length . "---------------- \n" . substr($message, 0, $limit_length) . "\n" . '---------------- End sub string ----------------'; 29 33 } 30 34 … … 50 54 mkdir($log_filename, 0777, true); 51 55 } 52 56 53 57 $log_file_data = $log_filename . '/ship-depot-log_' . date('d-M-Y') . '.log'; 54 58 // if you don't add `FILE_APPEND`, the file will be erased each time you add a log -
ship-depot/trunk/includes/Address/frontend/class-custom-checkout-fields.php
r3043419 r3063365 25 25 26 26 $fields[$item][$item . '_city'] = array( 27 'label' => esc_html__('Tỉnh/Thành Phố', ' '),27 'label' => esc_html__('Tỉnh/Thành Phố', 'ship-depot-translate'), 28 28 'required' => true, 29 29 'description' => '', … … 141 141 142 142 143 // add_filter('__experimental_woocommerce_blocks_register_checkout_field', 'custom_register_checkout_field'); 144 145 // function custom_register_checkout_field($fields) 146 // { 147 // // Replace 'custom_field' with your desired field name 148 // $fields['gov-id'] = array( 149 // 'label' => 'Government ID', 150 // 'optionalLabel' => 'Government ID (optional)', 151 // 'location' => 'address', 152 // 'required' => true, 153 // 'attributes' => array( 154 // 'autocomplete' => 'government-id', 155 // 'aria-describedby' => 'some-element', 156 // 'aria-label' => 'custom aria label', 157 // 'pattern' => '[A-Z0-9]{5}', // A 5-character string of capital letters and numbers. 158 // 'title' => 'Title to show on hover', 159 // 'data-custom' => 'custom data', 160 // ), 161 // ); 162 163 // return $fields; 164 // } 143 // add_action( 144 // 'woocommerce_blocks_loaded', 145 // function () { 146 // __experimental_woocommerce_blocks_register_checkout_field( 147 // array( 148 // 'id' => 'ship-depot/gov-id', 149 // 'label' => esc_html__('Phường/Xã', 'ship-depot-translate'), 150 // 'location' => 'address', 151 // 'required' => true 152 // ), 153 // ); 154 // }, 155 // 10, 156 // 4 157 // ); -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup-courier-condition.php
r2922618 r3063365 10 10 { 11 11 parent::MapData($object, $this); 12 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Courier_Condition] this: ' . print_r($this, true));12 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Courier_Condition] this: ' . print_r($this, true)); 13 13 } 14 14 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup-courier-service.php
r2922618 r3063365 11 11 { 12 12 parent::MapData($object, $this); 13 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Courier_Service] this: ' . print_r($this, true));13 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Courier_Service] this: ' . print_r($this, true)); 14 14 } 15 15 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup-option.php
r2922618 r3063365 11 11 { 12 12 parent::MapData($object, $this); 13 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Option] this: ' . print_r($this, true));13 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Option] this: ' . print_r($this, true)); 14 14 } 15 15 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup-order-condition.php
r2922618 r3063365 3 3 4 4 if (!class_exists('Ship_Depot_Fee_Markup_Order_Condition')) { 5 class Ship_Depot_Fee_Markup_Order_Condition extends Ship_Depot_Base_Model 6 { 7 public string $ID = ""; 8 public string $Type = ""; 9 public int $FromValue = 0; 10 public int $ToValue = 0; 11 public string $FixedValue = ""; 12 function __construct($object = null) 5 class Ship_Depot_Fee_Markup_Order_Condition extends Ship_Depot_Base_Model 13 6 { 14 parent::MapData($object, $this); 15 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Order_Condition] this: ' . print_r($this, true)); 7 public string $ID = ""; 8 public string $Type = ""; 9 public int $FromValue = 0; 10 public int $ToValue = 0; 11 public string $FixedValue = ""; 12 function __construct($object = null) 13 { 14 parent::MapData($object, $this); 15 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Order_Condition] this: ' . print_r($this, true)); 16 } 16 17 } 17 18 } 18 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup-time-condition.php
r2922618 r3063365 11 11 { 12 12 parent::MapData($object, $this); 13 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Time_Condition] this: ' . print_r($this, true));13 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup_Time_Condition] this: ' . print_r($this, true)); 14 14 } 15 15 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-markup.php
r2922618 r3063365 3 3 4 4 if (!class_exists('Ship_Depot_Fee_Markup')) { 5 class Ship_Depot_Fee_Markup extends Ship_Depot_Base_Model6 {7 public string $ID = "";8 public bool $IsActive = false;9 public array $ListOrderConditions = [];10 public Ship_Depot_Fee_Markup_Option $Option;11 public Ship_Depot_Fee_Markup_Time_Condition $TimeApply;12 public Ship_Depot_Fee_Markup_Courier_Condition $CourierApply;13 public string $Notes = "";5 class Ship_Depot_Fee_Markup extends Ship_Depot_Base_Model 6 { 7 public string $ID = ""; 8 public bool $IsActive = false; 9 public array $ListOrderConditions = []; 10 public Ship_Depot_Fee_Markup_Option $Option; 11 public Ship_Depot_Fee_Markup_Time_Condition $TimeApply; 12 public Ship_Depot_Fee_Markup_Courier_Condition $CourierApply; 13 public string $Notes = ""; 14 14 15 function __construct($object = null) 16 { 17 $this->Option = new Ship_Depot_Fee_Markup_Option(); 18 $this->TimeApply = new Ship_Depot_Fee_Markup_Time_Condition(); 19 $this->CourierApply = new Ship_Depot_Fee_Markup_Courier_Condition(); 20 parent::MapData($object, $this); 21 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup] this aft: ' . print_r($this, true)); 15 function __construct($object = null) 16 { 17 $this->Option = new Ship_Depot_Fee_Markup_Option(); 18 $this->TimeApply = new Ship_Depot_Fee_Markup_Time_Condition(); 19 $this->CourierApply = new Ship_Depot_Fee_Markup_Courier_Condition(); 20 parent::MapData($object, $this); 21 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Markup] this aft: ' . print_r($this, true)); 22 } 22 23 } 23 24 } 24 } -
ship-depot/trunk/includes/Model/FeeSetting/class-fee-settings.php
r2922618 r3063365 12 12 $this->ListFeeMarkups = []; 13 13 parent::MapData($object, $this); 14 Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Setting] this: ' . print_r($this, true));14 // Ship_Depot_Logger::wrlog('[Ship_Depot_Fee_Setting] this: ' . print_r($this, true)); 15 15 } 16 16 } -
ship-depot/trunk/includes/Model/ShippingFee/class-courier-response.php
r2922618 r3063365 17 17 $this->ListServices = []; 18 18 parent::MapData($object, $this); 19 Ship_Depot_Logger::wrlog('[Ship_Depot_Courier_Response] this: ' . print_r($this, true));19 // Ship_Depot_Logger::wrlog('[Ship_Depot_Courier_Response] this: ' . print_r($this, true)); 20 20 } 21 21 } -
ship-depot/trunk/includes/Model/ShippingFee/class-shipping-fee-info.php
r2922618 r3063365 17 17 $this->MarkupOption = new Ship_Depot_Fee_Markup_Option(); 18 18 parent::MapData($object, $this); 19 Ship_Depot_Logger::wrlog('[Ship_Depot_Shipping_Fee_Info] this: ' . print_r($this, true));19 // Ship_Depot_Logger::wrlog('[Ship_Depot_Shipping_Fee_Info] this: ' . print_r($this, true)); 20 20 } 21 21 } -
ship-depot/trunk/includes/Model/ShippingFee/class-shipping-fee-response.php
r2922618 r3063365 47 47 } 48 48 parent::MapData($object, $this); 49 Ship_Depot_Logger::wrlog('[Ship_Depot_Shipping_Fee_Response] this: ' . print_r($this, true));49 // Ship_Depot_Logger::wrlog('[Ship_Depot_Shipping_Fee_Response] this: ' . print_r($this, true)); 50 50 } 51 51 } -
ship-depot/trunk/includes/Model/class-cod-failed-notice.php
r2922618 r3063365 11 11 { 12 12 parent::MapData($object, $this); 13 Ship_Depot_Logger::wrlog('[Ship_Depot_COD_Failed_Notice] this: ' . print_r($this, true));13 // Ship_Depot_Logger::wrlog('[Ship_Depot_COD_Failed_Notice] this: ' . print_r($this, true)); 14 14 } 15 15 } -
ship-depot/trunk/includes/Model/class-cod-failed.php
r2922618 r3063365 16 16 $this->ContentShippingLabel = new Ship_Depot_COD_Failed_Notice(); 17 17 parent::MapData($object, $this); 18 Ship_Depot_Logger::wrlog('[Ship_Depot_COD_Failed] this: ' . print_r($this, true));18 // Ship_Depot_Logger::wrlog('[Ship_Depot_COD_Failed] this: ' . print_r($this, true)); 19 19 } 20 20 } -
ship-depot/trunk/includes/Model/class-cod.php
r2922618 r3063365 10 10 { 11 11 parent::MapData($object, $this); 12 Ship_Depot_Logger::wrlog('[Ship_Depot_Cod] this: ' . print_r($this, true));12 // Ship_Depot_Logger::wrlog('[Ship_Depot_Cod] this: ' . print_r($this, true)); 13 13 } 14 14 } -
ship-depot/trunk/includes/Model/class-coupon.php
r2992892 r3063365 10 10 { 11 11 parent::MapData($object, $this); 12 Ship_Depot_Logger::wrlog('[Ship_Depot_Coupon] this: ' . print_r($this, true));12 // Ship_Depot_Logger::wrlog('[Ship_Depot_Coupon] this: ' . print_r($this, true)); 13 13 } 14 14 } -
ship-depot/trunk/includes/Model/class-courier.php
r2963463 r3063365 28 28 $this->ListServices = []; 29 29 parent::MapData($object, $this); 30 Ship_Depot_Logger::wrlog('[Ship_Depot_Courier] this: ' . print_r($this, true));30 // Ship_Depot_Logger::wrlog('[Ship_Depot_Courier] this: ' . print_r($this, true)); 31 31 } 32 32 } -
ship-depot/trunk/includes/Model/class-district.php
r2963463 r3063365 16 16 { 17 17 parent::MapData($object, $this); 18 Ship_Depot_Logger::wrlog('[Ship_Depot_District] this: ' . print_r($this, true));18 // Ship_Depot_Logger::wrlog('[Ship_Depot_District] this: ' . print_r($this, true)); 19 19 } 20 20 } -
ship-depot/trunk/includes/Model/class-insurance.php
r2922618 r3063365 10 10 { 11 11 parent::MapData($object, $this); 12 Ship_Depot_Logger::wrlog('[Ship_Depot_Insurance] this: ' . print_r($this, true));12 // Ship_Depot_Logger::wrlog('[Ship_Depot_Insurance] this: ' . print_r($this, true)); 13 13 } 14 14 } -
ship-depot/trunk/includes/Model/class-item.php
r2922618 r3063365 17 17 { 18 18 parent::MapData($object, $this); 19 Ship_Depot_Logger::wrlog('[Ship_Depot_Item] this: ' . print_r($this, true));19 // Ship_Depot_Logger::wrlog('[Ship_Depot_Item] this: ' . print_r($this, true)); 20 20 } 21 21 } -
ship-depot/trunk/includes/Model/class-package.php
r2922618 r3063365 12 12 { 13 13 parent::MapData($object, $this); 14 Ship_Depot_Logger::wrlog('[Ship_Depot_Package] this: ' . print_r($this, true));14 // Ship_Depot_Logger::wrlog('[Ship_Depot_Package] this: ' . print_r($this, true)); 15 15 } 16 16 } -
ship-depot/trunk/includes/Model/class-province.php
r2963463 r3063365 16 16 { 17 17 parent::MapData($object, $this); 18 Ship_Depot_Logger::wrlog('[Ship_Depot_Province] this: ' . print_r($this, true));18 // Ship_Depot_Logger::wrlog('[Ship_Depot_Province] this: ' . print_r($this, true)); 19 19 } 20 20 } -
ship-depot/trunk/includes/Model/class-receiver.php
r2922618 r3063365 19 19 } 20 20 parent::MapData($object, $this); 21 Ship_Depot_Logger::wrlog('[Ship_Depot_Receiver] this: ' . print_r($this, true));21 // Ship_Depot_Logger::wrlog('[Ship_Depot_Receiver] this: ' . print_r($this, true)); 22 22 } 23 23 } -
ship-depot/trunk/includes/Model/class-ship-from-station.php
r2963463 r3063365 17 17 $this->Station = new Ship_Depot_Station(); 18 18 parent::MapData($object, $this); 19 Ship_Depot_Logger::wrlog('[Ship_Depot_Ship_From_Station] this: ' . print_r($this, true));19 // Ship_Depot_Logger::wrlog('[Ship_Depot_Ship_From_Station] this: ' . print_r($this, true)); 20 20 } 21 21 } -
ship-depot/trunk/includes/Model/class-ship-station.php
r2963463 r3063365 14 14 { 15 15 parent::MapData($object, $this); 16 Ship_Depot_Logger::wrlog('[Ship_Depot_Station] this: ' . print_r($this, true));16 // Ship_Depot_Logger::wrlog('[Ship_Depot_Station] this: ' . print_r($this, true)); 17 17 } 18 18 } -
ship-depot/trunk/includes/Model/class-shop-info.php
r2922618 r3063365 21 21 { 22 22 parent::MapData($object, $this); 23 Ship_Depot_Logger::wrlog('[Ship_Depot_Shop_Info] this: ' . print_r($this, true));23 // Ship_Depot_Logger::wrlog('[Ship_Depot_Shop_Info] this: ' . print_r($this, true)); 24 24 } 25 25 } -
ship-depot/trunk/includes/Order/class-order-shipping.php
r3026645 r3063365 25 25 public static function calculate_shipping_fee($is_cod, $is_insurance, $insurance_amount, $list_packages, $list_items, $receiver, $sender_storage, $sender_info, $items_total_price, $item_regular_price_total, $order_total, $for_courier = '') 26 26 { 27 Ship_Depot_Logger::wrlog('[Ship_Depot_Order_Shipping][calculate_shipping] receiver: ' . print_r($receiver, true));27 // Ship_Depot_Logger::wrlog('[Ship_Depot_Order_Shipping][calculate_shipping] receiver: ' . print_r($receiver, true)); 28 28 if ( 29 29 is_null($receiver) … … 67 67 $shop_api_key = get_option('sd_api_key'); 68 68 $result = Ship_Depot_Helper::http_post($url_API, $dataInput, array('ShopAPIKey' => $shop_api_key)); 69 Ship_Depot_Logger::wrlog('[Ship_Depot_Order_Shipping][calculate_shipping] result: ' . print_r($result, true));69 // Ship_Depot_Logger::wrlog('[Ship_Depot_Order_Shipping][calculate_shipping] result: ' . print_r($result, true)); 70 70 if ($result->Code >= 0) { 71 71 $list_fees_from_api = []; … … 445 445 Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] old_status: ' . print_r($old_status, true)); 446 446 Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] new_status: ' . print_r($new_status, true)); 447 Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] post_type: ' . sanitize_text_field($_POST['post_type']));448 Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] action: ' . sanitize_text_field($_POST['action']));447 // Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] post_type: ' . sanitize_text_field($_POST['post_type'])); 448 // Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] action: ' . sanitize_text_field($_POST['action'])); 449 449 450 450 /* … … 709 709 //list_items 710 710 $list_items = []; 711 Ship_Depot_Logger::wrlog('[create_ship] order created date: ' . print_r($order->get_date_created(), true));712 711 $order_items = $order->get_items(); 713 712 $item_regular_price_total = 0; 714 713 foreach ($order_items as $item) { 715 714 $item_data = $item->get_data(); 716 Ship_Depot_Logger::wrlog('[create_ship] item_data: ' . print_r($item_data, true));715 // Ship_Depot_Logger::wrlog('[create_ship] item_data: ' . print_r($item_data, true)); 717 716 $product_id = $item_data['product_id']; 718 717 $product_image = wp_get_attachment_image_src(get_post_thumbnail_id($product_id), 'single-post-thumbnail'); … … 728 727 $item_product = new WC_Order_Item_Product($item->get_id()); 729 728 $product = $item_product->get_product(); 730 Ship_Depot_Logger::wrlog('[create_ship] product: ' . print_r($product, true));729 // Ship_Depot_Logger::wrlog('[create_ship] product: ' . print_r($product, true)); 731 730 $it->Length = Ship_Depot_Helper::ConvertToShipDepotDimension($product->get_length()); 732 731 $it->Width = Ship_Depot_Helper::ConvertToShipDepotDimension($product->get_width()); … … 766 765 } 767 766 $order_created_date = $order->get_date_created(); 768 Ship_Depot_Logger::wrlog('[create_ship] order_created_date: ' . print_r($order_created_date, true));769 767 Ship_Depot_Logger::wrlog('[create_ship] order_created_date string: ' . print_r($order_created_date->__toString(), true)); 770 768 Ship_Depot_Logger::wrlog('[create_ship] ship_from_station: ' . print_r($ship_from_station, true)); … … 799 797 800 798 $shop_api_key = get_option('sd_api_key'); 801 Ship_Depot_Logger::wrlog('[create_ship] data_input: ' . print_r($data_input, true));799 // Ship_Depot_Logger::wrlog('[create_ship] data_input: ' . print_r($data_input, true)); 802 800 $url = SHIP_DEPOT_HOST_API . '/Shipping/CreateShipping'; 803 801 $rs = Ship_Depot_Helper::http_post($url, $data_input, array('ShopAPIKey' => $shop_api_key)); 804 Ship_Depot_Logger::wrlog('[create_ship] result call API: ' . print_r($rs, true));802 // Ship_Depot_Logger::wrlog('[create_ship] result call API: ' . print_r($rs, true)); 805 803 if ($rs->Code > 0) { 806 804 $order_note = __('Vận đơn tạo thành công. Mã vận đơn', 'ship-depot-translate'); -
ship-depot/trunk/includes/class-ship-depot-general.php
r3043419 r3063365 144 144 //add_filter('woocommerce_locate_template', array($this, 'log_template'), 10, 3); 145 145 //add_filter('woocommerce_locate_template', array($this, 'woocommerce_locate_template'), 10, 3); 146 146 //Extend time out request 147 add_filter('http_request_timeout', array($this, 'sd_http_request_timeout_extend')); 147 148 } 148 149 … … 551 552 } 552 553 } 554 555 public function sd_http_request_timeout_extend($time) 556 { 557 return 60; 558 } 553 559 } -
ship-depot/trunk/page/admin/orders/sd-order-detail.php
r3026645 r3063365 8 8 //Verify that the nonce is valid. 9 9 Ship_Depot_Logger::wrlog('[sd_woocommerce_new_order_action] order_id: ' . print_r($order_id, true)); 10 Ship_Depot_Logger::wrlog('[sd_woocommerce_new_order_action] order: ' . print_r($order, true));10 // Ship_Depot_Logger::wrlog('[sd_woocommerce_new_order_action] order: ' . print_r($order, true)); 11 11 } 12 12 … … 376 376 $data_input["shipment_ISN"] = 0; 377 377 } 378 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] data_input: ' . print_r($data_input, true));378 // Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] data_input: ' . print_r($data_input, true)); 379 379 $url = SHIP_DEPOT_HOST_API . '/Shipping/CreateShipping'; 380 380 $rs = Ship_Depot_Helper::http_post($url, $data_input, array('ShopAPIKey' => $shop_api_key)); 381 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] result call API: ' . print_r($rs, true));381 // Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] result call API: ' . print_r($rs, true)); 382 382 if ($rs->Code > 0) { 383 383 if (!$is_edit) { … … 658 658 Ship_Depot_Logger::wrlog('[calculateTotal_init] order_id: ' . $order_id); 659 659 $order = wc_get_order($order_id); 660 Ship_Depot_Logger::wrlog('[calculateTotal_init] order: ' . print_r($order, true));660 // Ship_Depot_Logger::wrlog('[calculateTotal_init] order: ' . print_r($order, true)); 661 661 $oldTotal = $order->get_total(); 662 662 $shippings = $order->get_items('shipping'); … … 704 704 $order_id = isset($data_input->orderID) ? $data_input->orderID : ''; 705 705 $order = wc_get_order($order_id); 706 Ship_Depot_Logger::wrlog('[calculate_shipping_init] order: ' . print_r($order, true));706 // Ship_Depot_Logger::wrlog('[calculate_shipping_init] order: ' . print_r($order, true)); 707 707 $order_subtotal = $order->get_subtotal(); 708 708 $data_input->item_total = $order_subtotal; -
ship-depot/trunk/page/frontend/sd-checkout-page.php
r3043419 r3063365 14 14 return array(); 15 15 } 16 16 17 add_filter('woocommerce_cart_needs_shipping_address', 'set_cart_needs_shipping_address_filter'); 17 18 function set_cart_needs_shipping_address_filter($condition) … … 49 50 { 50 51 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] needs_shipping_address: ' . print_r(WC()->cart->needs_shipping_address(), true)); 51 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] _POST: ' . print_r($_POST, true));52 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] _GET: ' . print_r($_GET, true));52 // Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] _POST: ' . print_r($_POST, true)); 53 // Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] _GET: ' . print_r($_GET, true)); 53 54 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] cart get_total: ' . print_r(WC()->cart->get_total('number'), true)); 54 55 $str_courier_setting = get_option('sd_setting_courier'); … … 91 92 $item_regular_price_total += floatval($regular_price) * floatval($item['quantity']); 92 93 $it->RegularPrice = $regular_price; 93 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] it: ' . print_r($it, true));94 // Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] it: ' . print_r($it, true)); 94 95 // 95 96 array_push($list_packages_sizes, $package_size); … … 112 113 if (isset($_POST['post_data']) && !Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($_POST['post_data']))) { 113 114 $post_data = sanitize_text_field($_POST['post_data']); 114 Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] post_data: ' . print_r($post_data, true));115 // Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] post_data: ' . print_r($post_data, true)); 115 116 $data = array(); 116 117 $vars = explode('&', $post_data); … … 200 201 <?php 201 202 // Ship_Depot_Logger::wrlog('[sd_woocommerce_review_order_before_order_total] list_shipping: ' . print_r($list_shipping, true)); 203 ?> 204 <p style="font-size: 1.5rem; color:#0064ff; margin-bottom: 10px;"><?php _e('Vui lòng chọn đơn vị vận chuyển trước khi bấm đặt hàng.', 'ship-depot-translate') ?></p> 205 <?php 202 206 if (isset($list_shipping) && $list_shipping != false) { 203 207 foreach ($list_shipping as $courier_obj) { … … 288 292 </div> 289 293 <?php 294 } else { 295 ?> 296 <div style="margin: 10px 0 20px 0; display: flex; flex-wrap: wrap;align-items: center;"> 297 <p style="color:#0064ff;margin-right: 10px;"><?php _e('Nếu đã điền đủ thông tin thanh toán/vận chuyển mà không thấy danh sách đơn vị vận chuyển thì vui lòng bấm vào đây', 'ship-depot-translate') ?></p> 298 <a id="sd_reload_shipping"><?php _e('Tải lại', 'ship-depot-translate') ?></a> 299 </div> 300 <?php 290 301 } 291 292 302 ?> 293 303 <input type="hidden" id="SDOrderTotal" value="<?php echo esc_attr($cart_total_without_shipping + GetShippingFeeSession()) ?>" /> … … 301 311 amountEle.html(formatVNCurrency(<?php echo esc_attr($cart_total_without_shipping + GetShippingFeeSession()) ?>)); 302 312 }); 313 314 // 315 console.log('Validate shipping'); 316 if (document.querySelectorAll(".radio_shipping_fee[checked=checked]").length > 0) { 317 document.getElementById('place_order').disabled = false; 318 } else { 319 document.getElementById('place_order').disabled = true; 320 } 303 321 </script> 304 322 </div> … … 384 402 { 385 403 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] order_id: ' . print_r($order_id, true)); 386 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] posted_data: ' . print_r($posted_data, true));404 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] posted_data: ' . print_r($posted_data, true)); 387 405 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] _POST: ' . print_r($_POST, true)); 388 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] order bf: ' . print_r($order, true));406 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] order bf: ' . print_r($order, true)); 389 407 $shipping_fee = GetShippingFeeFromPostData($_POST); //GetShippingFeeSession(); 390 408 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] shipping_fee: ' . print_r($shipping_fee, true)); … … 412 430 $order->calculate_shipping(); 413 431 $order->calculate_totals(); 414 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] order aft add shipping: ' . print_r($order, true));432 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] order aft add shipping: ' . print_r($order, true)); 415 433 // 416 434 //Save ship depot data … … 423 441 $list_packages_sizes = []; 424 442 foreach ($list_items as $item) { 425 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item: ' . print_r($item, true));443 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item: ' . print_r($item, true)); 426 444 $item_product = new WC_Order_Item_Product($item->get_id()); 427 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item_product: ' . print_r($item_product, true));445 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item_product: ' . print_r($item_product, true)); 428 446 $product = $item_product->get_product(); 429 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] product: ' . print_r($product, true));447 // Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] product: ' . print_r($product, true)); 430 448 // $item_product = new WC_Order_Item_Product($item); 431 449 // $product = new WC_Product($item_product->get_product_id()); -
ship-depot/trunk/readme.txt
r3043419 r3063365 5 5 Tested up to: 6.4.3 6 6 Requires PHP: 7.4.3 7 Stable tag: 1.2.1 47 Stable tag: 1.2.15 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 65 65 66 66 == Changelog == 67 68 = 1.2.15 = 69 * Thêm thông báo 'Chọn đơn vị vận chuyển' ở trang thanh toán. 70 * Thêm nút tải lại để lấy danh sách đơn vị vận chuyển nếu danh sách đơn vị vận chuyển bị trống. 71 67 72 = 1.2.14 = 68 73 * Thêm phần hướng dẫn chỉnh về Classic Checkout trong trang Cài Đặt của Ship Depot. -
ship-depot/trunk/rest-api/class-shipdepot-webhook.php
r3017671 r3063365 88 88 ) { 89 89 $list_storages = $rs->ListStorages; 90 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_storages] list_storages encrypted: ' . print_r($list_storages, true));90 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_storages] list_storages encrypted: ' . print_r($list_storages, true)); 91 91 $list_storages_decrypted = Ship_Depot_ProtectData::DecryptData($list_storages); 92 92 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_storages] list_storages_decrypted: ' . print_r($list_storages_decrypted, true)); … … 112 112 ) { 113 113 $shop_info = $rs->ShopInfo; 114 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_shop_info] shop_info encrypted: ' . print_r($shop_info, true));114 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_shop_info] shop_info encrypted: ' . print_r($shop_info, true)); 115 115 $shop_info_decrypted = Ship_Depot_ProtectData::DecryptData($shop_info); 116 116 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_shop_info] shop_info_decrypted: ' . print_r($shop_info_decrypted, true)); … … 137 137 ) { 138 138 $list_cour_settings = $rs->ListCourierSettings; 139 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_courier_settings] list_cour_settings encrypted: ' . print_r($list_cour_settings, true));139 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_courier_settings] list_cour_settings encrypted: ' . print_r($list_cour_settings, true)); 140 140 $list_cour_settings_decrypted = Ship_Depot_ProtectData::DecryptData($list_cour_settings); 141 141 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_courier_settings] list_cour_settings_decrypted: ' . print_r($list_cour_settings_decrypted, true)); … … 161 161 ) { 162 162 $list_cours = $rs->ListCouriers; 163 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_couriers] shop_info encrypted: ' . print_r($list_cours, true));163 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_couriers] shop_info encrypted: ' . print_r($list_cours, true)); 164 164 $list_cour_decrypted = Ship_Depot_ProtectData::DecryptData($list_cours); 165 165 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_couriers] shop_info_decrypted: ' . print_r($list_cour_decrypted, true)); … … 173 173 { 174 174 $params = wp_parse_args($request->get_params(), ''); 175 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_provinces] params: ' . print_r($params, true));175 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_update_provinces] params: ' . print_r($params, true)); 176 176 if (!Ship_Depot_Helper::check_null_or_empty($params)) { 177 177 $rs = (object) $params; … … 197 197 { 198 198 $params = wp_parse_args($request->get_params(), ''); 199 Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_sync_data_from_admin] params: ' . print_r($params, true));199 // Ship_Depot_Logger::wrlog('[Ship_Depot_Webhook][sd_sync_data_from_admin] params: ' . print_r($params, true)); 200 200 if (!Ship_Depot_Helper::check_null_or_empty($params)) { 201 201 $rs = (object) $params;
Note: See TracChangeset
for help on using the changeset viewer.