Changeset 2702735
- Timestamp:
- 03/31/2022 02:04:46 PM (4 years ago)
- Location:
- dhlpwc
- Files:
-
- 16 edited
- 1 copied
-
tags/2.0.4 (copied) (copied from dhlpwc/trunk)
-
tags/2.0.4/README.md (modified) (1 diff)
-
tags/2.0.4/dhlpwoocommerce.php (modified) (1 diff)
-
tags/2.0.4/includes/controller/class-dhlpwc-controller-mail.php (modified) (2 diffs)
-
tags/2.0.4/includes/model/service/class-dhlpwc-model-service-label-metabox.php (modified) (1 diff)
-
tags/2.0.4/includes/model/service/class-dhlpwc-model-service-order-meta.php (modified) (1 diff)
-
tags/2.0.4/includes/model/service/class-dhlpwc-model-service-shipment.php (modified) (4 diffs)
-
tags/2.0.4/includes/model/service/class-dhlpwc-model-service-track-trace.php (modified) (2 diffs)
-
tags/2.0.4/readme.txt (modified) (2 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/dhlpwoocommerce.php (modified) (1 diff)
-
trunk/includes/controller/class-dhlpwc-controller-mail.php (modified) (2 diffs)
-
trunk/includes/model/service/class-dhlpwc-model-service-label-metabox.php (modified) (1 diff)
-
trunk/includes/model/service/class-dhlpwc-model-service-order-meta.php (modified) (1 diff)
-
trunk/includes/model/service/class-dhlpwc-model-service-shipment.php (modified) (4 diffs)
-
trunk/includes/model/service/class-dhlpwc-model-service-track-trace.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dhlpwc/tags/2.0.4/README.md
r2698318 r2702735 1 1 # DHL Parcel for WooCommerce 2 3 v2.0.4 4 ## Changes 5 - Updated tracking url for Belgium 6 - Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions 7 - Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action 2 8 3 9 v2.0.3 -
dhlpwc/tags/2.0.4/dhlpwoocommerce.php
r2698318 r2702735 5 5 * Description: This is the official DHL Parcel for WooCommerce plugin. 6 6 * Author: DHL Parcel 7 * Version: 2.0. 37 * Version: 2.0.4 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 5.9 -
dhlpwc/tags/2.0.4/includes/controller/class-dhlpwc-controller-mail.php
r2688414 r2702735 76 76 $postcode = $service->get_postcode_from_order($order->get_id()); 77 77 78 $service = DHLPWC_Model_Service_Order_Meta::instance(); 79 $country_code = $service->get_country_code($order->get_id()); 80 78 81 $service = DHLPWC_Model_Service_Track_Trace::instance(); 79 82 $tracking_codes = $service->get_track_trace_from_order($order->get_id()); … … 83 86 foreach($tracking_codes as $tracking_code) { 84 87 $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); 86 89 $tracking_codeset['code'] = $tracking_code; 87 90 $tracking_codesets[] = $tracking_codeset; -
dhlpwc/tags/2.0.4/includes/model/service/class-dhlpwc-model-service-label-metabox.php
r2688414 r2702735 294 294 $postcode = $service->get_postcode_from_order($post_id); 295 295 296 $service = DHLPWC_Model_Service_Order_Meta::instance(); 297 $country_code = $service->get_country_code($post_id); 298 296 299 $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); 298 301 299 302 $service = DHLPWC_Model_Service_Access_Control::instance(); -
dhlpwc/tags/2.0.4/includes/model/service/class-dhlpwc-model-service-order-meta.php
r2688414 r2702735 46 46 } 47 47 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 } 48 54 } 49 55 -
dhlpwc/tags/2.0.4/includes/model/service/class-dhlpwc-model-service-shipment.php
r2688414 r2702735 211 211 212 212 foreach ($order_ids as $order_id) { 213 $selected_size = $bulk_size; 213 214 214 215 // Generate to business option … … 227 228 if ($option_service->send_with_bp($order_id)) { 228 229 // 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 } 230 240 } 231 241 … … 233 243 if (!in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_PS, $preset_options)) { 234 244 // BP preference 235 if ($ bulk_size === 'bp_only') {245 if ($selected_size === 'bp_only') { 236 246 if ( in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_DOOR, $preset_options)) { 237 247 // Remove DOOR … … 314 324 } else { 315 325 $label_size = null; 316 switch($ bulk_size) {326 switch($selected_size) { 317 327 case 'bp_only': 318 328 case 'smallest': -
dhlpwc/tags/2.0.4/includes/model/service/class-dhlpwc-model-service-track-trace.php
r2688414 r2702735 12 12 const QUERY_LANDCODE = 'lc'; 13 13 14 protected $url_be = 'https://www.dhlparcel.be/nl/particulieren/volg-je-zending'; 14 15 protected $url = 'https://www.dhlparcel.nl/nl/volg-uw-zending-0'; 15 16 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) 17 18 { 18 19 $query_args = array(); … … 29 30 } 30 31 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); 32 38 } 33 39 -
dhlpwc/tags/2.0.4/readme.txt
r2698318 r2702735 5 5 Requires PHP: 5.6 6 6 Tested up to: 5.9 7 Stable tag: 2.0. 37 Stable tag: 2.0.4 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 5.3.0 … … 53 53 54 54 == Changelog == 55 56 = 2.0.4 = 57 - Updated tracking url for Belgium 58 - Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions 59 - Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action 55 60 56 61 = 2.0.3 = -
dhlpwc/trunk/README.md
r2698318 r2702735 1 1 # DHL Parcel for WooCommerce 2 3 v2.0.4 4 ## Changes 5 - Updated tracking url for Belgium 6 - Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions 7 - Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action 2 8 3 9 v2.0.3 -
dhlpwc/trunk/dhlpwoocommerce.php
r2698318 r2702735 5 5 * Description: This is the official DHL Parcel for WooCommerce plugin. 6 6 * Author: DHL Parcel 7 * Version: 2.0. 37 * Version: 2.0.4 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 5.9 -
dhlpwc/trunk/includes/controller/class-dhlpwc-controller-mail.php
r2688414 r2702735 76 76 $postcode = $service->get_postcode_from_order($order->get_id()); 77 77 78 $service = DHLPWC_Model_Service_Order_Meta::instance(); 79 $country_code = $service->get_country_code($order->get_id()); 80 78 81 $service = DHLPWC_Model_Service_Track_Trace::instance(); 79 82 $tracking_codes = $service->get_track_trace_from_order($order->get_id()); … … 83 86 foreach($tracking_codes as $tracking_code) { 84 87 $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); 86 89 $tracking_codeset['code'] = $tracking_code; 87 90 $tracking_codesets[] = $tracking_codeset; -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-label-metabox.php
r2688414 r2702735 294 294 $postcode = $service->get_postcode_from_order($post_id); 295 295 296 $service = DHLPWC_Model_Service_Order_Meta::instance(); 297 $country_code = $service->get_country_code($post_id); 298 296 299 $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); 298 301 299 302 $service = DHLPWC_Model_Service_Access_Control::instance(); -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-order-meta.php
r2688414 r2702735 46 46 } 47 47 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 } 48 54 } 49 55 -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-shipment.php
r2688414 r2702735 211 211 212 212 foreach ($order_ids as $order_id) { 213 $selected_size = $bulk_size; 213 214 214 215 // Generate to business option … … 227 228 if ($option_service->send_with_bp($order_id)) { 228 229 // 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 } 230 240 } 231 241 … … 233 243 if (!in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_PS, $preset_options)) { 234 244 // BP preference 235 if ($ bulk_size === 'bp_only') {245 if ($selected_size === 'bp_only') { 236 246 if ( in_array(DHLPWC_Model_Meta_Order_Option_Preference::OPTION_DOOR, $preset_options)) { 237 247 // Remove DOOR … … 314 324 } else { 315 325 $label_size = null; 316 switch($ bulk_size) {326 switch($selected_size) { 317 327 case 'bp_only': 318 328 case 'smallest': -
dhlpwc/trunk/includes/model/service/class-dhlpwc-model-service-track-trace.php
r2688414 r2702735 12 12 const QUERY_LANDCODE = 'lc'; 13 13 14 protected $url_be = 'https://www.dhlparcel.be/nl/particulieren/volg-je-zending'; 14 15 protected $url = 'https://www.dhlparcel.nl/nl/volg-uw-zending-0'; 15 16 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) 17 18 { 18 19 $query_args = array(); … … 29 30 } 30 31 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); 32 38 } 33 39 -
dhlpwc/trunk/readme.txt
r2698318 r2702735 5 5 Requires PHP: 5.6 6 6 Tested up to: 5.9 7 Stable tag: 2.0. 37 Stable tag: 2.0.4 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 5.3.0 … … 53 53 54 54 == Changelog == 55 56 = 2.0.4 = 57 - Updated tracking url for Belgium 58 - Updated product-based automatic mailbox selection to work with areas where mailbox delivery is not available when used with bulk actions 59 - Fixed an issue where product-based automatic mailbox selection is being applied to sequential orders when used in a bulk action 55 60 56 61 = 2.0.3 =
Note: See TracChangeset
for help on using the changeset viewer.