Skip to content

Commit d929411

Browse files
committed
v1.0.49
1 parent cea5fb4 commit d929411

21 files changed

Lines changed: 36 additions & 32 deletions

Controller/Adminhtml/Authentication/TestAuthentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Controller\Adminhtml\Authentication;

Controller/Adminhtml/Shipment/Download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;

Controller/Adminhtml/Shipment/Labelrequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;

Controller/Adminhtml/Shipment/PrintAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;

Controller/Adminhtml/Shipment/UndoShipped.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;

Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Helper;

Observer/AutoShipment.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,31 @@ public function __construct(
5353

5454
public function execute(\Magento\Framework\Event\Observer $observer)
5555
{
56-
if (!$this->helper->getConfigData('active')) {
56+
/** @var Order $observerOrder */
57+
$observerOrder = $observer->getEvent()->getOrder();
58+
if (!$observerOrder || !$observerOrder->getId()) {
5759
return;
5860
}
5961

60-
// Don't do anything when auto shipment is disabled.
61-
if (!boolval($this->helper->getConfigData('usability/automation/shipment'))
62-
|| strval($this->helper->getConfigData('usability/automation/on_order_status')) === '') {
62+
$storeId = $observerOrder->getStoreId();
63+
64+
if (!$this->helper->getConfigData('active', $storeId)) {
6365
return;
6466
}
6567

66-
// Only continue if the event trigger name matches
67-
if ($this->helper->getConfigData('usability/automation/event_trigger') !== $observer->getEvent()->getName()) {
68+
// Don't do anything when auto shipment is disabled.
69+
if (!boolval($this->helper->getConfigData('usability/automation/shipment', $storeId))
70+
|| strval($this->helper->getConfigData('usability/automation/on_order_status', $storeId)) === '') {
6871
return;
6972
}
7073

71-
$observerOrder = $observer->getEvent()->getOrder();
72-
if (!$observerOrder || !$observerOrder->getId()) {
74+
// Only continue if the event trigger name matches
75+
if ($this->helper->getConfigData('usability/automation/event_trigger', $storeId) !== $observer->getEvent()->getName()) {
7376
return;
7477
}
7578

76-
if ($observerOrder->getStatus() !== $this->helper->getConfigData('usability/automation/on_order_status')) {
79+
80+
if ($observerOrder->getStatus() !== $this->helper->getConfigData('usability/automation/on_order_status', $storeId)) {
7781
return;
7882
}
7983
if (!$observerOrder->canShip() || $observerOrder->hasShipments() || $observerOrder->getShipmentsCollection()->count() > 0) {
@@ -90,7 +94,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
9094
return;
9195
}
9296

93-
if (intval($this->helper->getConfigData('usability/automation/shipment')) === YesNoDHL::OPTION_DHL && !$this->presetService->exists($order)) {
97+
if (intval($this->helper->getConfigData('usability/automation/shipment', $storeId)) === YesNoDHL::OPTION_DHL && !$this->presetService->exists($order)) {
9498
return;
9599
}
96100

@@ -104,7 +108,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
104108

105109
$shipment = $this->orderService->createShipment($order->getId());
106110

107-
if (boolval($this->helper->getConfigData('usability/automation/print'))) {
111+
if (boolval($this->helper->getConfigData('usability/automation/print', $storeId))) {
108112
// Reload shipment (not the shipment data in memory but from database with the newly created tracks) and send to printer
109113
$shipment = $this->shipmentService->getShipmentById($shipment->getId());
110114
$labelIds = $this->labelService->getShipmentLabelIds($shipment);

Setup/InstallSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @package DHLParcel\Shipping
1414
* @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
* @copyright 2017 DHLParcel
16-
* @link https://www.dhlparcel.nl/
16+
* @link https://www.dhlecommerce.nl/
1717
*/
1818

1919
namespace DHLParcel\Shipping\Setup;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "dhlparcel/magento2-plugin",
33
"description": "DHL Parcel plugin for Magento 2",
44
"type": "magento2-module",
5-
"version": "1.0.47",
5+
"version": "1.0.49",
66
"license": [
77
"OSL-3.0"
88
],

etc/adminhtml/routes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
~ @package DHLParcel\Shipping
1414
~ @author Ron Oerlemans <ron.oerlemans@dhl.com>
1515
~ @copyright 2017 DHLParcel
16-
~ @link https://www.dhlparcel.nl/
16+
~ @link https://www.dhlecommerce.nl/
1717
-->
1818

1919
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

0 commit comments

Comments
 (0)