Plugin Directory

Changeset 2939441


Ignore:
Timestamp:
07/17/2023 01:14:51 PM (3 years ago)
Author:
shindhl
Message:

Release 2.0.14

  • Updated package weight to display more accurate values
  • Updated ServicePoint deliveries to default to SMALL package size
Location:
dhlpwc
Files:
14 edited
1 copied

Legend:

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

    r2916269 r2939441  
    11# DHL Parcel for WooCommerce
     2 
     3v2.0.14
     4## Changes
     5- Updated package weight to display more accurate values
     6- Updated ServicePoint deliveries to default to SMALL package size
    27 
    38v2.0.13
  • dhlpwc/tags/2.0.14/assets/js/dhlpwc.metabox.js

    r2846823 r2939441  
    303303
    304304    }).on('dhlpwc:select_default_size', function() {
    305         if ($('input:radio[name=dhlpwc-label-create-size]:not(:disabled)').not(':checked')) {
    306             $('input:radio[name=dhlpwc-label-create-size]:not(:disabled):first').attr('checked', true);
     305        let selectedSize = $('input:radio[name=dhlpwc-label-create-size]:not(:disabled)').filter(
     306            function (value, index) {
     307                return index.value !== 'XSMALL' && index.value !== 'ENVELOPE';
     308            }
     309        );
     310
     311        if (selectedSize.not(':checked')) {
     312            selectedSize.first().attr('checked', true);
     313        }
     314
     315        if ($('input:radio[name=dhlpwc-label-create-size]:checked').length === 0) {
     316            $('input:radio[name=dhlpwc-label-create-size]:not(:disabled):first').attr('checked', true)
    307317        }
    308318
    309319    }).on('change', '.dhlpwc-metabox-address-input', function(e) {
    310             $(document.body).trigger('dhlpwc:metabox_address_sync');
     320        $(document.body).trigger('dhlpwc:metabox_address_sync');
    311321
    312322    }).on('dhlpwc:metabox_address_sync', function(e) {
  • dhlpwc/tags/2.0.14/dhlpwoocommerce.php

    r2916269 r2939441  
    55 * Description:          This is the official DHL Parcel for WooCommerce plugin.
    66 * Author:               DHL Parcel
    7  * Version:              2.0.13
     7 * Version:              2.0.14
    88 * Requires at least:    4.7.16
    99 * Tested up to:         6.2
  • dhlpwc/tags/2.0.14/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php

    r2688414 r2939441  
    1515    public $min_weight_kg;
    1616    public $max_weight_kg;
     17    public $min_weight_grams;
     18    public $max_weight_grams;
    1719    /** @var DHLPWC_Model_API_Data_Parceltype_Dimensions */
    1820    public $dimensions;
  • dhlpwc/tags/2.0.14/includes/model/service/class-dhlpwc-model-service-label-metabox.php

    r2836525 r2939441  
    283283                foreach ($sizes as $size) {
    284284                    $view = new DHLPWC_Template('order.meta.form.size');
     285                    $size->display_weight = $this->get_weight_display($size);
    285286                    $size_view .= $view->render(array(
    286287                        'parceltype' => $size,
     
    295296
    296297            return $size_view;
     298        }
     299
     300        protected function get_weight_display($size)
     301        {
     302            $unit = 'kg';
     303            $display_min_weight = round($size->min_weight_grams / 1000, 3);
     304            $display_max_weight = round($size->max_weight_grams / 1000, 3);
     305            if ($size->max_weight_grams < 1000) {
     306                return sprintf('min %s %s, max %s %s', $display_min_weight, $unit, $display_max_weight, $unit);
     307            }
     308
     309            return sprintf('max %s %s', $display_max_weight, $unit);
    297310        }
    298311
  • dhlpwc/tags/2.0.14/includes/view/order/meta/form/size.php

    r2688414 r2939441  
    11<?php if (!defined('ABSPATH')) { exit; } ?>
    22<input type="radio" class="dhlpwc-label-create-size" name="dhlpwc-label-create-size" value="<?php echo esc_attr($parceltype->key) ?>" /><strong><?php echo esc_html($description) ?></strong>
    3 ( <i><?php echo esc_html($parceltype->min_weight_kg) ?>-<?php echo esc_html($parceltype->max_weight_kg) ?> kg, <?php echo esc_html($parceltype->dimensions->max_length_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_width_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_height_cm) ?> cm</i> )<br/>
     3( <i><?php echo esc_html($parceltype->display_weight) ?> <?php echo esc_html($parceltype->dimensions->max_length_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_width_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_height_cm) ?> cm</i> )<br/>
  • dhlpwc/tags/2.0.14/readme.txt

    r2916269 r2939441  
    55Requires PHP:         5.6
    66Tested up to:         6.2
    7 Stable tag:           2.0.13
     7Stable tag:           2.0.14
    88WC requires at least: 3.0.0
    99WC tested up to:      7.3.0
     
    5353
    5454== Changelog ==
     55 
     56= 2.0.14 =
     57- Updated package weight to display more accurate values
     58- Updated ServicePoint deliveries to default to SMALL package size
    5559 
    5660= 2.0.13 =
  • dhlpwc/trunk/README.md

    r2916269 r2939441  
    11# DHL Parcel for WooCommerce
     2 
     3v2.0.14
     4## Changes
     5- Updated package weight to display more accurate values
     6- Updated ServicePoint deliveries to default to SMALL package size
    27 
    38v2.0.13
  • dhlpwc/trunk/assets/js/dhlpwc.metabox.js

    r2846823 r2939441  
    303303
    304304    }).on('dhlpwc:select_default_size', function() {
    305         if ($('input:radio[name=dhlpwc-label-create-size]:not(:disabled)').not(':checked')) {
    306             $('input:radio[name=dhlpwc-label-create-size]:not(:disabled):first').attr('checked', true);
     305        let selectedSize = $('input:radio[name=dhlpwc-label-create-size]:not(:disabled)').filter(
     306            function (value, index) {
     307                return index.value !== 'XSMALL' && index.value !== 'ENVELOPE';
     308            }
     309        );
     310
     311        if (selectedSize.not(':checked')) {
     312            selectedSize.first().attr('checked', true);
     313        }
     314
     315        if ($('input:radio[name=dhlpwc-label-create-size]:checked').length === 0) {
     316            $('input:radio[name=dhlpwc-label-create-size]:not(:disabled):first').attr('checked', true)
    307317        }
    308318
    309319    }).on('change', '.dhlpwc-metabox-address-input', function(e) {
    310             $(document.body).trigger('dhlpwc:metabox_address_sync');
     320        $(document.body).trigger('dhlpwc:metabox_address_sync');
    311321
    312322    }).on('dhlpwc:metabox_address_sync', function(e) {
  • dhlpwc/trunk/dhlpwoocommerce.php

    r2916269 r2939441  
    55 * Description:          This is the official DHL Parcel for WooCommerce plugin.
    66 * Author:               DHL Parcel
    7  * Version:              2.0.13
     7 * Version:              2.0.14
    88 * Requires at least:    4.7.16
    99 * Tested up to:         6.2
  • dhlpwc/trunk/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php

    r2688414 r2939441  
    1515    public $min_weight_kg;
    1616    public $max_weight_kg;
     17    public $min_weight_grams;
     18    public $max_weight_grams;
    1719    /** @var DHLPWC_Model_API_Data_Parceltype_Dimensions */
    1820    public $dimensions;
  • dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-label-metabox.php

    r2836525 r2939441  
    283283                foreach ($sizes as $size) {
    284284                    $view = new DHLPWC_Template('order.meta.form.size');
     285                    $size->display_weight = $this->get_weight_display($size);
    285286                    $size_view .= $view->render(array(
    286287                        'parceltype' => $size,
     
    295296
    296297            return $size_view;
     298        }
     299
     300        protected function get_weight_display($size)
     301        {
     302            $unit = 'kg';
     303            $display_min_weight = round($size->min_weight_grams / 1000, 3);
     304            $display_max_weight = round($size->max_weight_grams / 1000, 3);
     305            if ($size->max_weight_grams < 1000) {
     306                return sprintf('min %s %s, max %s %s', $display_min_weight, $unit, $display_max_weight, $unit);
     307            }
     308
     309            return sprintf('max %s %s', $display_max_weight, $unit);
    297310        }
    298311
  • dhlpwc/trunk/includes/view/order/meta/form/size.php

    r2688414 r2939441  
    11<?php if (!defined('ABSPATH')) { exit; } ?>
    22<input type="radio" class="dhlpwc-label-create-size" name="dhlpwc-label-create-size" value="<?php echo esc_attr($parceltype->key) ?>" /><strong><?php echo esc_html($description) ?></strong>
    3 ( <i><?php echo esc_html($parceltype->min_weight_kg) ?>-<?php echo esc_html($parceltype->max_weight_kg) ?> kg, <?php echo esc_html($parceltype->dimensions->max_length_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_width_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_height_cm) ?> cm</i> )<br/>
     3( <i><?php echo esc_html($parceltype->display_weight) ?> <?php echo esc_html($parceltype->dimensions->max_length_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_width_cm) ?>x<?php echo esc_html($parceltype->dimensions->max_height_cm) ?> cm</i> )<br/>
  • dhlpwc/trunk/readme.txt

    r2916269 r2939441  
    55Requires PHP:         5.6
    66Tested up to:         6.2
    7 Stable tag:           2.0.13
     7Stable tag:           2.0.14
    88WC requires at least: 3.0.0
    99WC tested up to:      7.3.0
     
    5353
    5454== Changelog ==
     55 
     56= 2.0.14 =
     57- Updated package weight to display more accurate values
     58- Updated ServicePoint deliveries to default to SMALL package size
    5559 
    5660= 2.0.13 =
Note: See TracChangeset for help on using the changeset viewer.