Changeset 3308462
- Timestamp:
- 06/09/2025 11:53:15 AM (10 months ago)
- Location:
- shipment-tracker-for-woocommerce/trunk
- Files:
-
- 1 added
- 9 edited
-
admin/images/shipping timeline.png (added)
-
admin/js/bt-sync-shipment-tracking-admin.js (modified) (2 diffs)
-
bt-sync-shipment-tracking.php (modified) (2 diffs)
-
includes/class-bt-sync-shipment-tracking.php (modified) (8 diffs)
-
includes/shipping_providers/delhivery.php (modified) (5 diffs)
-
includes/shipping_providers/shipmozo.php (modified) (1 diff)
-
public/class-bt-sync-shipment-tracking-public.php (modified) (17 diffs)
-
public/css/bt-sync-shipment-tracking-public.css (modified) (2 diffs)
-
public/css/bt_sst_input_box_pincode_show_prime_x.css (modified) (2 diffs)
-
public/js/bt-sync-shipment-tracking-public.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shipment-tracker-for-woocommerce/trunk/admin/js/bt-sync-shipment-tracking-admin.js
r3301611 r3308462 182 182 jQuery(document).on('change', 'input[name="carbon_fields_compact_input[_bt_sst_message_text_template]"]', function () { 183 183 var selectedValue = $(this).val(); 184 let timeline_img_url = bt_sync_shipment_track_data.plugin_public_url + 'images/shipping timeline.png'; 184 185 const replacements = { 185 186 '#min_date#': 'Oct 08, 2024', … … 190 191 '#max_date_charges#': '80', 191 192 '#cutoff_time#': 'If ordered within 10 hrs 52 mins', 192 '#edit#': '<a href="#">Change</a>' 193 '#edit#': '<a href="#">Change</a>', 194 '#shipping_timeline#': '<img style="width: 350px;" src="'+timeline_img_url+'"/>' 193 195 }; 194 196 for (const [key, value] of Object.entries(replacements)) { -
shipment-tracker-for-woocommerce/trunk/bt-sync-shipment-tracking.php
r3307882 r3308462 17 17 * Plugin URI: https://shipment-tracker-for-woocommerce.bitss.tech/ 18 18 * Description: Most comprehensive shipment tracking plugin that extends your woocommerce store with shipment related features. Keeps you & your customers informed about shipment movement. 19 * Version: 1.4.24.1 419 * Version: 1.4.24.15 20 20 * Author: Bitss Techniques 21 21 * Author URI: https://shipment-tracker-for-woocommerce.bitss.tech … … 59 59 60 60 define( 'Carbon_Fields\URL', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'vendor/htmlburger/carbon-fields/' );//fix for Bitnami installations. 61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.4.24.1 4' );61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.4.24.15' ); 62 62 define( 'BT_SHIPPING_PROVIDERS', array('delhivery' =>'Delhivery','nimbuspost' => 'Nimbuspost (Deprecated)','nimbuspost_new' => 'Nimbuspost','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees', 'manual' =>'Custom Shipping') ); 63 63 define( 'BT_SHIPPING_PROVIDERS_WITH_NONE', array('none' =>'none','delhivery' =>'Delhivery', 'nimbuspost' => 'Nimbuspost (OLD)','nimbuspost_new' => 'Nimbuspost(NEW)','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees','manual' =>'Custom Shipping') ); -
shipment-tracker-for-woocommerce/trunk/includes/class-bt-sync-shipment-tracking.php
r3307882 r3308462 1752 1752 1753 1753 $container = $container->add_tab( __( 'Product Page' ), array( 1754 Field::make( 'html', 'product_message', __( 'Custom HTML Field' ) ) 1755 ->set_html( ' 1756 <div class="notification is-warning">This is a premium feature. <em>Administrators can test all premium features on product, checkout, and tracking pages while logged in.</em> </div> 1757 ' ), 1754 Field::make( 'html', 'product_message', __( 'Custom HTML Field' ) ), 1758 1755 Field::make( 'checkbox', 'bt_sst_shiprocket_pincode_checker', __( 'Enable "Estimated Delivery Date Checker" widget.') ) 1759 1756 ->set_classes( 'title is-6' ) … … 1765 1762 ->set_options( array( 1766 1763 'classic' => 'Classic', 1767 'realistic' => 'Realistic ',1768 'prime_x' => 'Prime_x ',1764 'realistic' => 'Realistic (Premium)', 1765 'prime_x' => 'Prime_x (Premium)', 1769 1766 ) ) 1770 1767 ->set_default_value('classic') … … 1778 1775 <img id="template-preview-img" src="" style="display: none;" alt="Template Preview"> 1779 1776 </div>'), 1780 Field::make('checkbox', 'bt_sst_enable_auto_postcode_fill', __('Automatically get visitor\'s postcode from ip address '))1777 Field::make('checkbox', 'bt_sst_enable_auto_postcode_fill', __('Automatically get visitor\'s postcode from ip address (Premium)')) 1781 1778 ->set_classes( 'title is-6' ) 1782 1779 ->set_option_value('no') … … 1814 1811 ) ) 1815 1812 ->set_default_value( 'woocommerce_after_add_to_cart_form' ), 1816 Field::make( 'time', 'bt_sst_cutoff_time', __( 'Cut Off Time(Default time will be 6:00 PM) ' ) )1813 Field::make( 'time', 'bt_sst_cutoff_time', __( 'Cut Off Time(Default time will be 6:00 PM) (Premium)' ) ) 1817 1814 ->set_default_value( '18:00:00' ) 1818 1815 ->set_conditional_logic( array( … … 1981 1978 ->set_min( 1 ) 1982 1979 ->set_max( 2), 1983 Field::make( 'text', 'bt_sst_shiprocket_processing_days', __( 'Global Processing Days ' ) )1980 Field::make( 'text', 'bt_sst_shiprocket_processing_days', __( 'Global Processing Days (Premium)' ) ) 1984 1981 ->set_help_text( 'Required. Processing days to improve the accuracy of estimated delivery date. This will be added to the EDD of couriers. 1985 1982 <br>You can set this at "Product Category" or "Product" or "Variations" level as well. … … 2035 2032 ) ), 2036 2033 Field::make( 'text', 'bt_sst_message_text_template', __( 'Message Text Template' ) ) 2037 ->set_help_text( 'Available variables: #city#, #pincode#, #min_date#, #max_date#, #min_date_charges#, #max_date_charges#, #cutoff_time# . Html is allowed.2034 ->set_help_text( 'Available variables: #city#, #pincode#, #min_date#, #max_date#, #min_date_charges#, #max_date_charges#, #cutoff_time#, #shipping_timeline#. Html is allowed. 2038 2035 <br> 2039 2036 Sample Templates:<br> … … 2041 2038 2. Get it by <b>#min_date#</b> at #city#. <br>#cutoff_time#<br> 2042 2039 3. 🚚 Delivery by <b>#min_date#</b> to #city# - #pincode# <br> #cutoff_time#. 2040 4. #shipping_timeline# 2043 2041 <br><br> 2044 2042 Apply a preset:<br> … … 2048 2046 <option value="Get it by <b>#min_date#</b> at #city#. <br>#cutoff_time#">Message Text Template - 2</option> 2049 2047 <option value="🚚 Delivery by <b>#min_date#</b> to #city# - #pincode# <br> #cutoff_time#">Message Text Template -3 </option> 2048 <option value="🚚 Delivery by <b>#min_date#</b> to #city# - #pincode# <br> #cutoff_time# <br> #shipping_timeline#">Shipping Timeline </option> 2050 2049 </select> 2051 2050 <p>Message Text Template Preview:</p> -
shipment-tracker-for-woocommerce/trunk/includes/shipping_providers/delhivery.php
r3299743 r3308462 38 38 } 39 39 40 public function get_rate_calcultor_and_date($md, $ss, $d_pin, $o_pin, $cgm ){40 public function get_rate_calcultor_and_date($md, $ss, $d_pin, $o_pin, $cgm,$payment_mode){ 41 41 $this->init_params(); 42 42 if(!empty($this->public_key)){ … … 46 46 'd_pin'=>$d_pin, 47 47 'o_pin'=>$o_pin, 48 'cgm'=>$cgm 48 'cgm'=>$cgm, 49 'pt'=>$payment_mode 49 50 50 51 ); … … 348 349 349 350 // Call for Express 350 $body_express = $this->getDataForExpressAndSurface('E', $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key );351 $body_express = $this->getDataForExpressAndSurface('E', $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key, $pm); 351 352 352 353 // Call for Surface 353 $body_surface = $this->getDataForExpressAndSurface('S', $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key );354 $body_surface = $this->getDataForExpressAndSurface('S', $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key, $pm); 354 355 355 356 if(isset($body_express['error']) || isset($body_surface['error'])){ … … 416 417 } 417 418 418 function getDataForExpressAndSurface($mode, $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key ) {419 function getDataForExpressAndSurface($mode, $delivery_pincode, $pickup_pincode, $weight_in_kg, $auth_key, $payment_mode) { 419 420 $body = array( 420 421 'md' => $mode, … … 422 423 'd_pin' => $delivery_pincode, 423 424 'o_pin' => $pickup_pincode, 424 'cgm' => $weight_in_kg*1000//convert to gm 425 'cgm' => $weight_in_kg*1000, //convert to gm 426 'pt' => $payment_mode 425 427 ); 426 428 -
shipment-tracker-for-woocommerce/trunk/includes/shipping_providers/shipmozo.php
r3229619 r3308462 13 13 $public_key=carbon_get_theme_option( 'bt_sst_shipmozo_apipublickey' ); 14 14 $private_key=carbon_get_theme_option( 'bt_sst_shipmozo_apiprivatekey' ); 15 16 $this->public_key=trim($public_key); 17 $this->private_key=trim($private_key); 15 if(!empty($public_key) && !empty($private_key)){ 16 $this->public_key=trim($public_key); 17 $this->private_key=trim($private_key); 18 } 18 19 } 19 20 -
shipment-tracker-for-woocommerce/trunk/public/class-bt-sync-shipment-tracking-public.php
r3305118 r3308462 140 140 wp_register_script('bt-sync-shipment-tracking-public-checkout-blocks', plugin_dir_url(__FILE__) . 'js/bt-sync-shipment-tracking-public-checkout-block.js', array('wp-data', 'wc-blocks-checkout'), $this->version, true); 141 141 $post_code_auto_fill = carbon_get_theme_option('bt_sst_enable_auto_postcode_fill'); 142 142 $is_premium = $this->licenser->should_activate_premium_features(); 143 $post_code_auto_fill = ($post_code_auto_fill && $is_premium) ? true : false; 143 144 $script_data = array( 144 145 "ajax_url" => admin_url('admin-ajax.php'), … … 149 150 wp_localize_script('bt-sync-shipment-tracking-public', 'bt_sync_shipment_tracking_data', $script_data); 150 151 151 $is_premium = $this->licenser->should_activate_premium_features();152 152 153 153 154 if (is_checkout() && $is_premium) { … … 277 278 if ($product && !$product->is_virtual()) { 278 279 $is_premium = $this->licenser->should_activate_premium_features(); 279 if (!$is_premium) 280 return; 280 281 281 $pincode_checker = carbon_get_theme_option('bt_sst_shiprocket_pincode_checker'); 282 282 if ($pincode_checker != 1) { … … 286 286 287 287 $check_templet = carbon_get_theme_option('bt_sst_pincode_box_template'); 288 if (!$is_premium) 289 $check_templet = "classic"; //if not premium, then use classic template. 288 290 // $check_templet = "prime_x"; 289 291 $post_code_auto_fill = carbon_get_theme_option('bt_sst_enable_auto_postcode_fill'); … … 320 322 } 321 323 324 //[bt_estimated_delivery_widget] shortcode handler 322 325 function bt_estimated_delivery_widget() 323 326 { … … 325 328 326 329 $is_premium = $this->licenser->should_activate_premium_features(); 327 if (!$is_premium) 328 return ""; 330 329 331 $pincode_checker = carbon_get_theme_option('bt_sst_shiprocket_pincode_checker'); 330 332 if ($pincode_checker != 1) { … … 335 337 wp_enqueue_script('bt-sync-shipment-tracking-public'); 336 338 $check_templet = carbon_get_theme_option('bt_sst_pincode_box_template'); 339 if (!$is_premium) 340 $check_templet = "classic"; //if not premium, then use classic template. 337 341 338 342 ob_start(); … … 341 345 } else if ($check_templet == "classic") { 342 346 include plugin_dir_path(dirname(__FILE__)) . 'public/partials/input_box_pincode_show_data.php'; 347 }else if ($check_templet == "prime_x") { 348 wp_enqueue_style('input_box_pincode_show_prime_x'); 349 wp_enqueue_script('bt_sst_input_box_pincode_show_prime_x'); 350 include plugin_dir_path(dirname(__FILE__)) . 'public/partials/input_box_pincode_show_prime_x.php'; 343 351 } else { 344 352 include plugin_dir_path(dirname(__FILE__)) . 'public/partials/input_box_pincode_show_data.php'; … … 376 384 ); 377 385 $is_premium = $this->licenser->should_activate_premium_features(); 378 if ($is_premium) { 386 $city = ""; 387 $min_hours = 100000; 388 $min_days = 0; 389 $max_days = 0; 390 $min_days_charges = 0; 391 $max_days_charges = 0; 392 $min_date = ''; 393 $min_date_charges = -1; 394 $min_courier_name = ''; 395 $max_hours = 0; 396 $max_date = ''; 397 $max_date_charges = -1; 398 $max_courier_name = ''; 399 $should_activate = true;// 400 if ($should_activate) { 379 401 380 402 $pickup_data_provider = carbon_get_theme_option( … … 389 411 $variation_id = trim($_POST['value']['variation_id']); 390 412 } 391 $city = ""; 392 $min_hours = 100000; 393 $min_date = ''; 394 $min_date_charges = -1; 395 $min_courier_name = ''; 396 397 $max_hours = 0; 398 $max_date = ''; 399 $max_date_charges = -1; 400 $max_courier_name = ''; 413 401 414 $bt_sst_message_text_template = carbon_get_theme_option('bt_sst_message_text_template'); 402 415 $push_resp = []; … … 605 618 //if not found, get processing days set at global level. 606 619 $processing_days = carbon_get_theme_option("bt_sst_shiprocket_processing_days"); 620 } 621 if(!$is_premium){ 622 $processing_days = 0; //if not premium, then no processing days. 607 623 } 608 624 … … 733 749 $processing_days = carbon_get_theme_option("bt_sst_shiprocket_processing_days"); 734 750 } 751 if(!$is_premium){ 752 $processing_days = 0; //if not premium, then no processing days. 753 } 735 754 736 755 if ($processing_days && $processing_days > 0) { … … 845 864 } 846 865 //$processing_days = 9; 847 866 if(!$is_premium){ 867 $processing_days = 0; //if not premium, then no processing days. 868 } 848 869 849 870 if ($processing_days && $processing_days > 0) { … … 872 893 if (isset($bt_sst_cached_delivery_estimates_delhivery[$cached_pincode_key])) { 873 894 $push_resp = $bt_sst_cached_delivery_estimates_delhivery[$cached_pincode_key][0]; 874 $express_tat = $ $bt_sst_cached_delivery_estimates_delhivery[$cached_pincode_key][1];895 $express_tat = $bt_sst_cached_delivery_estimates_delhivery[$cached_pincode_key][1]; 875 896 $response["message"] = "Data fetched from cache."; 876 897 } else { 877 $push_resp = $this->delhivery->get_rate_calcultor_and_date('E', 'Delivered', $pickup_pin, $delivery_pincode, '500' );898 $push_resp = $this->delhivery->get_rate_calcultor_and_date('E', 'Delivered', $pickup_pin, $delivery_pincode, '500','PREPAID'); 878 899 879 900 if ($push_resp != null && !empty($push_resp) && sizeof($push_resp) > 0) { … … 935 956 $processing_days = carbon_get_theme_option("bt_sst_shiprocket_processing_days"); 936 957 } 958 959 if(!$is_premium){ 960 $processing_days = 0; //if not premium, then no processing days. 961 } 937 962 if ($processing_days && $processing_days > 0) { 938 963 $min_date = $this->addDayswithdate($min_date, $processing_days); … … 959 984 } 960 985 961 $cutoff_time_str = carbon_get_theme_option('bt_sst_cutoff_time');962 986 $message = ""; 963 964 if (!$cutoff_time_str) { 965 $cutoff_time_str = '18:00:00'; 966 } 967 $timezone_string = get_option('timezone_string'); 968 if (!$timezone_string) { 969 $timezone_string = 'Asia/Kolkata'; 970 } 971 972 try { 973 $wp_timezone = new DateTimeZone($timezone_string); 974 } catch (Exception $e) { 975 // Handle the exception if the timezone is still invalid 976 $wp_timezone = new DateTimeZone('UTC'); // Fallback to UTC 977 } 978 979 // Get the current time in the WordPress timezone 980 $current_time = new DateTime('now', $wp_timezone); 981 982 // Create the cutoff time in the WordPress timezone 983 $cutoff_time = new DateTime($cutoff_time_str, $wp_timezone); 984 985 // Calculate the time difference 986 $time_diff = $cutoff_time->getTimestamp() - $current_time->getTimestamp(); 987 988 if ($time_diff > 0) { 989 $hours = floor($time_diff / 3600); 990 $minutes = floor(($time_diff % 3600) / 60); 991 $message = "If ordered within <strong>" . $hours . " hrs " . $minutes . " mins</strong>"; 992 } else { 993 // If the current time is past the cutoff, move the cutoff time to the next day 994 $cutoff_time->modify('+1 day'); 987 //cut off time processing for premium users 988 if($is_premium){ 989 $cutoff_time_str = carbon_get_theme_option('bt_sst_cutoff_time'); 990 991 992 if (!$cutoff_time_str) { 993 $cutoff_time_str = '18:00:00'; 994 } 995 $timezone_string = get_option('timezone_string'); 996 if (!$timezone_string) { 997 $timezone_string = 'Asia/Kolkata'; 998 } 999 1000 try { 1001 $wp_timezone = new DateTimeZone($timezone_string); 1002 } catch (Exception $e) { 1003 // Handle the exception if the timezone is still invalid 1004 $wp_timezone = new DateTimeZone('UTC'); // Fallback to UTC 1005 } 1006 1007 // Get the current time in the WordPress timezone 1008 $current_time = new DateTime('now', $wp_timezone); 1009 1010 // Create the cutoff time in the WordPress timezone 1011 $cutoff_time = new DateTime($cutoff_time_str, $wp_timezone); 1012 1013 // Calculate the time difference 995 1014 $time_diff = $cutoff_time->getTimestamp() - $current_time->getTimestamp(); 996 $hours = floor($time_diff / 3600); 997 $minutes = floor(($time_diff % 3600) / 60); 998 $message = "If ordered within <strong>" . $hours . " hrs " . $minutes . " mins</strong>"; 999 } 1000 1015 1016 if ($time_diff > 0) { 1017 $hours = floor($time_diff / 3600); 1018 $minutes = floor(($time_diff % 3600) / 60); 1019 $message = "If ordered within <strong>" . $hours . " hrs " . $minutes . " mins</strong>"; 1020 } else { 1021 // If the current time is past the cutoff, move the cutoff time to the next day 1022 $cutoff_time->modify('+1 day'); 1023 $time_diff = $cutoff_time->getTimestamp() - $current_time->getTimestamp(); 1024 $hours = floor($time_diff / 3600); 1025 $minutes = floor(($time_diff % 3600) / 60); 1026 $message = "If ordered within <strong>" . $hours . " hrs " . $minutes . " mins</strong>"; 1027 } 1028 } 1001 1029 $cut_of_time = $message; 1002 1030 $edit_postcode = '<div id="bt_sst_pincode_box_change_button" style=""><a href="#">Change</a></div>'; 1003 $processing_time = carbon_get_theme_option('bt_sst_shiprocket_processing_days'); 1004 if ($processing_time) { 1005 $processing_time = "<div class='bt_sst_processing_time'>Processing time: " . esc_html($processing_time) . " days</div>"; 1006 } 1007 1031 1032 //processing time calculation for premium users 1033 $processing_time = ""; 1008 1034 $ordered_date = new DateTime(); // create DateTime object 1009 $processing_time_min = carbon_get_theme_option('bt_sst_shiprocket_processing_days');1010 1011 1035 // Clone the DateTime object to calculate the shipped date 1012 1036 $shipped_date = clone $ordered_date; 1013 $shipped_date->modify("+{$processing_time_min} days"); 1037 if($is_premium){ 1038 $processing_time = carbon_get_theme_option('bt_sst_shiprocket_processing_days'); 1039 if ($processing_time) { 1040 $processing_time = "<div class='bt_sst_processing_time'>Processing time: " . esc_html($processing_time) . " days</div>"; 1041 } 1042 $processing_time_min = carbon_get_theme_option('bt_sst_shiprocket_processing_days',0); 1043 if(!empty($processing_time_min) && $processing_time_min > 0) { 1044 $shipped_date->modify("+{$processing_time_min} days"); 1045 } 1046 } 1014 1047 1015 1048 // Format both dates … … 1109 1142 $mess_text = str_ireplace("#edit#", $edit_postcode, $mess_text); 1110 1143 $mess_text = str_ireplace("#processing_time#", $processing_time, $mess_text); 1111 $mess_text = str_ireplace("#shipping Timeline#", $shippingTimeline, $mess_text);1144 $mess_text = str_ireplace("#shipping_timeline#", $shippingTimeline, $mess_text); 1112 1145 1113 1146 -
shipment-tracker-for-woocommerce/trunk/public/css/bt-sync-shipment-tracking-public.css
r3305118 r3308462 88 88 } 89 89 90 .bt_sync_shimpent_track_pincode_checker_wrap.realistic #pin_input_box { 91 border: none;; 92 } 93 94 .bt_sync_shimpent_track_pincode_checker_wrap.realistic #pin_input_box:focus{ 95 outline-width: 0px; 96 } 97 90 98 #bt_sync_shimpent_track_pincode_checker div:nth-child(1) { 91 99 flex-basis: 100%;/* make first take full width */ … … 140 148 padding: 20px; 141 149 background-color: #fff; 142 max-width: 600px;150 max-width: 400px; 143 151 /* margin: 20px auto; */ 144 152 font-family: Arial, sans-serif; 145 153 gap: 10px; 146 154 font-size: 15px; 155 width: fit-content; 156 min-width: 320px; 147 157 } 148 158 -
shipment-tracker-for-woocommerce/trunk/public/css/bt_sst_input_box_pincode_show_prime_x.css
r3305118 r3308462 1 1 2 2 .bt_sync_shimpent_track_pincode_checker_wrap.print_x { 3 width: 100%;4 max-width: 500px;3 width: fit-content; 4 max-width: 450px; 5 5 /* margin: 20px auto; */ 6 6 border-radius: 12px; … … 26 26 color: #000000; 27 27 padding: 18px 20px; 28 font-size: 1 8px;29 font-weight: 600;28 font-size: 14px; 29 font-weight: 400; 30 30 } 31 31 -
shipment-tracker-for-woocommerce/trunk/public/js/bt-sync-shipment-tracking-public.js
r3301611 r3308462 93 93 $("#delivery-form").hide(); 94 94 $("#loading-spinner").show(); 95 $.post( 96 bt_sync_shipment_tracking_data.ajax_url, 97 { action: "get_pincode_data_product_page", value: { p: pin, n: nounce,c:country, product_id:product_id,variation_id:variation_id} }, 98 function (abc) { 95 $.ajax({ 96 type: "POST", 97 url: bt_sync_shipment_tracking_data.ajax_url, 98 data: { 99 action: "get_pincode_data_product_page", 100 value: { 101 p: pin, 102 n: nounce, 103 c: country, 104 product_id: product_id, 105 variation_id: variation_id 106 } 107 }, 108 dataType: "json", 109 success: function (abc) { 99 110 $("#data_of_pin").show(); 100 111 if (abc.status) { 101 112 $("#data_of_pin").show(); 102 $("#delivery-form").show();103 $("#loading-spinner").hide();113 $("#delivery-form").show(); 114 $("#loading-spinner").hide(); 104 115 var resp = abc.data; 105 116 $("#data_of_pin").html(resp); 106 if (abc.check_error .data) {107 $('#bt_sync_shimpent_track_pincode_checker').css('display', 'none');108 $("#bt_sst_pincode_box_change_button").show();109 }else{110 $('#bt_sst_pincode_box_change_button').css('display', 'none');117 if (abc.check_error && abc.check_error.data) { 118 $('#bt_sync_shimpent_track_pincode_checker').css('display', 'none'); 119 $("#bt_sst_pincode_box_change_button").show(); 120 } else { 121 $('#bt_sst_pincode_box_change_button').css('display', 'none'); 111 122 } 112 123 } else { 113 124 var message = abc.message; 114 125 $("#data_of_pin").html(message); 115 116 126 } 117 127 if (abc.error) { … … 119 129 } 120 130 $("#pin_input_box").attr("style", "background-image: inherit"); 121 } 122 ); 131 }, 132 error: function (xhr, status, error) { 133 $("#loading-spinner").hide(); 134 $("#data_of_pin").show().html("An error occurred. Please try again or contact support."); 135 $("#pin_input_box").attr("style", "background-image: inherit"); 136 } 137 }); 123 138 } 124 139
Note: See TracChangeset
for help on using the changeset viewer.