Skip to content

Commit

Permalink
Release V1.0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
roerlemans committed Jul 6, 2021
1 parent d2308d1 commit cb25a8b
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 32 deletions.
7 changes: 2 additions & 5 deletions Model/Data/TimeSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ public function getDisplayString()

$betweenTimes = $dateTimeStringStart->format('H:i') . ' - ' . $dateTimeStringEnd->format('H:i');

return implode(' ',
[
return implode(' ', [
$dateTimeStringStart->format('d'),
__($dateTimeStringStart->format('M')) . '.',
$dateTimeStringStart->format('Y'),
$betweenTimes
]
);

]);
}
}
2 changes: 0 additions & 2 deletions Model/Service/Returns.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace DHLParcel\Shipping\Model\Service;


use DHLParcel\Shipping\Model\Piece;
use DHLParcel\Shipping\Model\PieceFactory;
use DHLParcel\Shipping\Model\ResourceModel\Piece as PieceResource;
Expand Down Expand Up @@ -54,5 +53,4 @@ public function cleanupReturnTracks($tracks)

return $tracks;
}

}
12 changes: 4 additions & 8 deletions Observer/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,15 @@ protected function processGrid($order)
$defaultOptions = $this->checkMailboxOverride($defaultOptions);
$defaultOptions = $this->additionalServices($defaultOptions);

$sizes = $this->capabilityService->getSizes($storeId, $toCountry, $toPostalCode, $toBusiness,
array_keys($defaultOptions));
$sizes = $this->capabilityService->getSizes($storeId, $toCountry, $toPostalCode, $toBusiness, array_keys($defaultOptions));

if (empty($sizes) || !is_array($sizes)) {
$skippableOptions = $this->presetService->filterSkippableDefaults($defaultOptions, $storeId);
$requiredOptions = $this->presetService->getDefaultOptions($order, true);
$requiredOptions = $this->checkMailboxOverride($requiredOptions);
$requiredOptions = $this->additionalServices($requiredOptions);

$options = $this->capabilityService->getOptions($storeId, $toCountry, $toPostalCode, $toBusiness,
array_keys($requiredOptions));
$options = $this->capabilityService->getOptions($storeId, $toCountry, $toPostalCode, $toBusiness, array_keys($requiredOptions));

$allowedOptions = [];
foreach ($skippableOptions as $skippableOption) {
Expand All @@ -126,14 +124,12 @@ protected function processGrid($order)
}

$defaultOptions = array_merge($requiredOptions, $allowedOptions);
$sizes = $this->capabilityService->getSizes($storeId, $toCountry, $toPostalCode, $toBusiness,
array_keys($defaultOptions));
$sizes = $this->capabilityService->getSizes($storeId, $toCountry, $toPostalCode, $toBusiness, array_keys($defaultOptions));

if (empty($sizes) || !is_array($sizes)) {
$translations = $this->presetService->getTranslations();
$translatedOptions = array_intersect_key($translations, $defaultOptions);
throw new FaultyServiceOptionException(__('No DHL services could be found for this order with the selected service options: %1',
implode(', ', $translatedOptions)));
throw new FaultyServiceOptionException(__('No DHL services could be found for this order with the selected service options: %1', implode(', ', $translatedOptions)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dhlparcel/magento2-plugin",
"description": "DHL Parcel plugin for Magento 2",
"type": "magento2-module",
"version": "1.0.22",
"version": "1.0.23",
"license": [
"OSL-3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="DHLParcel_Shipping" setup_version="1.0.22">
<module name="DHLParcel_Shipping" setup_version="1.0.23">
<sequence>
<module name="Magento_Shipping"/>
<module name="Magento_Checkout"/>
Expand Down
5 changes: 0 additions & 5 deletions package.json

This file was deleted.

8 changes: 4 additions & 4 deletions view/frontend/web/js/view/deliveryoptions-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ define([
this.showDeliveryTimes = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return false;
}

Expand Down Expand Up @@ -175,7 +175,7 @@ define([
this.showDayTimes = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return false;
}

Expand All @@ -198,7 +198,7 @@ define([
this.showNightTimes = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return false;
}

Expand Down Expand Up @@ -253,7 +253,7 @@ define([
this.showDeliveryServices = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
errorDeliveryValidationMessage: ko.observable(false),
validateShippingInformation: function () {
var method = quote.shippingMethod();
if (method !== null) {
if (typeof method !== 'undefined' && method !== null && typeof method.carrier_code !== 'undefined' && typeof method.method_code !== 'undefined') {
if (method.carrier_code === 'dhlparcel') {
if (method.method_code === 'door') {
if (window.dhlparcel_shipping_deliveryservices_enabled === true) {
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/js/view/deliverytimes-validate-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
errorDeliveryValidationMessage: ko.observable(false),
validateShippingInformation: function () {
var method = quote.shippingMethod();
if (method !== null) {
if (typeof method !== 'undefined' && method !== null && typeof method.carrier_code !== 'undefined' && typeof method.method_code !== 'undefined') {
if (method.carrier_code === 'dhlparcel') {
if (
method.method_code === 'door' ||
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/web/js/view/servicepoint-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define([
this.DHLParcel_Shipping_SelectedMethod = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return null;
}

Expand All @@ -28,7 +28,7 @@ define([
this.DHLParcel_Shipping_ServicePointName = ko.computed(function() {

var method = quote.shippingMethod();
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.method_title === 'undefined') {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/js/view/servicepoint-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ define([

// Save shipping method to global
quote.shippingMethod.subscribe(function(method) {
if (method === null) {
if (typeof method === 'undefined' || method === null || typeof method.carrier_code === 'undefined' || typeof method.method_code === 'undefined') {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/js/view/servicepoint-validate-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
errorDeliveryValidationMessage: ko.observable(false),
validateShippingInformation: function () {
var method = quote.shippingMethod();
if (method !== null) {
if (typeof method !== 'undefined' && method !== null && typeof method.carrier_code !== 'undefined' && typeof method.method_code !== 'undefined') {
if (method.carrier_code === 'dhlparcel' && method.method_code === 'servicepoint') {
if (window.dhlparcel_shipping_servicepoint_validate !== true) {
$('#dhlparcel-shipping-servicepoint-info-error').show();
Expand Down

0 comments on commit cb25a8b

Please sign in to comment.