Changeset 1729128
- Timestamp:
- 09/13/2017 07:33:37 AM (9 years ago)
- Location:
- blu-logistics/trunk
- Files:
-
- 2 edited
-
bluAPI.php (modified) (3 diffs)
-
class-blu-global-method.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
blu-logistics/trunk/bluAPI.php
r1697902 r1729128 58 58 $newStore = json_decode($stores,true); 59 59 60 $testAry['apt_id'] = '040';61 $testAry['name'] = 'bluPort@bluHQ';62 $testAry['bluport_id'] = 'BMV001';63 $testAry['loc_desc'] = 'Beside Udders and back entrance';64 $testAry['address1'] = '1 Maju Ave';65 $testAry['country'] = 'SG';66 $testAry['zip_code'] = '556679';67 $testAry['latitude'] = '1.365210';68 $testAry['longitude'] = '103.865300';69 array_unshift($newStore['apt'],$testAry);70 60 return $newStore['apt']; 71 61 } … … 83 73 84 74 $parcelID = $merchant['blu_merchant_id'].'-'.$order_id; 85 $parcelAPI = 'http://118.201.198.205:8080/infologBLUAPI _Training/api/SAVEPARCEL';75 $parcelAPI = 'http://118.201.198.205:8080/infologBLUAPI/api/SAVEPARCEL'; 86 76 87 77 $dropoff = ($dropoff_settings['drop_off'] ? $dropoff_settings['drop_off'] : 0); … … 200 190 </parcel_status>'; 201 191 202 $parcelAPI = 'http://118.201.198.205:8080/infologBLUAPI _Training/api/PARCELTRACK';192 $parcelAPI = 'http://118.201.198.205:8080/infologBLUAPI/api/PARCELTRACK'; 203 193 $response = $this->blsm_parcel_curl_api($parcelAPI,$postString); 204 194 -
blu-logistics/trunk/class-blu-global-method.php
r1697902 r1729128 924 924 $response['rate'] = 0; 925 925 926 if($this->get_option('free_shipping') == 'yes'){ 926 if($options['use_api']) 927 { 928 $result = $this->getAPIPrice($package); 929 930 if($result == "FAILED"){ 931 $response['allowed_countries'] = false; 932 return $response; 933 } 934 else{ 935 if($options['mark_up'] == 'fixed'){ 936 $cost = $result + $options['price']; 937 } 938 else if($options['mark_up'] == 'percent'){ 939 $cost = (($options['price']/100) * WC()->cart->cart_contents_total) + $result; 940 } 941 else 942 $cost = $result; 943 } 944 945 $response['allowed_countries'] = true; 946 $response['rate'] = $cost; 947 return $response; 948 949 } 950 else if($this->get_option('free_shipping') == 'yes'){ 927 951 $response['allowed_countries'] = true; 928 952 return $response; 929 953 } 930 954 else { 931 if($options['use_api']) 932 { 933 $result = $this->getAPIPrice($package); 934 935 if($result == "FAILED"){ 936 $response['allowed_countries'] = false; 937 return $response; 938 } 939 else{ 940 if($options['mark_up'] == 'fixed'){ 941 $cost = $result + $options['price']; 942 } 943 else if($options['mark_up'] == 'percent'){ 944 $cost = (($options['price']/100) * WC()->cart->cart_contents_total) + $result; 945 } 946 else 947 $cost = $result; 948 } 949 950 } 951 else { 952 if($rates[0]['condition'] == 'total'){ 953 //price based comparisons 954 $cost = $this->find_matching_rate(WC()->cart->cart_contents_total, $rates); 955 } else { 956 //weight based comparison 957 $cost = $this->find_matching_rate(WC()->cart->cart_contents_weight, $rates); 958 } 959 } 960 961 $cost = round($cost,2); 962 $response['allowed_countries'] = true; 963 $response['rate'] = $cost; 964 return $response; 955 if($rates[0]['condition'] == 'total'){ 956 //price based comparisons 957 $cost = $this->find_matching_rate(WC()->cart->cart_contents_total, $rates); 958 } else { 959 //weight based comparison 960 $cost = $this->find_matching_rate(WC()->cart->cart_contents_weight, $rates); 961 } 962 963 $response['allowed_countries'] = true; 964 $response['rate'] = $cost; 965 return $response; 965 966 } 966 967
Note: See TracChangeset
for help on using the changeset viewer.