Plugin Directory

Changeset 2702736


Ignore:
Timestamp:
03/31/2022 02:04:50 PM (4 years ago)
Author:
shindhl
Message:

Release 2.8.11 (DHL Parcel)

  • DHL Parcel: Updated tracking url for Belgium
  • DHL Parcel: Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions
  • DHL Parcel: Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action
Location:
dhl-for-woocommerce
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/README.md

    r2698319 r2702736  
    11# DHL Parcel for WooCommerce
     2 
     3v2.0.3
     4## Changes
     5- Fixed a bug with pages not loading when DHL for WooCommerce and DHL Parcel for WooCommerce are both activated
    26 
    37v2.0.2
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/dhlpwoocommerce.php

    r2698319 r2702736  
    55 * Description:          This is the official DHL Parcel for WooCommerce plugin.
    66 * Author:               DHL Parcel
    7  * Version:              2.0.3
     7 * Version:              2.0.4
    88 * Requires at least:    4.7.16
    99 * Tested up to:         5.9
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/includes/controller/class-dhlpwc-controller-mail.php

    r2615906 r2702736  
    7676        $postcode = $service->get_postcode_from_order($order->get_id());
    7777
     78        $service = DHLPWC_Model_Service_Order_Meta::instance();
     79        $country_code = $service->get_country_code($order->get_id());
     80
    7881        $service = DHLPWC_Model_Service_Track_Trace::instance();
    7982        $tracking_codes = $service->get_track_trace_from_order($order->get_id());
     
    8386        foreach($tracking_codes as $tracking_code) {
    8487            $tracking_codeset = array();
    85             $tracking_codeset['url'] = $service->get_url($tracking_code, $postcode, $locale);
     88            $tracking_codeset['url'] = $service->get_url($tracking_code, $postcode, $locale, $country_code);
    8689            $tracking_codeset['code'] = $tracking_code;
    8790            $tracking_codesets[] = $tracking_codeset;
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/includes/model/service/class-dhlpwc-model-service-label-metabox.php

    r2682260 r2702736  
    294294        $postcode = $service->get_postcode_from_order($post_id);
    295295
     296        $service = DHLPWC_Model_Service_Order_Meta::instance();
     297        $country_code = $service->get_country_code($post_id);
     298
    296299        $service = DHLPWC_Model_Service_Track_Trace::instance();
    297         $tracking_url = $service->get_url($label['tracker_code'], $postcode, $locale);
     300        $tracking_url = $service->get_url($label['tracker_code'], $postcode, $locale, $country_code);
    298301
    299302        $service = DHLPWC_Model_Service_Access_Control::instance();
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/includes/model/service/class-dhlpwc-model-service-order-meta.php

    r2669998 r2702736  
    4646    }
    4747
     48    public function get_country_code($order_id)
     49    {
     50        $order = wc_get_order($order_id);
     51        $address = $order->get_address('shipping') ?: $order->get_address();
     52        return strtoupper($address['country']);
     53    }
    4854}
    4955
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/includes/model/service/class-dhlpwc-model-service-shipment.php

    r2669998 r2702736  
    211211
    212212        foreach ($order_ids as $order_id) {
     213            $selected_size = $bulk_size;
    213214
    214215            // Generate to business option
     
    227228            if ($option_service->send_with_bp($order_id)) {
    228229                // Simulate bp_only print when eligible for BP
    229                 $bulk_size = 'bp_only';
     230                $service = DHLPWC_Model_Service_Access_Control::instance();
     231                $sizes = $service->check(DHLPWC_Model_Service_Access_Control::ACCESS_CAPABILITY_PARCELTYPE, array(
     232                    'order_id' => $order_id,
     233                    'options' => [DHLPWC_Model_Meta_Order_Option_Preference::OPTION_BP],
     234                    'to_business' => $to_business,
     235                ));
     236
     237                if (!empty($sizes)) {
     238                    $selected_size = 'bp_only';
     239                }
    230240            }
    231241
     
    233243            if (!in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_PS, $preset_options)) {
    234244                // BP preference
    235                 if ($bulk_size === 'bp_only') {
     245                if ($selected_size === 'bp_only') {
    236246                    if ( in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_DOOR, $preset_options)) {
    237247                        // Remove DOOR
     
    314324            } else {
    315325                $label_size = null;
    316                 switch($bulk_size) {
     326                switch($selected_size) {
    317327                    case 'bp_only':
    318328                    case 'smallest':
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/includes/model/service/class-dhlpwc-model-service-track-trace.php

    r2519608 r2702736  
    1212    const QUERY_LANDCODE = 'lc';
    1313
     14    protected $url_be = 'https://www.dhlparcel.be/nl/particulieren/volg-je-zending';
    1415    protected $url = 'https://www.dhlparcel.nl/nl/volg-uw-zending-0';
    1516
    16     public function get_url($tracking_code = null, $postcode = null, $locale = null)
     17    public function get_url($tracking_code = null, $postcode = null, $locale = null, $country_code = null)
    1718    {
    1819        $query_args = array();
     
    2930        }
    3031
    31         return add_query_arg($query_args, $this->url);
     32        $tracking_url = $this->url;
     33        if ($country_code === 'BE') {
     34            $tracking_url = $this->url_be;
     35        }
     36
     37        return add_query_arg($query_args, $tracking_url);
    3238    }
    3339
  • dhl-for-woocommerce/tags/2.8.11/dhlpwoocommerce/readme.txt

    r2698319 r2702736  
    55Requires PHP:         5.6
    66Tested up to:         5.9
    7 Stable tag:           2.0.3
     7Stable tag:           2.0.4
    88WC requires at least: 3.0.0
    99WC tested up to:      5.3.0
     
    5353
    5454== Changelog ==
     55 
     56= 2.0.3 =
     57- Fixed a bug with pages not loading when DHL for WooCommerce and DHL Parcel for WooCommerce are both activated
    5558 
    5659= 2.0.2 =
  • dhl-for-woocommerce/tags/2.8.11/pr-dhl-woocommerce.php

    r2698319 r2702736  
    88 * Text Domain: dhl-for-woocommerce
    99 * Domain Path: /lang
    10  * Version: 2.8.10
     10 * Version: 2.8.11
    1111 * WC requires at least: 3.0
    1212 * WC tested up to: 5.6
     
    3636class PR_DHL_WC {
    3737
    38     private $version = "2.8.10";
     38    private $version = "2.8.11";
    3939
    4040    /**
  • dhl-for-woocommerce/tags/2.8.11/readme.txt

    r2698319 r2702736  
    66Requires PHP: 5.6
    77Tested up to: 5.9
    8 Stable tag: 2.8.10
     8Stable tag: 2.8.11
    99WC requires at least: 3.0
    1010WC tested up to: 6.1
     
    8181
    8282== Changelog ==
     83 
     84= 2.8.11 =
     85* DHL Parcel: Updated tracking url for Belgium
     86* DHL Parcel: Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions
     87* DHL Parcel: Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action
    8388 
    8489= 2.8.10 =
  • dhl-for-woocommerce/trunk/readme.txt

    r2698319 r2702736  
    66Requires PHP: 5.6
    77Tested up to: 4.8.2
    8 Stable tag: 2.8.10
     8Stable tag: 2.8.11
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.