Plugin Directory

Changeset 2916269


Ignore:
Timestamp:
05/23/2023 09:18:16 AM (3 years ago)
Author:
shindhl
Message:

Release 2.0.13

  • Added ENVELOPE parcel type. This will be introduced mid 2023.
  • Updated bulk options by size
Location:
dhlpwc
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dhlpwc/tags/2.0.13/README.md

    r2889874 r2916269  
    11# DHL Parcel for WooCommerce
     2 
     3v2.0.13
     4## Changes
     5- Added ENVELOPE parcel type. This will be introduced mid 2023.
     6- Updated bulk options by size
    27 
    38v2.0.12
  • dhlpwc/tags/2.0.13/dhlpwoocommerce.php

    r2889874 r2916269  
    55 * Description:          This is the official DHL Parcel for WooCommerce plugin.
    66 * Author:               DHL Parcel
    7  * Version:              2.0.12
     7 * Version:              2.0.13
    88 * Requires at least:    4.7.16
    99 * Tested up to:         6.2
  • dhlpwc/tags/2.0.13/includes/model/logic/class-dhlpwc-model-logic-access-control.php

    r2836525 r2916269  
    203203
    204204        $bulk_options = array(
     205            'smallest',
    205206            'bp_only',
    206             'smallest',
     207            'envelope_only',
     208            'xsmall_only',
    207209            'small_only',
    208210            'medium_only',
    209211            'large_only',
    210             'xsmall_only',
    211212            'xlarge_only',
    212213            'roll_only',
  • dhlpwc/tags/2.0.13/includes/model/service/class-dhlpwc-model-service-shipment.php

    r2836525 r2916269  
    225225            if (!in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_PS, $preset_options)) {
    226226                // BP preference
    227                 if ($selected_size === 'bp_only') {
     227                if ($selected_size === 'bp_only' || $selected_size === 'envelope_only') {
    228228                    if ( in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_DOOR, $preset_options)) {
    229229                        // Remove DOOR
     
    330330                        $smallest_dimensions = null;
    331331                        foreach($sizes as $size) {
     332                            // Skip parcel-type ENVELOPE for 'bp_only'
     333                            if ($selected_size === 'bp_only' && strtolower($size->key) === 'envelope') {
     334                                continue;
     335                            }
     336
    332337                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
    333338                            $size_dimensions = $size->dimensions->max_width_cm * $size->dimensions->max_length_cm * $size->dimensions->max_height_cm;
     
    343348                        }
    344349                        break;
     350                    case 'envelope_only':
     351                        foreach($sizes as $size) {
     352                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
     353                            if (strtolower($size->key) === 'envelope') {
     354                                $label_size = $size->key;
     355                                break;
     356                            }
     357                        }
     358
     359
     360                        break;
     361                    case 'xsmall_only':
     362                        foreach($sizes as $size) {
     363                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
     364                            if (strtolower($size->key) === 'xsmall') {
     365                                $label_size = $size->key;
     366                                break;
     367                            }
     368                        }
     369                        break;
    345370                    case 'small_only':
    346371                        foreach($sizes as $size) {
     
    365390                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
    366391                            if (strtolower($size->key) === 'large') {
    367                                 $label_size = $size->key;
    368                                 break;
    369                             }
    370                         }
    371                         break;
    372                     case 'xsmall_only':
    373                         foreach($sizes as $size) {
    374                             /** @var DHLPWC_Model_API_Data_Parceltype $size */
    375                             if (strtolower($size->key) === 'xsmall') {
    376392                                $label_size = $size->key;
    377393                                break;
  • dhlpwc/tags/2.0.13/includes/model/service/class-dhlpwc-model-service-translation.php

    r2777069 r2916269  
    5757        if (!$this->parcel_types) {
    5858            $this->parcel_types = [
    59                 'PARCELTYPE_SMALL'  => __('Small', 'dhlpwc'),
    60                 'PARCELTYPE_MEDIUM' => __('Medium', 'dhlpwc'),
    61                 'PARCELTYPE_LARGE'  => __('Large', 'dhlpwc'),
    62                 'PARCELTYPE_PALLET' => __('Pallet', 'dhlpwc'),
    63                 'PARCELTYPE_BULKY'  => __('Bulky', 'dhlpwc'),
    64                 'PARCELTYPE_ROLL'   => __('Roll', 'dhlpwc'),
    65                 'PARCELTYPE_XSMALL' => __('Extra Small', 'dhlpwc'),
    66                 'PARCELTYPE_XLARGE' => __('Extra Large', 'dhlpwc'),
     59                'PARCELTYPE_ENVELOPE' => __('Envelope (50-500 grams)', 'dhlpwc'),
     60                'PARCELTYPE_XSMALL'   => __('Extra Small', 'dhlpwc'),
     61                'PARCELTYPE_SMALL'    => __('Small', 'dhlpwc'),
     62                'PARCELTYPE_MEDIUM'   => __('Medium', 'dhlpwc'),
     63                'PARCELTYPE_LARGE'    => __('Large', 'dhlpwc'),
     64                'PARCELTYPE_PALLET'   => __('Pallet', 'dhlpwc'),
     65                'PARCELTYPE_BULKY'    => __('Bulky', 'dhlpwc'),
     66                'PARCELTYPE_ROLL'     => __('Roll', 'dhlpwc'),
     67                'PARCELTYPE_XLARGE'   => __('Extra Large', 'dhlpwc'),
    6768            ];
    6869        }
     
    7879        if (!$this->bulk_operations) {
    7980            $this->bulk_operations = [
    80                 'BP_ONLY'     => __('Mailbox only', 'dhlpwc'),
    81                 'SMALLEST'    => __('Smallest', 'dhlpwc'),
    82                 'SMALL_ONLY'  => __('Small only', 'dhlpwc'),
    83                 'MEDIUM_ONLY' => __('Medium only', 'dhlpwc'),
    84                 'LARGE_ONLY'  => __('Large only', 'dhlpwc'),
    85                 'XSMALL_ONLY' => __('Extra Small only', 'dhlpwc'),
    86                 'XLARGE_ONLY' => __('Extra Large only', 'dhlpwc'),
    87                 'ROLL_ONLY'   => __('Roll only', 'dhlpwc'),
    88                 'BULKY_ONLY'  => __('Bulky only', 'dhlpwc'),
    89                 'LARGEST'     => __('Largest only', 'dhlpwc'),
     81                'SMALLEST'      => __('Smallest', 'dhlpwc'),
     82                'ENVELOPE_ONLY' => __('Envelope (50-500gr)', 'dhlpwc'),
     83                'XSMALL_ONLY'   => __('Extra Small only', 'dhlpwc'),
     84                'BP_ONLY'       => __('Mailbox only (0,5-2kg)', 'dhlpwc'),
     85                'SMALL_ONLY'    => __('Small only', 'dhlpwc'),
     86                'MEDIUM_ONLY'   => __('Medium only', 'dhlpwc'),
     87                'LARGE_ONLY'    => __('Large only', 'dhlpwc'),
     88                'XLARGE_ONLY'   => __('Extra Large only', 'dhlpwc'),
     89                'ROLL_ONLY'     => __('Roll only', 'dhlpwc'),
     90                'BULKY_ONLY'    => __('Bulky only', 'dhlpwc'),
     91                'LARGEST'       => __('Largest only', 'dhlpwc'),
    9092            ];
    9193        }
  • dhlpwc/tags/2.0.13/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php

    r2836525 r2916269  
    291291            ),
    292292
    293             $this->get_bulk_group_fields('bp_only', __('Choose mailbox, skip if unavailable', 'dhlpwc')),
    294293            $this->get_bulk_group_fields('smallest', __('Choose the smallest available size', 'dhlpwc')),
     294            $this->get_bulk_group_fields('envelope_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_ENVELOPE'))),
     295            $this->get_bulk_group_fields('xsmall_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XSMALL'))),
     296            $this->get_bulk_group_fields('bp_only', __('Choose mailbox (0.5-2kg), skip if unavailable', 'dhlpwc')),
    295297            $this->get_bulk_group_fields('small_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_SMALL'))),
    296298            $this->get_bulk_group_fields('medium_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_MEDIUM'))),
    297299            $this->get_bulk_group_fields('large_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_LARGE'))),
    298             $this->get_bulk_group_fields('xsmall_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XSMALL'))),
    299300            $this->get_bulk_group_fields('xlarge_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XLARGE'))),
    300301            $this->get_bulk_group_fields('roll_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_ROLL'))),
  • dhlpwc/tags/2.0.13/readme.txt

    r2892674 r2916269  
    55Requires PHP:         5.6
    66Tested up to:         6.2
    7 Stable tag:           2.0.12
     7Stable tag:           2.0.13
    88WC requires at least: 3.0.0
    99WC tested up to:      7.3.0
     
    5353
    5454== Changelog ==
     55 
     56= 2.0.13 =
     57- Added ENVELOPE parcel type. This will be introduced mid 2023.
     58- Updated bulk options by size
    5559 
    5660= 2.0.12 =
  • dhlpwc/trunk/README.md

    r2889874 r2916269  
    11# DHL Parcel for WooCommerce
     2 
     3v2.0.13
     4## Changes
     5- Added ENVELOPE parcel type. This will be introduced mid 2023.
     6- Updated bulk options by size
    27 
    38v2.0.12
  • dhlpwc/trunk/dhlpwoocommerce.php

    r2889874 r2916269  
    55 * Description:          This is the official DHL Parcel for WooCommerce plugin.
    66 * Author:               DHL Parcel
    7  * Version:              2.0.12
     7 * Version:              2.0.13
    88 * Requires at least:    4.7.16
    99 * Tested up to:         6.2
  • dhlpwc/trunk/includes/model/logic/class-dhlpwc-model-logic-access-control.php

    r2836525 r2916269  
    203203
    204204        $bulk_options = array(
     205            'smallest',
    205206            'bp_only',
    206             'smallest',
     207            'envelope_only',
     208            'xsmall_only',
    207209            'small_only',
    208210            'medium_only',
    209211            'large_only',
    210             'xsmall_only',
    211212            'xlarge_only',
    212213            'roll_only',
  • dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-shipment.php

    r2836525 r2916269  
    225225            if (!in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_PS, $preset_options)) {
    226226                // BP preference
    227                 if ($selected_size === 'bp_only') {
     227                if ($selected_size === 'bp_only' || $selected_size === 'envelope_only') {
    228228                    if ( in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_DOOR, $preset_options)) {
    229229                        // Remove DOOR
     
    330330                        $smallest_dimensions = null;
    331331                        foreach($sizes as $size) {
     332                            // Skip parcel-type ENVELOPE for 'bp_only'
     333                            if ($selected_size === 'bp_only' && strtolower($size->key) === 'envelope') {
     334                                continue;
     335                            }
     336
    332337                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
    333338                            $size_dimensions = $size->dimensions->max_width_cm * $size->dimensions->max_length_cm * $size->dimensions->max_height_cm;
     
    343348                        }
    344349                        break;
     350                    case 'envelope_only':
     351                        foreach($sizes as $size) {
     352                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
     353                            if (strtolower($size->key) === 'envelope') {
     354                                $label_size = $size->key;
     355                                break;
     356                            }
     357                        }
     358
     359
     360                        break;
     361                    case 'xsmall_only':
     362                        foreach($sizes as $size) {
     363                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
     364                            if (strtolower($size->key) === 'xsmall') {
     365                                $label_size = $size->key;
     366                                break;
     367                            }
     368                        }
     369                        break;
    345370                    case 'small_only':
    346371                        foreach($sizes as $size) {
     
    365390                            /** @var DHLPWC_Model_API_Data_Parceltype $size */
    366391                            if (strtolower($size->key) === 'large') {
    367                                 $label_size = $size->key;
    368                                 break;
    369                             }
    370                         }
    371                         break;
    372                     case 'xsmall_only':
    373                         foreach($sizes as $size) {
    374                             /** @var DHLPWC_Model_API_Data_Parceltype $size */
    375                             if (strtolower($size->key) === 'xsmall') {
    376392                                $label_size = $size->key;
    377393                                break;
  • dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-translation.php

    r2777069 r2916269  
    5757        if (!$this->parcel_types) {
    5858            $this->parcel_types = [
    59                 'PARCELTYPE_SMALL'  => __('Small', 'dhlpwc'),
    60                 'PARCELTYPE_MEDIUM' => __('Medium', 'dhlpwc'),
    61                 'PARCELTYPE_LARGE'  => __('Large', 'dhlpwc'),
    62                 'PARCELTYPE_PALLET' => __('Pallet', 'dhlpwc'),
    63                 'PARCELTYPE_BULKY'  => __('Bulky', 'dhlpwc'),
    64                 'PARCELTYPE_ROLL'   => __('Roll', 'dhlpwc'),
    65                 'PARCELTYPE_XSMALL' => __('Extra Small', 'dhlpwc'),
    66                 'PARCELTYPE_XLARGE' => __('Extra Large', 'dhlpwc'),
     59                'PARCELTYPE_ENVELOPE' => __('Envelope (50-500 grams)', 'dhlpwc'),
     60                'PARCELTYPE_XSMALL'   => __('Extra Small', 'dhlpwc'),
     61                'PARCELTYPE_SMALL'    => __('Small', 'dhlpwc'),
     62                'PARCELTYPE_MEDIUM'   => __('Medium', 'dhlpwc'),
     63                'PARCELTYPE_LARGE'    => __('Large', 'dhlpwc'),
     64                'PARCELTYPE_PALLET'   => __('Pallet', 'dhlpwc'),
     65                'PARCELTYPE_BULKY'    => __('Bulky', 'dhlpwc'),
     66                'PARCELTYPE_ROLL'     => __('Roll', 'dhlpwc'),
     67                'PARCELTYPE_XLARGE'   => __('Extra Large', 'dhlpwc'),
    6768            ];
    6869        }
     
    7879        if (!$this->bulk_operations) {
    7980            $this->bulk_operations = [
    80                 'BP_ONLY'     => __('Mailbox only', 'dhlpwc'),
    81                 'SMALLEST'    => __('Smallest', 'dhlpwc'),
    82                 'SMALL_ONLY'  => __('Small only', 'dhlpwc'),
    83                 'MEDIUM_ONLY' => __('Medium only', 'dhlpwc'),
    84                 'LARGE_ONLY'  => __('Large only', 'dhlpwc'),
    85                 'XSMALL_ONLY' => __('Extra Small only', 'dhlpwc'),
    86                 'XLARGE_ONLY' => __('Extra Large only', 'dhlpwc'),
    87                 'ROLL_ONLY'   => __('Roll only', 'dhlpwc'),
    88                 'BULKY_ONLY'  => __('Bulky only', 'dhlpwc'),
    89                 'LARGEST'     => __('Largest only', 'dhlpwc'),
     81                'SMALLEST'      => __('Smallest', 'dhlpwc'),
     82                'ENVELOPE_ONLY' => __('Envelope (50-500gr)', 'dhlpwc'),
     83                'XSMALL_ONLY'   => __('Extra Small only', 'dhlpwc'),
     84                'BP_ONLY'       => __('Mailbox only (0,5-2kg)', 'dhlpwc'),
     85                'SMALL_ONLY'    => __('Small only', 'dhlpwc'),
     86                'MEDIUM_ONLY'   => __('Medium only', 'dhlpwc'),
     87                'LARGE_ONLY'    => __('Large only', 'dhlpwc'),
     88                'XLARGE_ONLY'   => __('Extra Large only', 'dhlpwc'),
     89                'ROLL_ONLY'     => __('Roll only', 'dhlpwc'),
     90                'BULKY_ONLY'    => __('Bulky only', 'dhlpwc'),
     91                'LARGEST'       => __('Largest only', 'dhlpwc'),
    9092            ];
    9193        }
  • dhlpwc/trunk/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php

    r2836525 r2916269  
    291291            ),
    292292
    293             $this->get_bulk_group_fields('bp_only', __('Choose mailbox, skip if unavailable', 'dhlpwc')),
    294293            $this->get_bulk_group_fields('smallest', __('Choose the smallest available size', 'dhlpwc')),
     294            $this->get_bulk_group_fields('envelope_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_ENVELOPE'))),
     295            $this->get_bulk_group_fields('xsmall_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XSMALL'))),
     296            $this->get_bulk_group_fields('bp_only', __('Choose mailbox (0.5-2kg), skip if unavailable', 'dhlpwc')),
    295297            $this->get_bulk_group_fields('small_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_SMALL'))),
    296298            $this->get_bulk_group_fields('medium_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_MEDIUM'))),
    297299            $this->get_bulk_group_fields('large_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_LARGE'))),
    298             $this->get_bulk_group_fields('xsmall_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XSMALL'))),
    299300            $this->get_bulk_group_fields('xlarge_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_XLARGE'))),
    300301            $this->get_bulk_group_fields('roll_only', sprintf(__("Choose size '%s' only, skip if unavailable", 'dhlpwc'), DHLPWC_Model_Service_Translation::instance()->parcelType('PARCELTYPE_ROLL'))),
  • dhlpwc/trunk/readme.txt

    r2892674 r2916269  
    55Requires PHP:         5.6
    66Tested up to:         6.2
    7 Stable tag:           2.0.12
     7Stable tag:           2.0.13
    88WC requires at least: 3.0.0
    99WC tested up to:      7.3.0
     
    5353
    5454== Changelog ==
     55 
     56= 2.0.13 =
     57- Added ENVELOPE parcel type. This will be introduced mid 2023.
     58- Updated bulk options by size
    5559 
    5660= 2.0.12 =
Note: See TracChangeset for help on using the changeset viewer.