Our client wants a single screen where they can import tracking numbers for all shipping companies.
We already have the logic to parse the file and load the list of tracking numbers on the orders.
However, the tracking numbers do not show clickable in the admin section or emails because the ShipGateway is never set, so it cannot get the tracking number link from the ShipGateway.
How can I manually assign a ShipGateway to a tracking number?
I'd like to auto determine the shipping company by tracking number, but if not I can just make the user choose the shipping company from a drop down when loading their custom tracking number file.
Thanks in advance
Manually attach ShipGateway to a tracking number.
-
- Lieutenant Commander (LCDR)
- Posts: 95
- Joined: Sun Oct 04, 2015 5:45 pm
Re: Manually attach ShipGateway to a tracking number.
When saving tracking number if you are associating them with their shipments then you can easily get shipping gateway from shipment's ship method.
Code: Select all
var shipGateway = shipment.ShipMethod.ShipGateway
trackingNumber.ShipGateway = shipGateway;
-
- Lieutenant Commander (LCDR)
- Posts: 95
- Joined: Sun Oct 04, 2015 5:45 pm
Re: Manually attach ShipGateway to a tracking number.
Thank you.
But what if the ShipMethod.ShipGateway is null?
Is there a way to instantiate a specific ShipGateway?
But what if the ShipMethod.ShipGateway is null?
Is there a way to instantiate a specific ShipGateway?