Skip to content

Commit

Permalink
v1.0.49
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinCode committed Jul 19, 2024
1 parent cea5fb4 commit d929411
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Authentication/TestAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Controller\Adminhtml\Authentication;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Shipment/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Shipment/Labelrequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Shipment/PrintAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Shipment/UndoShipped.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Controller\Adminhtml\Shipment;
Expand Down
2 changes: 1 addition & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Helper;
Expand Down
26 changes: 15 additions & 11 deletions Observer/AutoShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,31 @@ public function __construct(

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

// Don't do anything when auto shipment is disabled.
if (!boolval($this->helper->getConfigData('usability/automation/shipment'))
|| strval($this->helper->getConfigData('usability/automation/on_order_status')) === '') {
$storeId = $observerOrder->getStoreId();

if (!$this->helper->getConfigData('active', $storeId)) {
return;
}

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

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

if ($observerOrder->getStatus() !== $this->helper->getConfigData('usability/automation/on_order_status')) {

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

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

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

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

if (boolval($this->helper->getConfigData('usability/automation/print'))) {
if (boolval($this->helper->getConfigData('usability/automation/print', $storeId))) {
// Reload shipment (not the shipment data in memory but from database with the newly created tracks) and send to printer
$shipment = $this->shipmentService->getShipmentById($shipment->getId());
$labelIds = $this->labelService->getShipmentLabelIds($shipment);
Expand Down
2 changes: 1 addition & 1 deletion Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

namespace DHLParcel\Shipping\Setup;
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.47",
"version": "1.0.49",
"license": [
"OSL-3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/routes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
Expand Down
2 changes: 1 addition & 1 deletion etc/events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="sales_model_service_quote_submit_before">
Expand Down
2 changes: 1 addition & 1 deletion etc/frontend/routes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
Expand Down
4 changes: 2 additions & 2 deletions etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->

<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.47">
<module name="DHLParcel_Shipping" setup_version="1.0.49">
<sequence>
<module name="Magento_Shipping"/>
<module name="Magento_Checkout"/>
Expand Down
2 changes: 1 addition & 1 deletion registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

\Magento\Framework\Component\ComponentRegistrar::register(
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/layout/adminhtml_order_shipment_new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ @package DHLParcel\Shipping
~ @author Ron Oerlemans <[email protected]>
~ @copyright 2017 DHLParcel
~ @link https://www.dhlparcel.nl/
~ @link https://www.dhlecommerce.nl/
-->

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column"
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/web/css/legacy.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @package DHLParcel\Shipping
* @author Ron Oerlemans <[email protected]>
* @copyright 2017 DHLParcel
* @link https://www.dhlparcel.nl/
* @link https://www.dhlecommerce.nl/
*/

.dhl-button {
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<css src="DHLParcel_Shipping::css/deliveryoptions.css" />
<css src="DHLParcel_Shipping::css/servicepoint.modal.css" />
<css src="https://static.dhlparcel.nl/fonts/Delivery.css" src_type="url" />
<css src="https://static.dhlecommerce.nl/fonts/Delivery.css" src_type="url" />
</head>
<body>
<referenceContainer name="after.body.start">
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/onestepcheckout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<css src="DHLParcel_Shipping::css/deliveryoptions.css" />
<css src="DHLParcel_Shipping::css/servicepoint.modal.css" />
<css src="https://static.dhlparcel.nl/fonts/Delivery.css" src_type="url" />
<css src="https://static.dhlecommerce.nl/fonts/Delivery.css" src_type="url" />
</head>
<body>
<referenceContainer name="after.body.start">
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 @@ -51,7 +51,7 @@ define([

// Disable getScript from adding a custom timestamp
// $.ajaxSetup({cache: true});
$.getScript("https://static.dhlparcel.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js").done(function() {
$.getScript("https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js").done(function() {
// Load ServicePoint Locator
var configElement = $('#dhl-servicepoint-locator-component');
var limit = $(configElement).attr('data-limit');
Expand Down

0 comments on commit d929411

Please sign in to comment.