Plugin Directory

Changeset 2010491


Ignore:
Timestamp:
01/11/2019 10:28:15 AM (7 years ago)
Author:
SmartSend
Message:

Tagging version 8.0.12

Location:
smart-send-logistics
Files:
1 added
14 deleted
10 edited
16 copied

Legend:

Unmodified
Added
Removed
  • smart-send-logistics/tags/8.0.12/includes/frontend/class-ss-shipping-frontend.php

    r1984581 r2010491  
    7575                    $country = wc_clean($_POST['s_country']);
    7676                    $postal_code = wc_clean($_POST['s_postcode']);
     77                    $city = (empty($_POST['s_city']) ? wc_clean($_POST['s_city']) : null);//not required but preferred
    7778                    $street = wc_clean($_POST['s_address']);
    7879
    7980                    $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']);
    8081
    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);
    8383
    8484                    if (!empty($ss_agents)) {
     
    120120         * @param $country string | ISO3166-A2 Country code
    121121         * @param $postal_code string
     122         * @param $city string
    122123         * @param $street string
    123124         *
    124125         * @return array
    125126         */
    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)) {
    132132
    133133                $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData();
  • smart-send-logistics/tags/8.0.12/includes/lib/Smartsend/Api.php

    r1949668 r2010491  
    116116            $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout());
    117117    }
    118    
     118
    119119    /*
    120120     * Get agents located within an area
     
    131131    public function getAgentsInArea($carrier, $country=null, $min_latitude, $max_latitude,$min_longitude, $max_longitude)
    132132    {
    133         if($country) {
     133        if ($country) {
    134134            $method = 'agents/carrier/'.$carrier.'/country/'.$country
    135             .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
    136             .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
     135                .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
     136                .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
    137137        } else {
    138138            $method = 'agents/carrier/'.$carrier
    139             .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
    140             .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
     139                .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
     140                .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
    141141        }
    142142
     
    165165     * @param string $country is the country in which the agents should be located
    166166     * @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
    167168     * @param string $street is the street name to search for close agents from
    168169     *
    169170     * return array of agent objects
    170171     */
    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,
    174180            $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout());
    175181    }
  • smart-send-logistics/tags/8.0.12/includes/lib/Smartsend/Client.php

    r1975504 r2010491  
    1212    const TIMEOUT = 30;
    1313
    14     private $api_host = 'https://smartsend-prod.apigee.net/api/v1/';
     14    private $api_host = 'https://app.smartsend.io/api/v1/';
    1515    private $website;
    1616    private $api_token;
  • smart-send-logistics/tags/8.0.12/readme.txt

    r2007746 r2010491  
    99Requires at least: 3.0.1
    1010Tested up to: 5.0
    11 Stable tag: 8.0.11
     11Stable tag: 8.0.12
    1212License: GNU General Public License v3.0
    1313License URI: http://www.gnu.org/licenses/gpl-3.0.html
    14 WC requires at least: 2.7.0
     14WC requires at least: 3.0.0
    1515WC tested up to: 3.5
    1616Requires PHP: 5.6.0
     
    182182== Screenshots ==
    183183
    184 1. Add shipping methods to WooCommerce Shipping Zones
    185 2. Connect WooCommerce to Smart Send by entering the API Token
    186 3. Create PDF shipping labels from backend with just one click
     1841. Show closest pick-up points during checkout
     1852. Create PDF shipping labels from backend with just one click
     1863. Save tracking information automatically after creating shipping labels
    1871874. Get detailed error description if something is incorrect
    188 5. Save tracking information automatically after creating shipping labels
     1885. Add shipping methods to WooCommerce Shipping Zones
     1896. Connect WooCommerce to Smart Send by entering the API Token
     190
    189191
    190192== 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
    191197
    192198= 8.0.11 =
  • smart-send-logistics/tags/8.0.12/smart-send-logistics.php

    r2007746 r2010491  
    77 * Author URI: https://www.smartsend.io
    88 * Text Domain: smart-send-logistics
    9  * Version: 8.0.11
     9 * Version: 8.0.12
    1010 * WC requires at least: 2.6.0
    1111 * WC tested up to: 3.5
     
    3535    {
    3636
    37         private $version = "8.0.11";
     37        private $version = "8.0.12";
    3838
    3939        /**
     
    512512         * Find the closest agents by address - Convenience wrapper
    513513         *
    514          * @param $carrier string | unique carrier code
    515          * @param $country string | ISO3166-A2 Country code
     514         * @param $carrier string unique carrier code
     515         * @param $country string ISO3166-A2 Country code
    516516         * @param $postal_code string
    517517         * @param $street string
     518         * @param $city string optional but providing a city yields better accuracy for geocoding
    518519         *
    519520         * @return array
    520521         */
    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) {
    522523            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);
    524525        }
    525526
  • smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php

    r1984581 r2010491  
    7575                    $country = wc_clean($_POST['s_country']);
    7676                    $postal_code = wc_clean($_POST['s_postcode']);
     77                    $city = (empty($_POST['s_city']) ? wc_clean($_POST['s_city']) : null);//not required but preferred
    7778                    $street = wc_clean($_POST['s_address']);
    7879
    7980                    $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']);
    8081
    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);
    8383
    8484                    if (!empty($ss_agents)) {
     
    120120         * @param $country string | ISO3166-A2 Country code
    121121         * @param $postal_code string
     122         * @param $city string
    122123         * @param $street string
    123124         *
    124125         * @return array
    125126         */
    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)) {
    132132
    133133                $ss_agents = SS_SHIPPING_WC()->get_api_handle()->getData();
  • smart-send-logistics/trunk/includes/lib/Smartsend/Api.php

    r1949668 r2010491  
    116116            $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout());
    117117    }
    118    
     118
    119119    /*
    120120     * Get agents located within an area
     
    131131    public function getAgentsInArea($carrier, $country=null, $min_latitude, $max_latitude,$min_longitude, $max_longitude)
    132132    {
    133         if($country) {
     133        if ($country) {
    134134            $method = 'agents/carrier/'.$carrier.'/country/'.$country
    135             .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
    136             .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
     135                .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
     136                .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
    137137        } else {
    138138            $method = 'agents/carrier/'.$carrier
    139             .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
    140             .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
     139                .'/area/latitude/min/'.$min_latitude.'/max/'.$max_latitude
     140                .'/longitude/min/'.$min_longitude.'/max/'.$max_longitude;
    141141        }
    142142
     
    165165     * @param string $country is the country in which the agents should be located
    166166     * @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
    167168     * @param string $street is the street name to search for close agents from
    168169     *
    169170     * return array of agent objects
    170171     */
    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,
    174180            $args = array(), $headers = array(), $body=null, $timeout=$this->getAgentTimeout());
    175181    }
  • smart-send-logistics/trunk/includes/lib/Smartsend/Client.php

    r1975504 r2010491  
    1212    const TIMEOUT = 30;
    1313
    14     private $api_host = 'https://smartsend-prod.apigee.net/api/v1/';
     14    private $api_host = 'https://app.smartsend.io/api/v1/';
    1515    private $website;
    1616    private $api_token;
  • smart-send-logistics/trunk/readme.txt

    r2007746 r2010491  
    99Requires at least: 3.0.1
    1010Tested up to: 5.0
    11 Stable tag: 8.0.11
     11Stable tag: 8.0.12
    1212License: GNU General Public License v3.0
    1313License URI: http://www.gnu.org/licenses/gpl-3.0.html
    14 WC requires at least: 2.7.0
     14WC requires at least: 3.0.0
    1515WC tested up to: 3.5
    1616Requires PHP: 5.6.0
     
    182182== Screenshots ==
    183183
    184 1. Add shipping methods to WooCommerce Shipping Zones
    185 2. Connect WooCommerce to Smart Send by entering the API Token
    186 3. Create PDF shipping labels from backend with just one click
     1841. Show closest pick-up points during checkout
     1852. Create PDF shipping labels from backend with just one click
     1863. Save tracking information automatically after creating shipping labels
    1871874. Get detailed error description if something is incorrect
    188 5. Save tracking information automatically after creating shipping labels
     1885. Add shipping methods to WooCommerce Shipping Zones
     1896. Connect WooCommerce to Smart Send by entering the API Token
     190
    189191
    190192== 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
    191197
    192198= 8.0.11 =
  • smart-send-logistics/trunk/smart-send-logistics.php

    r2007746 r2010491  
    77 * Author URI: https://www.smartsend.io
    88 * Text Domain: smart-send-logistics
    9  * Version: 8.0.11
     9 * Version: 8.0.12
    1010 * WC requires at least: 2.6.0
    1111 * WC tested up to: 3.5
     
    3535    {
    3636
    37         private $version = "8.0.11";
     37        private $version = "8.0.12";
    3838
    3939        /**
     
    512512         * Find the closest agents by address - Convenience wrapper
    513513         *
    514          * @param $carrier string | unique carrier code
    515          * @param $country string | ISO3166-A2 Country code
     514         * @param $carrier string unique carrier code
     515         * @param $country string ISO3166-A2 Country code
    516516         * @param $postal_code string
    517517         * @param $street string
     518         * @param $city string optional but providing a city yields better accuracy for geocoding
    518519         *
    519520         * @return array
    520521         */
    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) {
    522523            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);
    524525        }
    525526
Note: See TracChangeset for help on using the changeset viewer.