DHL Shipping Automation For ZenCart

by damonp on May 19, 2006

in Data Architecture,Ecommerce,PHP

DHL EasyShip allows you to easily automate shipping processes. EasyShip allows a user to weigh a package, supply destination information and print a pre-paid package slip. The EasyShip tools communicate with DHL’s servers over the Internet to rate and purchase the service and can notify them a local pickup is ready. The system can also communicate with a third party database via ODBC to pull the destination address and can writeback simple fields such as a tracking number.

In order to integrate EasyShip into a ZenCart store, I created a table with the following schema:

CREATE TABLE orders_shipping (
  orders_id int(11) NOT NULL DEFAULT '0',
  ship_package_t_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  ship_package_tracking varchar(50) NOT NULL DEFAULT '',
  ship_track_status varchar(10) NOT NULL DEFAULT 'NEW',
  PRIMARY KEY  (orders_id)
)

In EasyShip we created a writeback operation and mapped the package tracking number to the ship_package_tracking field. For every package shipped through this system now, EasyShip INSERTs a new row containing the ZenCart orders_id and DHL’s tracking number for the shipment.

Using my PHP crontab system, I created an hourly job to query the orders_shipping table for new shipments. The automated job, updates the order status to SHIPPED, inserts a new comment for the order containing the tracking information and link to DHL’s site and generates an email to the customer with the information.

I would recommend a similar system for anyone running a medium to high volume shop. It has proven to be a huge timesaver for the clients I have implemented it for.

Popularity: 2%

Most Popular Posts

Damon Parker is a freelance sysadmin and web developer in Texas. He specializes in server setup, server security and high performance server configurations. Need help setting up a web server or getting a server back online after a crash or hack? Email Damon

{ 2 comments… read them below or add one }

Vinay June 21, 2009 at 9:52 pm

can please give the detailed how to i want to implement DHL easy ship in my cart

thanks

Vinay

Reply

Echina24.com April 6, 2011 at 9:04 pm

Thanks for sharing! Recently, I have updated my shipping module, but I haven’t the latest DHL shipping value! Could you give me one?

Reply

Leave a Comment

Previous post:

Next post: