Changeset 1984581
- Timestamp:
- 12/03/2018 05:30:36 PM (7 years ago)
- Location:
- smart-send-logistics
- Files:
-
- 14 deleted
- 4 edited
- 15 copied
-
tags/8.0.10 (copied) (copied from smart-send-logistics/trunk)
-
tags/8.0.10/api (deleted)
-
tags/8.0.10/assets (copied) (copied from smart-send-logistics/trunk/assets)
-
tags/8.0.10/assets/css/ss-shipping-frontend.css (copied) (copied from smart-send-logistics/trunk/assets/css/ss-shipping-frontend.css)
-
tags/8.0.10/assets/js/ss-shipping-label.js (copied) (copied from smart-send-logistics/trunk/assets/js/ss-shipping-label.js)
-
tags/8.0.10/carriers (deleted)
-
tags/8.0.10/class.smartsend.bring.php (deleted)
-
tags/8.0.10/class.smartsend.gls.php (deleted)
-
tags/8.0.10/class.smartsend.postdanmark.php (deleted)
-
tags/8.0.10/class.smartsend.posten.php (deleted)
-
tags/8.0.10/class.smartsend.primary.php (deleted)
-
tags/8.0.10/css (deleted)
-
tags/8.0.10/includes (copied) (copied from smart-send-logistics/trunk/includes)
-
tags/8.0.10/includes/class-ss-shipping-autoloader.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-autoloader.php)
-
tags/8.0.10/includes/class-ss-shipping-logger.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-logger.php)
-
tags/8.0.10/includes/class-ss-shipping-shipment.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-shipment.php)
-
tags/8.0.10/includes/class-ss-shipping-wc-method.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-method.php) (1 diff)
-
tags/8.0.10/includes/class-ss-shipping-wc-order.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-order.php)
-
tags/8.0.10/includes/class-ss-shipping-wc-product.php (copied) (copied from smart-send-logistics/trunk/includes/class-ss-shipping-wc-product.php)
-
tags/8.0.10/includes/frontend/class-ss-shipping-frontend.php (copied) (copied from smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php) (3 diffs)
-
tags/8.0.10/includes/lib/Smartsend/Client.php (copied) (copied from smart-send-logistics/trunk/includes/lib/Smartsend/Client.php)
-
tags/8.0.10/lang (deleted)
-
tags/8.0.10/readme.txt (copied) (copied from smart-send-logistics/trunk/readme.txt) (2 diffs)
-
tags/8.0.10/settings.php (deleted)
-
tags/8.0.10/smart-send-logistics.php (copied) (copied from smart-send-logistics/trunk/smart-send-logistics.php) (4 diffs)
-
tags/8.0.10/smartsend-api-functions.php (deleted)
-
tags/8.0.10/smartsend-flexdelivery.php (deleted)
-
tags/8.0.10/smartsend-pickuppoint.php (deleted)
-
tags/8.0.10/woocommerce-smartsend-logistics.php (deleted)
-
trunk/includes/class-ss-shipping-wc-method.php (modified) (1 diff)
-
trunk/includes/frontend/class-ss-shipping-frontend.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/smart-send-logistics.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smart-send-logistics/tags/8.0.10/includes/class-ss-shipping-wc-method.php
r1975504 r1984581 39 39 'postnord_homedelivery' => __('PostNord: Private delivery to address (MyPack Home)', 40 40 'smart-send-logistics'), 41 'postnord_homedeliverysmall' => __('PostNord: Private delivery to address Small (MyPack Home Small)', 42 'smart-send-logistics'), 41 43 'postnord_homedeliveryeconomy' => __('PostNord: Private economy delivery to address (MyPack Home Economy)', 42 44 'smart-send-logistics'), -
smart-send-logistics/tags/8.0.10/includes/frontend/class-ss-shipping-frontend.php
r1975504 r1984581 79 79 $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']); 80 80 81 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", street = "' . $street . '"'); 82 83 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, 84 $street)) { 85 86 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); 87 88 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getResponseBody()); 89 // Save all of the agents in sessions 90 WC()->session->set('ss_shipping_agents', $ss_agents); 81 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, 82 $street); 83 84 if (!empty($ss_agents)) { 85 91 86 $ss_setting = SS_SHIPPING_WC()->get_ss_shipping_settings(); 92 87 … … 109 104 <?php 110 105 } else { 111 112 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString());113 114 106 echo '<div class="woocommerce-info ss-agent-info">' . __('Shipping to closest pick-up point', 115 107 'smart-send-logistics') . '</div>'; … … 120 112 } 121 113 } 114 } 115 116 /** 117 * Find the closest agents by address 118 * 119 * @param $carrier string | unique carrier code 120 * @param $country string | ISO3166-A2 Country code 121 * @param $postal_code string 122 * @param $street string 123 * 124 * @return array 125 */ 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)) { 132 133 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); 134 135 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getResponseBody()); 136 // Save all of the agents in sessions 137 WC()->session->set('ss_shipping_agents', $ss_agents); 138 139 return $ss_agents; 140 } else { 141 SS_SHIPPING_WC()->log_msg( 'Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString() ); 142 143 return array(); 144 } 122 145 } 123 146 -
smart-send-logistics/tags/8.0.10/readme.txt
r1975504 r1984581 9 9 Requires at least: 3.0.1 10 10 Tested up to: 5.0 11 Stable tag: 8.0. 911 Stable tag: 8.0.10 12 12 License: GNU General Public License v3.0 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 190 190 == Changelog == 191 191 192 = 8.0.10 = 193 * Add convenience wrapper for pick-up point function 194 * Add PostNord shipping method: Private delivery to address Small (MyPack Home Small) 195 192 196 = 8.0.9 = 193 197 * Bugfix: Link to PDF label not always formatted as link -
smart-send-logistics/tags/8.0.10/smart-send-logistics.php
r1975504 r1984581 7 7 * Author URI: https://www.smartsend.io 8 8 * Text Domain: smart-send-logistics 9 * Version: 8.0. 99 * Version: 8.0.10 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. 9";37 private $version = "8.0.10"; 38 38 39 39 /** … … 419 419 } 420 420 421 /* 421 /** 422 422 * Get the url of the current site 423 423 * … … 509 509 } 510 510 511 /* 511 /** 512 * Find the closest agents by address - Convenience wrapper 513 * 514 * @param $carrier string | unique carrier code 515 * @param $country string | ISO3166-A2 Country code 516 * @param $postal_code string 517 * @param $street string 518 * 519 * @return array 520 */ 521 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street) { 522 return $this->ss_shipping_frontend 523 ->find_closest_agents_by_address($carrier, $country, $postal_code, $street); 524 } 525 526 /** 512 527 * Sort the shipping methods according to setting 513 528 * 514 529 * @param array $available_shipping_methods 530 * 531 * @return array 515 532 */ 516 533 public function ss_sort_shipping_methods($available_shipping_methods) -
smart-send-logistics/trunk/includes/class-ss-shipping-wc-method.php
r1975504 r1984581 39 39 'postnord_homedelivery' => __('PostNord: Private delivery to address (MyPack Home)', 40 40 'smart-send-logistics'), 41 'postnord_homedeliverysmall' => __('PostNord: Private delivery to address Small (MyPack Home Small)', 42 'smart-send-logistics'), 41 43 'postnord_homedeliveryeconomy' => __('PostNord: Private economy delivery to address (MyPack Home Economy)', 42 44 'smart-send-logistics'), -
smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php
r1975504 r1984581 79 79 $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']); 80 80 81 SS_SHIPPING_WC()->log_msg('Called "findClosestAgentByAddress" with carrier = "' . $carrier . '", country = "' . $country . '", postcode = "' . $postal_code . '", street = "' . $street . '"'); 82 83 if (SS_SHIPPING_WC()->get_api_handle()->findClosestAgentByAddress($carrier, $country, $postal_code, 84 $street)) { 85 86 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); 87 88 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getResponseBody()); 89 // Save all of the agents in sessions 90 WC()->session->set('ss_shipping_agents', $ss_agents); 81 $ss_agents = $this->find_closest_agents_by_address($carrier, $country, $postal_code, 82 $street); 83 84 if (!empty($ss_agents)) { 85 91 86 $ss_setting = SS_SHIPPING_WC()->get_ss_shipping_settings(); 92 87 … … 109 104 <?php 110 105 } else { 111 112 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString());113 114 106 echo '<div class="woocommerce-info ss-agent-info">' . __('Shipping to closest pick-up point', 115 107 'smart-send-logistics') . '</div>'; … … 120 112 } 121 113 } 114 } 115 116 /** 117 * Find the closest agents by address 118 * 119 * @param $carrier string | unique carrier code 120 * @param $country string | ISO3166-A2 Country code 121 * @param $postal_code string 122 * @param $street string 123 * 124 * @return array 125 */ 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)) { 132 133 $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData(); 134 135 SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getResponseBody()); 136 // Save all of the agents in sessions 137 WC()->session->set('ss_shipping_agents', $ss_agents); 138 139 return $ss_agents; 140 } else { 141 SS_SHIPPING_WC()->log_msg( 'Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString() ); 142 143 return array(); 144 } 122 145 } 123 146 -
smart-send-logistics/trunk/readme.txt
r1975504 r1984581 9 9 Requires at least: 3.0.1 10 10 Tested up to: 5.0 11 Stable tag: 8.0. 911 Stable tag: 8.0.10 12 12 License: GNU General Public License v3.0 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 190 190 == Changelog == 191 191 192 = 8.0.10 = 193 * Add convenience wrapper for pick-up point function 194 * Add PostNord shipping method: Private delivery to address Small (MyPack Home Small) 195 192 196 = 8.0.9 = 193 197 * Bugfix: Link to PDF label not always formatted as link -
smart-send-logistics/trunk/smart-send-logistics.php
r1975504 r1984581 7 7 * Author URI: https://www.smartsend.io 8 8 * Text Domain: smart-send-logistics 9 * Version: 8.0. 99 * Version: 8.0.10 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. 9";37 private $version = "8.0.10"; 38 38 39 39 /** … … 419 419 } 420 420 421 /* 421 /** 422 422 * Get the url of the current site 423 423 * … … 509 509 } 510 510 511 /* 511 /** 512 * Find the closest agents by address - Convenience wrapper 513 * 514 * @param $carrier string | unique carrier code 515 * @param $country string | ISO3166-A2 Country code 516 * @param $postal_code string 517 * @param $street string 518 * 519 * @return array 520 */ 521 public function ss_find_closest_agents_by_address($carrier, $country, $postal_code, $street) { 522 return $this->ss_shipping_frontend 523 ->find_closest_agents_by_address($carrier, $country, $postal_code, $street); 524 } 525 526 /** 512 527 * Sort the shipping methods according to setting 513 528 * 514 529 * @param array $available_shipping_methods 530 * 531 * @return array 515 532 */ 516 533 public function ss_sort_shipping_methods($available_shipping_methods)
Note: See TracChangeset
for help on using the changeset viewer.