-
Notifications
You must be signed in to change notification settings - Fork 17
Shipments
Mollie allows you to keep track of your shipments if you also create orders in Mollie.
If you use Klarna "Pay Later" or "Slice It", then orders are created automatically for you. For all other payment method this is an optional feature.
As soon as you have a valid (authorized, paid, ...) order in Mollie, you can start to "ship" your items. This can be done in various ways.
Depending on your setup, you might want to either do it manually or have a custom script or process that does this for you.
The most convenient way to mark an order as "shipped" is to use the corresponding action in the Shopware backend orders list. If you take a close look, you will see a column for Mollie actions. This column contains a "truck" icon, that helps you to ship your order. As soon as this is executed, your order will transition to "paid" within your Mollie dashboard.
If you want to automatically mark orders as shipped when you change the "order status", you first have to configure what status the Mollie plugin needs to listen to.
Please set the "Status on which order is marked as sent" in the Plugin Configuration. ...also clear your caches...
If you now open the order in the Shopware backend, and set the status of the order to the one from your configuration, the Mollie plugin will automatically mark the order as "shipped" in your Mollie dashboard.
It's also possible to update multiple orders with the Shopware "batch processing" in the backend to mark orders as shipped.
Please adjust your plugin configuration as described above. If you now start a batch update of orders, the same thing will happen as with the single order transition.
Merchants who want to automate their workflows, can also use our provided CLI command to mark orders as shipped. There are 2 commands available for either Klarna orders only, or all orders with transaction number "ord_xyz".
php bin/console mollie:ship:klarna
php bin/console mollie:ship:orders
If they match your configured order status as described above, and their payment status is not OPEN and not CANCELLED, the command will start with the shipping.
Please note, this is only done, if it is not already marked as "shipped".
We've also added an "auto-repair" mechanism. This means, if you have marked your orders as "shipped" in Mollie, the CLI command will recognize it and skip that order.
Also, "final" states like "cancelled" or "expired" will be skipped too.
The Mollie plugin will automatically listen for any status transitions of your order. This can either be, when a CSV import is executed, or when a 3rd party plugin updates your order.
The integration is done using Doctrine Entity "postUpdate" events.
This means, as soon as you or your plugin uses the preferred way of updating an order by using the Entity Manager, the shipping detection will be triggered. Depending on your plugin configuration, orders are then automatically marked as "shipped" when conditions are met.
You can also trigger shipments by using the Shopware API.
Please configure a user in the backend with API access, which will then be used to authenticate.
Shipments can either be started as full shipment or partial shipment.
Use this URL and provide the Shopware order number to start a full shipment of all items in your order.
https://my-shop.domain/api/mollie/ship/order?number=(swOrderNumber)
Use this URL and provide the Shopware order number as well as the article number that you would like to ship. If you add a quantity, only that quantity of the article will be shipped. If you skip the quantity the full position of that article is being shipped.
# Ship the full position of the article
https://my-shop.domain/api/mollie/ship/item?order=(swOrderNumber)&article=(swArticleNumber)
# Ship only 2 items of that article position
https://my-shop.domain/api/mollie/ship/item?order=(swOrderNumber)&article=(swArticleNumber)&quantity=2
The Mollie plugin allows you to send additional tracking information to Mollie.
This includes the postal carrier, a tracking number and an optional tracking URL.
Follow this guide to configure a full tracking of your shipments.
We start by updating our shipping costs in Shopware. Only the name of the entry and the tracking url are important for Mollie.
The name of the shipping method will be used as the "carrier" name in Mollie.
If you also want to provide tracking URLs then simply configure it with Shopware standard.
Here are 2 templates with a carrier URL along with the tracking code of the order. The tracking code is filled with 1 of 2 possible variables that Shopware offers. All other variables lead to either an empty value in the place of the variable, or an empty URL that is not sent to Mollie. Thus, the worst case should be, that the URL is not sent, but a shipping should always work.
# Option 1
https://my-carrier.domain/xyz/?my-code-param={$sOrder.trackingcode}
# Option 2
https://my-carrier.domain/xyz/?my-code-param={$offerPosition.trackingcode}
As soon as you have a tracking code for your order, you need to add it to the default fields of Shopware. This can be done manually, or maybe through an existing plugin that you might have to automate these things.
That's it - we just use the default value of Shopware for the tracking code.
Once the data is existing and prepared, you can simply trigger a "shipment" with one of the options above.
If you then open the order in the Mollie Dashboard and scroll to the "shipments" section, you will recognize that your shipment has the additional data from Shopware.
If you have also configured a tracking URL, then you can even simply click on the tracking code to get to that page.
German Support: [email protected] | International Support: [email protected]