Manually attach ShipGateway to a tracking number.

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
dandersonMLT
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 95
Joined: Sun Oct 04, 2015 5:45 pm

Manually attach ShipGateway to a tracking number.

Post by dandersonMLT » Fri Apr 22, 2016 3:57 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Manually attach ShipGateway to a tracking number.

Post by mazhar » Fri Apr 22, 2016 5:17 am

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;

dandersonMLT
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 95
Joined: Sun Oct 04, 2015 5:45 pm

Re: Manually attach ShipGateway to a tracking number.

Post by dandersonMLT » Fri Apr 22, 2016 11:02 am

Thank you.

But what if the ShipMethod.ShipGateway is null?
Is there a way to instantiate a specific ShipGateway?

Post Reply