dhlparcel / plugin-magento2-release

DHL Parcel plugin for Magento 2
Open Software License 3.0
9 stars 21 forks source link

No way to exclude carriers/shipping methods from automatic shipment creation by module #22

Closed drazulay closed 4 years ago

drazulay commented 4 years ago

On Magento: 2.3.4

Expected: DHLParcel automatically creates shipments, prints labels and fetches tracking for orders placed with DHLParcel shipping methods only.

Actual: DHLParcel also automatically creates shipments for orders placed with non-parcel shipping methods that aren't supported by parcel, such as in our case DHLExpress, which should be handled by another integration.

Description of problem:

Say you are running this module for European shipments and show those rates at checkout, but you also integrate with DHL Express Commerce (DEC) for orders outside of Europe using DHL Express services configured there, and show those rates at checkout also.

If you now also want to use DHLParcel's automatic shipment creation and label/tracking retrieval for DHLParcel orders, and you require order status 'processing' to be used by both parcel and DEC, you have a problem:

When a DHL Express method is chosen at checkout, no matter if no DHLParcel rates were shown, DHLParcel will also happily automatically create a shipment for the DHLExpress order when the order is paid and status changes to processing, setting the order to status complete and thus preventing DEC from importing the order. This happens even when the DHLParcel shipping method is disabled... the observers still trigger.

I might be missing something obvious, but there seems to be no possibility to exclude certain carriers / methods from being processed by the the observers?

Step to recreate:

-Install and configure dhlparcel/magento2-plugin. -Integrate DEC with Magento2 and set to import 'processing' orders. -Install and configure DHL Rates at checkout with the api key generated in DEC. -Set DHLParcel to automatically create shipments and print labels when status becomes 'processing'. -Place an order with a DHLExpress method and create an invoice.

Work around:

A bunch of around plugins on the DHLParcel observers.

roerlemans commented 4 years ago

This issue should be resolved in our newest release v1.0.16: https://github.com/dhlparcel/plugin-magento2-release/releases/tag/v1.0.16