Plugin Directory

Changeset 1984581


Ignore:
Timestamp:
12/03/2018 05:30:36 PM (7 years ago)
Author:
SmartSend
Message:

Tagging version 8.0.10

Location:
smart-send-logistics
Files:
14 deleted
4 edited
15 copied

Legend:

Unmodified
Added
Removed
  • smart-send-logistics/tags/8.0.10/includes/class-ss-shipping-wc-method.php

    r1975504 r1984581  
    3939                        'postnord_homedelivery'            => __('PostNord: Private delivery to address (MyPack Home)',
    4040                            'smart-send-logistics'),
     41                        'postnord_homedeliverysmall'       => __('PostNord: Private delivery to address Small (MyPack Home Small)',
     42                            'smart-send-logistics'),
    4143                        'postnord_homedeliveryeconomy'     => __('PostNord: Private economy delivery to address (MyPack Home Economy)',
    4244                            'smart-send-logistics'),
  • smart-send-logistics/tags/8.0.10/includes/frontend/class-ss-shipping-frontend.php

    r1975504 r1984581  
    7979                    $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']);
    8080
    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
    9186                        $ss_setting = SS_SHIPPING_WC()->get_ss_shipping_settings();
    9287
     
    109104                        <?php
    110105                    } else {
    111 
    112                         SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString());
    113 
    114106                        echo '<div class="woocommerce-info ss-agent-info">' . __('Shipping to closest pick-up point',
    115107                                'smart-send-logistics') . '</div>';
     
    120112                }
    121113            }
     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            }
    122145        }
    123146
  • smart-send-logistics/tags/8.0.10/readme.txt

    r1975504 r1984581  
    99Requires at least: 3.0.1
    1010Tested up to: 5.0
    11 Stable tag: 8.0.9
     11Stable tag: 8.0.10
    1212License: GNU General Public License v3.0
    1313License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    190190== Changelog ==
    191191
     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
    192196= 8.0.9 =
    193197* Bugfix: Link to PDF label not always formatted as link
  • smart-send-logistics/tags/8.0.10/smart-send-logistics.php

    r1975504 r1984581  
    77 * Author URI: https://www.smartsend.io
    88 * Text Domain: smart-send-logistics
    9  * Version: 8.0.9
     9 * Version: 8.0.10
    1010 * WC requires at least: 2.6.0
    1111 * WC tested up to: 3.5
     
    3535    {
    3636
    37         private $version = "8.0.9";
     37        private $version = "8.0.10";
    3838
    3939        /**
     
    419419        }
    420420
    421         /*
     421        /**
    422422         * Get the url of the current site
    423423         *
     
    509509        }
    510510
    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        /**
    512527         * Sort the shipping methods according to setting
    513528         *
    514529         * @param array $available_shipping_methods
     530         *
     531         * @return array
    515532         */
    516533        public function ss_sort_shipping_methods($available_shipping_methods)
  • smart-send-logistics/trunk/includes/class-ss-shipping-wc-method.php

    r1975504 r1984581  
    3939                        'postnord_homedelivery'            => __('PostNord: Private delivery to address (MyPack Home)',
    4040                            'smart-send-logistics'),
     41                        'postnord_homedeliverysmall'       => __('PostNord: Private delivery to address Small (MyPack Home Small)',
     42                            'smart-send-logistics'),
    4143                        'postnord_homedeliveryeconomy'     => __('PostNord: Private economy delivery to address (MyPack Home Economy)',
    4244                            'smart-send-logistics'),
  • smart-send-logistics/trunk/includes/frontend/class-ss-shipping-frontend.php

    r1975504 r1984581  
    7979                    $carrier = SS_SHIPPING_WC()->get_shipping_method_carrier($meta_data['smart_send_shipping_method']);
    8080
    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
    9186                        $ss_setting = SS_SHIPPING_WC()->get_ss_shipping_settings();
    9287
     
    109104                        <?php
    110105                    } else {
    111 
    112                         SS_SHIPPING_WC()->log_msg('Response from "findClosestAgentByAddress": ' . SS_SHIPPING_WC()->get_api_handle()->getErrorString());
    113 
    114106                        echo '<div class="woocommerce-info ss-agent-info">' . __('Shipping to closest pick-up point',
    115107                                'smart-send-logistics') . '</div>';
     
    120112                }
    121113            }
     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            }
    122145        }
    123146
  • smart-send-logistics/trunk/readme.txt

    r1975504 r1984581  
    99Requires at least: 3.0.1
    1010Tested up to: 5.0
    11 Stable tag: 8.0.9
     11Stable tag: 8.0.10
    1212License: GNU General Public License v3.0
    1313License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    190190== Changelog ==
    191191
     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
    192196= 8.0.9 =
    193197* Bugfix: Link to PDF label not always formatted as link
  • smart-send-logistics/trunk/smart-send-logistics.php

    r1975504 r1984581  
    77 * Author URI: https://www.smartsend.io
    88 * Text Domain: smart-send-logistics
    9  * Version: 8.0.9
     9 * Version: 8.0.10
    1010 * WC requires at least: 2.6.0
    1111 * WC tested up to: 3.5
     
    3535    {
    3636
    37         private $version = "8.0.9";
     37        private $version = "8.0.10";
    3838
    3939        /**
     
    419419        }
    420420
    421         /*
     421        /**
    422422         * Get the url of the current site
    423423         *
     
    509509        }
    510510
    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        /**
    512527         * Sort the shipping methods according to setting
    513528         *
    514529         * @param array $available_shipping_methods
     530         *
     531         * @return array
    515532         */
    516533        public function ss_sort_shipping_methods($available_shipping_methods)
Note: See TracChangeset for help on using the changeset viewer.