Changeset 2010491
- Timestamp:
- 01/11/2019 10:28:15 AM (7 years ago)
- Location:
- smart-send-logistics
- Files:
-
- 1 added
- 14 deleted
- 10 edited
- 16 copied
-
assets/screenshot-1.jpg (modified) (previous)
-
assets/screenshot-2.jpg (modified) (previous)
-
assets/screenshot-3.jpg (modified) (previous)
-
assets/screenshot-5.jpg (modified) (previous)
-
assets/screenshot-6.jpg (added)
-
tags/8.0.12 (copied) (copied from smart-send-logistics/trunk)
-
tags/8.0.12/api (deleted)
-
tags/8.0.12/assets (copied) (copied from smart-send-logistics/trunk/assets)
-
tags/8.0.12/assets/css/ss-shipping-frontend.css (copied) (copied from smart-send-logistics/trunk/assets/css/ss-shipping-frontend.css)
-
tags/8.0.12/assets/js/ss-shipping-label.js (copied) (copied from smart-send-logistics/trunk/assets/js/ss-shipping-label.js)
-
tags/8.0.12/carriers (deleted)
-
tags/8.0.12/class.smartsend.bring.php (deleted)
-
tags/8.0.12/class.smartsend.gls.php (deleted)
-
tags/8.0.12/class.smartsend.postdanmark.php (deleted)
-
tags/8.0.12/class.smartsend.posten.php (deleted)
-
tags/8.0.12/class.smartsend.primary.php (deleted)
-
tags/8.0.12/css (deleted)
-
tags/8.0.12/includes (copied) (copied from smart-send-logistics/trunk/includes)
-
tags/8.0.12/includes/class-ss-shipping-autoloader.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-autoloader.php)
-
tags/8.0.12/includes/class-ss-shipping-logger.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-logger.php)
-
tags/8.0.12/includes/class-ss-shipping-shipment.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-shipment.php)
-
tags/8.0.12/includes/class-ss-shipping-wc-method.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-method.php)
-
tags/8.0.12/includes/class-ss-shipping-wc-order.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-order.php)
-
tags/8.0.12/includes/class-ss-shipping-wc-product.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-product.php)
-
tags/8.0.12/includes/frontend/class-ss-shipping-frontend.php (copied) (copied from smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php) (2 diffs)
-
tags/8.0.12/includes/lib/Smartsend/Api.php (modified) (3 diffs)
-
tags/8.0.12/includes/lib/Smartsend/Client.php (copied) (copied from smart-send-logistics/trunk/includes/lib/Smartsend/Client.php) (1 diff)
-
tags/8.0.12/includes/lib/Smartsend/Models/Shipment/Agent.php (copied) (copied from smart-send-logistics/trunk/includes/lib/Smartsend/Models/Shipment/Agent.php)
-
tags/8.0.12/lang (deleted)
-
tags/8.0.12/readme.txt (copied) (copied from smart-send-logistics/trunk/readme.txt) (2 diffs)
-
tags/8.0.12/settings.php (deleted)
-
tags/8.0.12/smart-send-logistics.php (copied) (copied from smart-send-logistics/trunk/smart-send-logistics.php) (3 diffs)
-
tags/8.0.12/smartsend-api-functions.php (deleted)
-
tags/8.0.12/smartsend-flexdelivery.php (deleted)
-
tags/8.0.12/smartsend-pickuppoint.php (deleted)
-
tags/8.0.12/woocommerce-smartsend-logistics.php (deleted)
-
trunk/includes/frontend/class-ss-shipping-frontend.php (modified) (2 diffs)
-
trunk/includes/lib/Smartsend/Api.php (modified) (3 diffs)
-
trunk/includes/lib/Smartsend/Client.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/smart-send-logistics.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smart-send-logistics/tags/8.0.12/includes/frontend/class-ss-shipping-frontend.php
r1984581 r2010491 75 75 $country = wc_clean($_POST['s_country']); 76 76 $postal_code = wc_clean($_POST['s_postcode']); 77 $city = (empty($_POST['s_city']) ? wc_clean($_POST['s_city']) : null);//not required but preferred 77 78 $street = wc_clean($_POST['s_address']); 78 79 79 80 $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']); 80 81 81 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, 82 $street); 82 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street); 83 83 84 84 if (!empty($ss_agents)) { … … 120 120 * @param $country string | ISO3166-A2 Country code 121 121 * @param $postal_code string 122 * @param $city string 122 123 * @param $street string 123 124 * 124 125 * @return array 125 126 */ 126 public function find_closest_agents_by_address($carrier, $country, $postal_code, $street) 127 { 128 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", street = "' . $street . '"'); 129 130 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, 131 $street)) { 127 public function find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street) 128 { 129 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", city = "' . $city . '", street = "' . $street . '"'); 130 131 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, $city, $street)) { 132 132 133 133 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); -
smart-send-logistics/tags/8.0.12/includes/lib/Smartsend/Api.php
r1949668 r2010491 116 116 $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout()); 117 117 } 118 118 119 119 /* 120 120 * Get agents located within an area … … 131 131 public function getAgentsInArea($carrier, $country=null, $min_latitude, $max_latitude,$min_longitude, $max_longitude) 132 132 { 133 if($country) {133 if ($country) { 134 134 $method = 'agents/carrier/'.$carrier.'/country/'.$country 135 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude136 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;135 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude 136 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude; 137 137 } else { 138 138 $method = 'agents/carrier/'.$carrier 139 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude140 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;139 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude 140 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude; 141 141 } 142 142 … … 165 165 * @param string $country is the country in which the agents should be located 166 166 * @param string $postal_code is the postal code to search for close agents from 167 * @param string $city is the city to search for close agents from 167 168 * @param string $street is the street name to search for close agents from 168 169 * 169 170 * return array of agent objects 170 171 */ 171 public function findClosestAgentByAddress($carrier, $country, $postal_code, $street) 172 { 173 return $this->httpGet($method='agents/closest/carrier/'.$carrier.'/country/'.$country.'/postalcode/'.$postal_code.'/street/'.$street, 172 public function findClosestAgentByAddress($carrier, $country, $postal_code, $city=null, $street) 173 { 174 $method = 'agents/closest/carrier/'.$carrier.'/country/'.$country.'/postalcode/'.$postal_code; 175 if ($city) { 176 $method .= '/city/'.$city; 177 } 178 $method .= '/street/'.$street; 179 return $this->httpGet($method, 174 180 $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout()); 175 181 } -
smart-send-logistics/tags/8.0.12/includes/lib/Smartsend/Client.php
r1975504 r2010491 12 12 const TIMEOUT = 30; 13 13 14 private $api_host = 'https:// smartsend-prod.apigee.net/api/v1/';14 private $api_host = 'https://app.smartsend.io/api/v1/'; 15 15 private $website; 16 16 private $api_token; -
smart-send-logistics/tags/8.0.12/readme.txt
r2007746 r2010491 9 9 Requires at least: 3.0.1 10 10 Tested up to: 5.0 11 Stable tag: 8.0.1 111 Stable tag: 8.0.12 12 12 License: GNU General Public License v3.0 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html 14 WC requires at least: 2.7.014 WC requires at least: 3.0.0 15 15 WC tested up to: 3.5 16 16 Requires PHP: 5.6.0 … … 182 182 == Screenshots == 183 183 184 1. Add shipping methods to WooCommerce Shipping Zones185 2. C onnect WooCommerce to Smart Send by entering the API Token186 3. Create PDF shipping labels from backend with just one click184 1. Show closest pick-up points during checkout 185 2. Create PDF shipping labels from backend with just one click 186 3. Save tracking information automatically after creating shipping labels 187 187 4. Get detailed error description if something is incorrect 188 5. Save tracking information automatically after creating shipping labels 188 5. Add shipping methods to WooCommerce Shipping Zones 189 6. Connect WooCommerce to Smart Send by entering the API Token 190 189 191 190 192 == Changelog == 193 194 = 8.0.12 = 195 * Add city to request when searching for closest agents for improved accuracy 196 * Change WooCommerce minimum requirement to WC 3.0 191 197 192 198 = 8.0.11 = -
smart-send-logistics/tags/8.0.12/smart-send-logistics.php
r2007746 r2010491 7 7 * Author URI: https://www.smartsend.io 8 8 * Text Domain: smart-send-logistics 9 * Version: 8.0.1 19 * Version: 8.0.12 10 10 * WC requires at least: 2.6.0 11 11 * WC tested up to: 3.5 … … 35 35 { 36 36 37 private $version = "8.0.1 1";37 private $version = "8.0.12"; 38 38 39 39 /** … … 512 512 * Find the closest agents by address - Convenience wrapper 513 513 * 514 * @param $carrier string |unique carrier code515 * @param $country string |ISO3166-A2 Country code514 * @param $carrier string unique carrier code 515 * @param $country string ISO3166-A2 Country code 516 516 * @param $postal_code string 517 517 * @param $street string 518 * @param $city string optional but providing a city yields better accuracy for geocoding 518 519 * 519 520 * @return array 520 521 */ 521 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street ) {522 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street, $city=null) { 522 523 return $this->ss_shipping_frontend 523 ->find_closest_agents_by_address($carrier, $country, $postal_code, $ street);524 ->find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street); 524 525 } 525 526 -
smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php
r1984581 r2010491 75 75 $country = wc_clean($_POST['s_country']); 76 76 $postal_code = wc_clean($_POST['s_postcode']); 77 $city = (empty($_POST['s_city']) ? wc_clean($_POST['s_city']) : null);//not required but preferred 77 78 $street = wc_clean($_POST['s_address']); 78 79 79 80 $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']); 80 81 81 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, 82 $street); 82 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street); 83 83 84 84 if (!empty($ss_agents)) { … … 120 120 * @param $country string | ISO3166-A2 Country code 121 121 * @param $postal_code string 122 * @param $city string 122 123 * @param $street string 123 124 * 124 125 * @return array 125 126 */ 126 public function find_closest_agents_by_address($carrier, $country, $postal_code, $street) 127 { 128 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", street = "' . $street . '"'); 129 130 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, 131 $street)) { 127 public function find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street) 128 { 129 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", city = "' . $city . '", street = "' . $street . '"'); 130 131 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, $city, $street)) { 132 132 133 133 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); -
smart-send-logistics/trunk/includes/lib/Smartsend/Api.php
r1949668 r2010491 116 116 $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout()); 117 117 } 118 118 119 119 /* 120 120 * Get agents located within an area … … 131 131 public function getAgentsInArea($carrier, $country=null, $min_latitude, $max_latitude,$min_longitude, $max_longitude) 132 132 { 133 if($country) {133 if ($country) { 134 134 $method = 'agents/carrier/'.$carrier.'/country/'.$country 135 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude136 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;135 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude 136 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude; 137 137 } else { 138 138 $method = 'agents/carrier/'.$carrier 139 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude140 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;139 .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude 140 .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude; 141 141 } 142 142 … … 165 165 * @param string $country is the country in which the agents should be located 166 166 * @param string $postal_code is the postal code to search for close agents from 167 * @param string $city is the city to search for close agents from 167 168 * @param string $street is the street name to search for close agents from 168 169 * 169 170 * return array of agent objects 170 171 */ 171 public function findClosestAgentByAddress($carrier, $country, $postal_code, $street) 172 { 173 return $this->httpGet($method='agents/closest/carrier/'.$carrier.'/country/'.$country.'/postalcode/'.$postal_code.'/street/'.$street, 172 public function findClosestAgentByAddress($carrier, $country, $postal_code, $city=null, $street) 173 { 174 $method = 'agents/closest/carrier/'.$carrier.'/country/'.$country.'/postalcode/'.$postal_code; 175 if ($city) { 176 $method .= '/city/'.$city; 177 } 178 $method .= '/street/'.$street; 179 return $this->httpGet($method, 174 180 $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout()); 175 181 } -
smart-send-logistics/trunk/includes/lib/Smartsend/Client.php
r1975504 r2010491 12 12 const TIMEOUT = 30; 13 13 14 private $api_host = 'https:// smartsend-prod.apigee.net/api/v1/';14 private $api_host = 'https://app.smartsend.io/api/v1/'; 15 15 private $website; 16 16 private $api_token; -
smart-send-logistics/trunk/readme.txt
r2007746 r2010491 9 9 Requires at least: 3.0.1 10 10 Tested up to: 5.0 11 Stable tag: 8.0.1 111 Stable tag: 8.0.12 12 12 License: GNU General Public License v3.0 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html 14 WC requires at least: 2.7.014 WC requires at least: 3.0.0 15 15 WC tested up to: 3.5 16 16 Requires PHP: 5.6.0 … … 182 182 == Screenshots == 183 183 184 1. Add shipping methods to WooCommerce Shipping Zones185 2. C onnect WooCommerce to Smart Send by entering the API Token186 3. Create PDF shipping labels from backend with just one click184 1. Show closest pick-up points during checkout 185 2. Create PDF shipping labels from backend with just one click 186 3. Save tracking information automatically after creating shipping labels 187 187 4. Get detailed error description if something is incorrect 188 5. Save tracking information automatically after creating shipping labels 188 5. Add shipping methods to WooCommerce Shipping Zones 189 6. Connect WooCommerce to Smart Send by entering the API Token 190 189 191 190 192 == Changelog == 193 194 = 8.0.12 = 195 * Add city to request when searching for closest agents for improved accuracy 196 * Change WooCommerce minimum requirement to WC 3.0 191 197 192 198 = 8.0.11 = -
smart-send-logistics/trunk/smart-send-logistics.php
r2007746 r2010491 7 7 * Author URI: https://www.smartsend.io 8 8 * Text Domain: smart-send-logistics 9 * Version: 8.0.1 19 * Version: 8.0.12 10 10 * WC requires at least: 2.6.0 11 11 * WC tested up to: 3.5 … … 35 35 { 36 36 37 private $version = "8.0.1 1";37 private $version = "8.0.12"; 38 38 39 39 /** … … 512 512 * Find the closest agents by address - Convenience wrapper 513 513 * 514 * @param $carrier string |unique carrier code515 * @param $country string |ISO3166-A2 Country code514 * @param $carrier string unique carrier code 515 * @param $country string ISO3166-A2 Country code 516 516 * @param $postal_code string 517 517 * @param $street string 518 * @param $city string optional but providing a city yields better accuracy for geocoding 518 519 * 519 520 * @return array 520 521 */ 521 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street ) {522 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street, $city=null) { 522 523 return $this->ss_shipping_frontend 523 ->find_closest_agents_by_address($carrier, $country, $postal_code, $ street);524 ->find_closest_agents_by_address($carrier, $country, $postal_code, $city, $street); 524 525 } 525 526
Note: See TracChangeset
for help on using the changeset viewer.