Changeset 3026645
- Timestamp:
- 01/25/2024 08:31:13 AM (2 years ago)
- Location:
- ship-depot/trunk
- Files:
-
- 10 edited
-
Ship_Depot_init.php (modified) (2 diffs)
-
assets/js/admin-order-detail.js (modified) (30 diffs)
-
helper/class-function-get-data.php (modified) (1 diff)
-
includes/Address/address-ajax.php (modified) (3 diffs)
-
includes/Order/class-order-shipping.php (modified) (2 diffs)
-
includes/Settings/class-ship-depot-data.php (modified) (1 diff)
-
includes/class-ship-depot-general.php (modified) (2 diffs)
-
page/admin/orders/sd-order-detail.php (modified) (14 diffs)
-
page/frontend/sd-checkout-page.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ship-depot/trunk/Ship_Depot_init.php
r3017671 r3026645 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 07 * Version: 1.2.12 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 0');37 define('SHIP_DEPOT_VERSION', '1.2.12'); 38 38 } 39 39 -
ship-depot/trunk/assets/js/admin-order-detail.js
r3017671 r3026645 50 50 </div> 51 51 </div>` 52 } else 52 } 53 else 53 54 { 54 55 inHTML += `</div>`; … … 62 63 { 63 64 courClone[key] = []; 64 } else if (key == 'LogoURL') 65 } 66 else if (key == 'LogoURL') 65 67 { 66 68 courClone[key] = ''; … … 108 110 { 109 111 inHTML += `<p class="description">${sd_order_detail_params.l10n.aha_shipping_time_text} ${serv.TimeExpected}</p>`; 110 } else 112 } 113 else 111 114 { 112 115 inHTML += `<p class="description">${sd_order_detail_params.l10n.shipping_time_text} ${serv.TimeExpected}</p>`; … … 150 153 } 151 154 }); 152 } else 155 } 156 else 153 157 { 154 158 … … 220 224 console.log(`[updateShippingFee] recalculateTotal`); 221 225 recalculateTotal(); 222 } else 226 } 227 else 223 228 { 224 229 unblockListItemBox(); … … 227 232 error: function (jqXHR, textStatus, errorThrown) 228 233 { 229 alert(sd_order_detail_params.error_messages.error_total);234 // alert(sd_order_detail_params.error_messages.error_total); 230 235 unblockListItemBox(); 231 236 console.log('[CalculateTotal] error occured: ' + textStatus, errorThrown); 232 237 } 233 238 }); 234 } else 239 } 240 else 235 241 { 236 242 unblockListItemBox(); … … 260 266 } 261 267 } 262 } else 268 } 269 else 263 270 { 264 271 if (jQuery(divPickYes).hasClass('pick-station-yes--disabled')) … … 278 285 jQuery('#selectedShipping').val(''); 279 286 updateShippingFee(orderID, true, '', false, true); 280 } else 287 } 288 else 281 289 { 282 290 updateShippingFee(orderID, true, jQuery('#selectedShipping').val(), false, true); … … 300 308 } 301 309 hasError = true; 302 } else 310 } 311 else 303 312 { 304 313 if (jQuery(this).hasClass('error-class')) … … 370 379 } 371 380 }); 372 } else 381 } 382 else 373 383 { 374 384 if (!jQuery('#_shipping_last_name').val() || !jQuery('#_shipping_first_name').val() || !jQuery('#_shipping_country').val() || !jQuery('#_shipping_phone').val() || !jQuery('#_shipping_address_1').val() || !jQuery('#_shipping_ward').val() || !jQuery('#_shipping_district').val() || !jQuery('#_shipping_city').val()) … … 396 406 jQuery('#error_message_content').html(msgHtml); 397 407 setDisableBtnSave(true); 398 } else 408 } 409 else 399 410 { 400 411 jQuery('#error_message_content').html(newError); 401 412 setDisableBtnSave(false); 402 413 } 403 } else 414 } 415 else 404 416 { 405 417 jQuery('#error_message_content').html(newError); … … 414 426 { 415 427 return false; 416 } else 428 } 429 else 417 430 { 418 431 return true; … … 443 456 cusWard = jQuery('#sl_receiver_ward').val(); 444 457 cusAddr = jQuery('#receiver_address').val(); 445 } else if (type == 'current') 458 } 459 else if (type == 'current') 446 460 { 447 461 cusProvince = jQuery('#_shipping_city').val(); … … 516 530 517 531 jQuery('#myModal').show(); 518 } else 532 } 533 else 519 534 { 520 535 if (isSameAddr) 521 536 { 522 return; s 523 } else 537 return; 538 } 539 else 524 540 { 525 541 alert('Lấy danh sách địa chỉ cấp 4 với tỉnh ' + cusProvinceText + ' thất bại. Vui lòng thử lại sau.'); … … 534 550 { 535 551 return; 536 } else 552 } 553 else 537 554 { 538 555 alert('Lấy danh sách địa chỉ cấp 4 với tỉnh ' + cusProvinceText + ' thất bại. Vui lòng thử lại sau.'); … … 549 566 function validateData(orderID, validateOnly = false) 550 567 { 568 let haveErrorBf = haveError(); 551 569 jQuery('#error_message_content').empty(); 552 570 if (jQuery('#cb_not_create_shipping').is(':checked') == true) … … 561 579 checkSelectedShipping(); 562 580 return true; 563 } else 581 } 582 else 564 583 { 565 584 if (!validateOnly) 566 585 { 567 clearShippingFee(orderID, false); 586 if (!haveErrorBf) 587 { 588 console.log("clear shipping before error"); 589 clearShippingFee(orderID, false); 590 } 568 591 } 569 592 … … 576 599 { 577 600 msgHtml = msgHtml.replace('[param]', pkMsg + ` ${sd_order_detail_params.error_messages.and} ` + rcvMsg); 578 } else if (!pkCheck) 601 } 602 else if (!pkCheck) 579 603 { 580 604 msgHtml = msgHtml.replace('[param]', pkMsg); 581 } else if (!rcCheck) 605 } 606 else if (!rcCheck) 582 607 { 583 608 msgHtml = msgHtml.replace('[param]', rcvMsg); … … 591 616 } 592 617 618 function haveError() 619 { 620 let error = false; 621 jQuery('.error_content').each(function () 622 { 623 let content = jQuery(this).text(); 624 if (!isNullorEmpty(content)) 625 { 626 error = true; 627 return false; 628 } 629 }) 630 return error; 631 } 632 593 633 function setDisableBtnSave(isDisable) 594 634 { … … 600 640 btnSave.addClass("button-disabled"); 601 641 } 602 } else 642 } 643 else 603 644 { 604 645 btnSave.removeClass("button-disabled"); … … 652 693 Phone: jQuery("#_shipping_phone").val() 653 694 } 654 } else 695 } 696 else 655 697 { 656 698 receiver = { … … 856 898 { 857 899 858 } else 900 } 901 else 859 902 { 860 903 validateData(null, true); … … 903 946 updateShippingFee(orderID, true, $('#selectedShipping').val(), fromNotCreateShip, true); 904 947 checkSelectedShipping(); 905 } else 948 } 949 else 906 950 { 907 951 $('#shipping_info').show(); … … 957 1001 $('#package_content').hide(); 958 1002 $("#btn_expand_package").attr("src", `${sd_order_detail_params.sd_dir_url}assets/images/ic_down_arrow_black_16px.png`); 959 } else 1003 } 1004 else 960 1005 { 961 1006 $('#package_content').show(); … … 1120 1165 { 1121 1166 $('#receiver_info').hide(); 1122 } else if (this.value == 'other') 1167 } 1168 else if (this.value == 'other') 1123 1169 { 1124 1170 $('#receiver_info').show(); … … 1135 1181 $('#insr_price').show(); 1136 1182 //$('#tb_ins_fee').val('0'); 1137 } else 1183 } 1184 else 1138 1185 { 1139 1186 $('#insr_price').hide(); … … 1152 1199 { 1153 1200 $('#cod_price_content').show(); 1154 } else 1201 } 1202 else 1155 1203 { 1156 1204 $('#cod_price_content').hide(); … … 1168 1216 $('#advance_content').hide(); 1169 1217 $("#btn_expand_advance").attr("src", `${sd_order_detail_params.sd_dir_url}assets/images/ic_down_arrow_black_16px.png`); 1170 } else 1218 } 1219 else 1171 1220 { 1172 1221 $('#advance_content').show(); … … 1249 1298 success: function (response) 1250 1299 { 1251 if (response.data == "success") 1252 { 1253 location.reload(); 1254 } else 1255 { 1256 unblock($('#sd_meta_boxes')); 1257 alert(response.data); 1258 } 1300 location.reload(); 1259 1301 }, 1260 1302 error: function (jqXHR, textStatus, errorThrown) 1261 1303 { 1262 alert(sd_order_detail_params.error_messages.cancel_shipping);1263 1304 console.log('[CancelShippingFee] error occured: ' + textStatus, errorThrown); 1264 1305 location.reload(); … … 1310 1351 { 1311 1352 $('#tb_cod_edit_amount').addClass('error-class'); 1312 } else 1353 } 1354 else 1313 1355 { 1314 1356 $('#tb_cod_edit_amount').removeClass('error-class'); -
ship-depot/trunk/helper/class-function-get-data.php
r2993025 r3026645 75 75 $receiver->Phone = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['shipdepot']['receiver']['phone'])) ? '' : sanitize_text_field($this->post_data['shipdepot']['receiver']['phone']); 76 76 } else { 77 $ order = wc_get_order($this->order_id);78 $receiver-> FirstName = $order->get_shipping_first_name();79 $receiver-> LastName = $order->get_shipping_last_name();80 $receiver-> Province = $order->get_shipping_city();81 $receiver-> District = $order->get_meta('_shipping_district', true);82 $receiver-> Ward = $order->get_meta('_shipping_ward', true);83 $receiver-> Address = $order->get_shipping_address_1();84 $receiver->Phone = $order->get_shipping_phone();85 }77 $receiver->FirstName = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_first_name'])) ? '' : sanitize_text_field($this->post_data['_shipping_first_name']); 78 $receiver->LastName = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_last_name'])) ? '' : sanitize_text_field($this->post_data['_shipping_last_name']); 79 $receiver->Province = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_city'])) ? '' : sanitize_text_field($this->post_data['_shipping_city']); 80 $receiver->District = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_district'])) ? '' : sanitize_text_field($this->post_data['_shipping_district']); 81 $receiver->Ward = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_ward'])) ? '' : sanitize_text_field($this->post_data['_shipping_ward']); 82 $receiver->Address = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_address_1'])) ? '' : sanitize_text_field($this->post_data['_shipping_address_1']); 83 $receiver->Phone = Ship_Depot_Helper::check_null_or_empty(sanitize_text_field($this->post_data['_shipping_phone'])) ? '' : sanitize_text_field($this->post_data['_shipping_phone']); 84 } 85 Ship_Depot_Logger::wrlog('[get_receiver_info] receiver: ' . print_r($receiver, true)); 86 86 return $receiver; 87 87 } -
ship-depot/trunk/includes/Address/address-ajax.php
r2922618 r3026645 6 6 $province_code = (isset($_POST['province_code'])) ? sanitize_text_field(($_POST['province_code'])) : ''; 7 7 Ship_Depot_Address_Helper::get_districts_option_by_province_code($province_code); 8 die();8 wp_die(); 9 9 } 10 10 … … 19 19 Ship_Depot_Address_Helper::get_wards_option_by_district_code($province_code, $district_code); 20 20 } 21 die();21 wp_die(); 22 22 } 23 23 … … 42 42 $reponse->shipping['ward'] = $customer->get_meta('shipping_ward', true); 43 43 wp_send_json_success($reponse); 44 } else { 45 wp_die(); //bắt buộc phải có khi kết thúc 44 46 } 45 die(); //bắt buộc phải có khi kết thúc46 47 } -
ship-depot/trunk/includes/Order/class-order-shipping.php
r3009769 r3026645 481 481 } 482 482 483 $order_from_checkout = Ship_Depot_Helper::GetOrderMetadata($order_id, 'sd_from_fe', true); 484 if (Ship_Depot_Helper::check_null_or_empty($order_from_checkout) || $order_from_checkout == 'false') { 485 Ship_Depot_Logger::wrlog('[sd_handle_woo_order_status_changed] order not from checkout => Not create shipping auto '); 486 return; 487 } 488 483 489 Ship_Depot_Default_Data::DefaultAutoCreateShip(); 484 490 $auto_create_ship = get_option('sd_auto_create_shipping'); … … 805 811 $order->add_order_note($order_note); 806 812 Ship_Depot_Helper::UpdateOrderMetadata($order_id, 'sd_ship_info', json_encode($rs->Data, JSON_UNESCAPED_UNICODE)); 813 Ship_Depot_Helper::UpdateOrderMetadata($order, 'sd_from_fe', json_encode(false)); 807 814 return true; 808 815 } else { -
ship-depot/trunk/includes/Settings/class-ship-depot-data.php
r2922618 r3026645 139 139 Ship_Depot_Data::update_data_new_api_key(); 140 140 wp_send_json_success("sync success"); 141 die(); //bắt buộc phải có khi kết thúc142 141 } -
ship-depot/trunk/includes/class-ship-depot-general.php
r3014866 r3026645 468 468 <p style="color: #ff0000;"> 469 469 <?php 470 $plugin_page = admin_url('plugins.php'); //get_site_url() . '/wp-admin/plugins.php';470 $plugin_page = admin_url('plugins.php'); 471 471 printf( 472 472 esc_html__('%s cần phải nâng cấp lên phiên bản mới nhất để tránh bị lỗi. Vui lòng vào trang %s tìm Ship Depot để nâng cấp.', 'ship-depot-translate'), … … 493 493 <p style="color: #ff0000;"> 494 494 <?php 495 $plugin_page = admin_url('plugins.php'); //get_site_url() . '/wp-admin/plugins.php';495 $plugin_page = admin_url('plugins.php'); 496 496 printf( 497 497 esc_html__('%s cần phải nâng cấp lên phiên bản mới nhất để tránh bị lỗi. Vui lòng vào trang %s tìm Ship Depot để nâng cấp.', 'ship-depot-translate'), -
ship-depot/trunk/page/admin/orders/sd-order-detail.php
r3017671 r3026645 1 1 <?php 2 2 // Save the data of the Meta field 3 add_action('save_post', 'sd_save_wc_order_other_fields', 10, 1); 3 add_action('woocommerce_new_order', 'sd_woocommerce_new_order_action', 10, 2); 4 5 function sd_woocommerce_new_order_action($order_id, $order) 6 { 7 Ship_Depot_Logger::wrlog('[sd_woocommerce_new_order_action] Begin'); 8 //Verify that the nonce is valid. 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)); 11 } 12 13 add_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10, 1); 4 14 if (!function_exists('sd_save_wc_order_other_fields')) { 5 15 6 function sd_save_wc_order_other_fields($ post_id)16 function sd_save_wc_order_other_fields($order_id) 7 17 { 8 18 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] Begin'); 9 19 //Verify that the nonce is valid. 10 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] post_id: ' . print_r($post_id, true));11 //Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] _POST: ' . print_r($_POST, true));20 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] order_id: ' . print_r($order_id, true)); 21 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] _POST: ' . print_r($_POST, true)); 12 22 13 23 // If this is an autosave, our form has not been submitted, so we don't want to do anything. 14 24 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 15 25 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] DOING_AUTOSAVE'); 16 return $ post_id;26 return $order_id; 17 27 } 18 28 … … 20 30 if (!isset($_POST['action'])) { 21 31 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] action not found'); 22 return $ post_id;32 return $order_id; 23 33 } 24 34 25 35 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] action: ' . sanitize_key($_POST['action'])); 26 36 if ('edit_order' == sanitize_key($_POST['action']) || 'editpost' == sanitize_key($_POST['action'])) { 27 if (!current_user_can('edit_post', $ post_id)) {28 return $ post_id;37 if (!current_user_can('edit_post', $order_id)) { 38 return $order_id; 29 39 } 30 40 } … … 32 42 if (!isset($_POST['sd_order_detail_nonce']) || !wp_verify_nonce($_POST['sd_order_detail_nonce'], 'sd_order_detail')) { 33 43 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] Verify nonce failed.'); 34 return $ post_id;44 return $order_id; 35 45 } 36 46 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] Start SAVE.'); 37 47 // 38 $str_ship_info = Ship_Depot_Helper::GetOrderMetadata($ post_id, 'sd_ship_info', true);48 $str_ship_info = Ship_Depot_Helper::GetOrderMetadata($order_id, 'sd_ship_info', true); 39 49 Ship_Depot_Logger::wrlog('[sd_save_wc_order_other_fields] str_ship_info: ' . $str_ship_info); 40 50 if (!Ship_Depot_Helper::check_null_or_empty($str_ship_info)) { 41 51 //Tạm thời ko cho sửa vận đơn 42 //sd_submit_data_and_save_to_order_meta_data($ post_id, true);43 sd_edit_cod_amount($ post_id);52 //sd_submit_data_and_save_to_order_meta_data($order_id, true); 53 sd_edit_cod_amount($order_id); 44 54 } else { 45 sd_woocommerce_new_shipping($ post_id);55 sd_woocommerce_new_shipping($order_id); 46 56 } 47 57 } … … 153 163 // unhook this function so it doesn't loop infinitely 154 164 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] unhook.'); 155 remove_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);165 remove_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10); 156 166 // 157 167 } … … 164 174 // re-hook this function. 165 175 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] re-hook.'); 166 add_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);176 add_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10, 1); 167 177 } 168 178 return false; 169 179 } 170 180 $get_data = new Ship_Depot_Get_Data($_POST, $order->get_id()); 181 182 //Create flag to detect order create from checkout 183 Ship_Depot_Helper::UpdateOrderMetadataWOSave($order, 'sd_from_fe', json_encode(false)); 171 184 172 185 //List package sizes … … 293 306 ) { 294 307 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] $receiver properties null => Not call API'); 308 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] $receiver: ' . print_r($receiver, true)); 295 309 // unhook this function so it doesn't loop infinitely 296 310 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] unhook.'); 297 remove_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);311 remove_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10); 298 312 // 299 313 //Save order meta data to db … … 302 316 // re-hook this function. 303 317 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] re-hook.'); 304 add_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);318 add_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10, 1); 305 319 return; 306 320 } … … 392 406 // unhook this function so it doesn't loop infinitely 393 407 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] unhook.'); 394 remove_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);408 remove_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10); 395 409 // 396 410 //Save order meta data to db … … 399 413 // re-hook this function. 400 414 Ship_Depot_Logger::wrlog('[sd_submit_data_and_save_to_order_meta_data] re-hook.'); 401 add_action(' save_post', 'sd_save_wc_order_other_fields', 10, 1);415 add_action('woocommerce_update_order', 'sd_save_wc_order_other_fields', 10, 1); 402 416 } 403 417 … … 673 687 $need_reload = true; 674 688 } 675 Ship_Depot_Logger::wrlog('[calculateTotal_init] shipping item: ' . print_r($item, true));689 Ship_Depot_Logger::wrlog('[calculateTotal_init] need_reload: ' . print_r($need_reload, true)); 676 690 wp_send_json_success($need_reload); 677 691 } catch (Exception $e) { … … 679 693 wp_send_json_error($e->getMessage()); 680 694 } 681 die(); //bắt buộc phải có khi kết thúc682 695 } 683 696 … … 758 771 wp_send_json_error($rs->Code); 759 772 } 760 die(); //bắt buộc phải có khi kết thúc761 773 } 762 774 … … 768 780 $order = wc_get_order($order_id); 769 781 $result = Ship_Depot_Order_Shipping::cancel_shipping($order); 770 if ($result->Code < 0) {771 wp_send_json_success($result->Message);772 die();773 }774 782 wp_send_json_success('success'); 775 die(); //bắt buộc phải có khi kết thúc 783 // Ship_Depot_Logger::wrlog('[cancel_shipping_init] result: ' . print_r($result, true)); 784 // if ($result->Code < 0) { 785 // Ship_Depot_Logger::wrlog('[cancel_shipping_init] wp_send_json_success. Message: ' . $result->Message); 786 // wp_send_json_success($result->Message); 787 // } else { 788 // Ship_Depot_Logger::wrlog('[cancel_shipping_init] wp_send_json_success'); 789 // wp_send_json_success('success'); 790 // } 776 791 } 777 792 … … 779 794 { 780 795 //return []; 781 return ['sd_not_create_ship', 'sd_list_package_size', 'sd_sender_storage', 'sd_sender_info', 'sd_ship_info', 'sd_receiver', 'sd_insurance', 'sd_cod', 'sd_selected_shipping', 'sd_selected_courier', 'sd_shipping_notes', 'sd_customer_pay_shipping', 'sd_is_edit_order', 'sd_list_items', 'sd_cod_failed_info', 'sd_ship_from_station' ];796 return ['sd_not_create_ship', 'sd_list_package_size', 'sd_sender_storage', 'sd_sender_info', 'sd_ship_info', 'sd_receiver', 'sd_insurance', 'sd_cod', 'sd_selected_shipping', 'sd_selected_courier', 'sd_shipping_notes', 'sd_customer_pay_shipping', 'sd_is_edit_order', 'sd_list_items', 'sd_cod_failed_info', 'sd_ship_from_station', 'sd_from_fe']; 782 797 } 783 798 -
ship-depot/trunk/page/frontend/sd-checkout-page.php
r3014505 r3026645 29 29 WC()->session->set('shipping_notes', $notes); 30 30 wp_send_json_success('success'); 31 die(); //bắt buộc phải có khi kết thúc32 31 } 33 32 … … 425 424 foreach ($list_items as $item) { 426 425 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item: ' . print_r($item, true)); 427 $item_product = new WC_Order_Item_Product($item );426 $item_product = new WC_Order_Item_Product($item->get_id()); 428 427 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] item_product: ' . print_r($item_product, true)); 429 $product = new WC_Product($item_product->get_product_id());428 $product = $item_product->get_product(); 430 429 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] product: ' . print_r($product, true)); 430 431 431 $package_size = new Ship_Depot_Package(); 432 432 $package_size->Length = Ship_Depot_Helper::ConvertToShipDepotDimension($product->get_length()); … … 552 552 Ship_Depot_Logger::wrlog('[sd_action_checkout_order_processed] shipping_notes: ' . print_r($shipping_notes, true)); 553 553 Ship_Depot_Helper::UpdateOrderMetadataWOSave($order, 'sd_shipping_notes', $shipping_notes); 554 //Create flag to detect order create from checkout 555 Ship_Depot_Helper::UpdateOrderMetadataWOSave($order, 'sd_from_fe', json_encode(true)); 554 556 if (function_exists('sd_save_wc_order_other_fields')) { 555 557 // unhook this function so it doesn't loop infinitely -
ship-depot/trunk/readme.txt
r3017671 r3026645 5 5 Tested up to: 6.4.2 6 6 Requires PHP: 7.4.3 7 Stable tag: 1.2.1 07 Stable tag: 1.2.12 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.12 = 69 * Sửa một số lỗi nhỏ. 70 71 = 1.2.11 = 72 * Sửa một số lỗi nhỏ. 73 67 74 = 1.2.10 = 68 75 * Sửa một số lỗi nhỏ.
Note: See TracChangeset
for help on using the changeset viewer.