Hey,

I am just started to slowly move old Drupal 7 site to new Drupal 8 commerce 2.x platform... So what I am trying to achieve now is to have 2 shipments per order? I know UI and few features of Commerce Shipping 8.2.x are still coming along but I hope you could at least point me to the right direction...

What I want to achieve is this (for arguments sake lets assume I offer free shipping) :

Lets assume somebody places order A with these products

ItemA - qty 6
ItemB - qty 4
ItemC - qty 3

I have to stock locations WarehouseZ and WarehouseY.... But some "magic logic (some kind of resolver either using Fedex API to check costs or simple based by state + postcode)" I determine that this order should be shipped from WarehouseY... HOWEVER, there is not enough stock there... How should I create 2 shipping to ship products like this:

ItemA - qty 5 - shipped from WarehouseY
ItemA - qty 1 - shipped from WarehouseZ
ItemB - qty 4 - shipped from WarehouseY
ItemC - qty 3 - shipped from WarehouseZ

Could anybody point me to the right direction creating this? My idea is to make a new OrderProcessor which occurs after order is placed and before fulfilment (or any other step on workflow) and then create and add 2 Shipments or Packages (although I am getting confused with that part still)...

Any ideas or suggestions would be sooo appreciated!

P.S. any thoughts of how to handle serial numbers (our warehouse scan serial numbers and send them back to use along side tracking info...) Should this data be then saved into ShipmentItems object?

Cheers!!!!

Comments

puogintas created an issue. See original summary.

Povilas Uogintas’s picture

Issue summary: View changes
bojanz’s picture

Category: Feature request » Support request

You need to write a custom Packer service.
Packers are responsible for generating shipments based on an order.
Look at the default packer for an example: https://github.com/drupalcommerce/commerce_shipping/blob/8.x-2.x/src/Pac...

ShipmentItems don't support custom data at the moment, you can only fields/data to the shipment itself. That might be a problem in your case.

Povilas Uogintas’s picture

Thanks again @bojanz! You are a star!

I am going to look through documentation right now... If my code in any shape of form useful I will get back with my code...

I guess there are reasons why ShipmentItems does not support custom data at the moment but I can see the potential for it...

For instance if there are tracking codes which are unique per item (if items are too large, etc... and packing is controlled by shipment provider) or whether to check if all requested ship items are shipped like qty_ordered / qty_received, etc...

Essentially when receiving Shipment EDI's from various Warehouses / Services / etc... would be good to store data not only Shipment Level but also to Shipment Line level....

For time being I will add this special data to my shipment object...

Again cheers for all the work you done! and for quick reply!

Povilas Uogintas’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

pietermouton’s picture

Hi, I'm working on the same kind of functionality right now (integrated with a custom shipment-company).
So they provide diffrent 'ShippedItems', that contain the orderline number and how many pieces that were sent.

Does someone has more info on this topic? I will look into the packer-stuff right now, but some help is always welcome.