Changeset 2939441
- Timestamp:
- 07/17/2023 01:14:51 PM (3 years ago)
- Location:
- dhlpwc
- Files:
-
- 14 edited
- 1 copied
-
tags/2.0.14 (copied) (copied from dhlpwc/trunk)
-
tags/2.0.14/README.md (modified) (1 diff)
-
tags/2.0.14/assets/js/dhlpwc.metabox.js (modified) (1 diff)
-
tags/2.0.14/dhlpwoocommerce.php (modified) (1 diff)
-
tags/2.0.14/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php (modified) (1 diff)
-
tags/2.0.14/includes/model/service/class-dhlpwc-model-service-label-metabox.php (modified) (2 diffs)
-
tags/2.0.14/includes/view/order/meta/form/size.php (modified) (1 diff)
-
tags/2.0.14/readme.txt (modified) (2 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/assets/js/dhlpwc.metabox.js (modified) (1 diff)
-
trunk/dhlpwoocommerce.php (modified) (1 diff)
-
trunk/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php (modified) (1 diff)
-
trunk/includes/model/service/class-dhlpwc-model-service-label-metabox.php (modified) (2 diffs)
-
trunk/includes/view/order/meta/form/size.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dhlpwc/tags/2.0.14/README.md
r2916269 r2939441 1 1 # DHL Parcel for WooCommerce 2 3 v2.0.14 4 ## Changes 5 - Updated package weight to display more accurate values 6 - Updated ServicePoint deliveries to default to SMALL package size 2 7 3 8 v2.0.13 -
dhlpwc/tags/2.0.14/assets/js/dhlpwc.metabox.js
r2846823 r2939441 303 303 304 304 }).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) 307 317 } 308 318 309 319 }).on('change', '.dhlpwc-metabox-address-input', function(e) { 310 $(document.body).trigger('dhlpwc:metabox_address_sync');320 $(document.body).trigger('dhlpwc:metabox_address_sync'); 311 321 312 322 }).on('dhlpwc:metabox_address_sync', function(e) { -
dhlpwc/tags/2.0.14/dhlpwoocommerce.php
r2916269 r2939441 5 5 * Description: This is the official DHL Parcel for WooCommerce plugin. 6 6 * Author: DHL Parcel 7 * Version: 2.0.1 37 * Version: 2.0.14 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 6.2 -
dhlpwc/tags/2.0.14/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php
r2688414 r2939441 15 15 public $min_weight_kg; 16 16 public $max_weight_kg; 17 public $min_weight_grams; 18 public $max_weight_grams; 17 19 /** @var DHLPWC_Model_API_Data_Parceltype_Dimensions */ 18 20 public $dimensions; -
dhlpwc/tags/2.0.14/includes/model/service/class-dhlpwc-model-service-label-metabox.php
r2836525 r2939441 283 283 foreach ($sizes as $size) { 284 284 $view = new DHLPWC_Template('order.meta.form.size'); 285 $size->display_weight = $this->get_weight_display($size); 285 286 $size_view .= $view->render(array( 286 287 'parceltype' => $size, … … 295 296 296 297 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); 297 310 } 298 311 -
dhlpwc/tags/2.0.14/includes/view/order/meta/form/size.php
r2688414 r2939441 1 1 <?php if (!defined('ABSPATH')) { exit; } ?> 2 2 <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 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.2 7 Stable tag: 2.0.1 37 Stable tag: 2.0.14 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 7.3.0 … … 53 53 54 54 == 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 55 59 56 60 = 2.0.13 = -
dhlpwc/trunk/README.md
r2916269 r2939441 1 1 # DHL Parcel for WooCommerce 2 3 v2.0.14 4 ## Changes 5 - Updated package weight to display more accurate values 6 - Updated ServicePoint deliveries to default to SMALL package size 2 7 3 8 v2.0.13 -
dhlpwc/trunk/assets/js/dhlpwc.metabox.js
r2846823 r2939441 303 303 304 304 }).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) 307 317 } 308 318 309 319 }).on('change', '.dhlpwc-metabox-address-input', function(e) { 310 $(document.body).trigger('dhlpwc:metabox_address_sync');320 $(document.body).trigger('dhlpwc:metabox_address_sync'); 311 321 312 322 }).on('dhlpwc:metabox_address_sync', function(e) { -
dhlpwc/trunk/dhlpwoocommerce.php
r2916269 r2939441 5 5 * Description: This is the official DHL Parcel for WooCommerce plugin. 6 6 * Author: DHL Parcel 7 * Version: 2.0.1 37 * Version: 2.0.14 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 6.2 -
dhlpwc/trunk/includes/model/api/data/class-dhlpwc-model-api-data-parceltype.php
r2688414 r2939441 15 15 public $min_weight_kg; 16 16 public $max_weight_kg; 17 public $min_weight_grams; 18 public $max_weight_grams; 17 19 /** @var DHLPWC_Model_API_Data_Parceltype_Dimensions */ 18 20 public $dimensions; -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-label-metabox.php
r2836525 r2939441 283 283 foreach ($sizes as $size) { 284 284 $view = new DHLPWC_Template('order.meta.form.size'); 285 $size->display_weight = $this->get_weight_display($size); 285 286 $size_view .= $view->render(array( 286 287 'parceltype' => $size, … … 295 296 296 297 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); 297 310 } 298 311 -
dhlpwc/trunk/includes/view/order/meta/form/size.php
r2688414 r2939441 1 1 <?php if (!defined('ABSPATH')) { exit; } ?> 2 2 <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 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.2 7 Stable tag: 2.0.1 37 Stable tag: 2.0.14 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 7.3.0 … … 53 53 54 54 == 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 55 59 56 60 = 2.0.13 =
Note: See TracChangeset
for help on using the changeset viewer.