Here's a cool little code hack for those of you who happen to use ShipRush and TY Package Tracker for your zen-cart.
It simply inserts the Tracking number information that ShipRush automatically inserts in your customer's comments into the Tracking ID field for TY Package Tracker, so that it's no longer necessary to manually update the Tracking ID field after processing a label from ShipRush.
If you have successfully installed ShipRush, then you should have a file in the root of your store folder called "ShippingZZencart.php"
Look for this code:
Code:
if(ZENCART_SHIPPED_STATUS_SET_TO_STATUS_3_DELIVERED==1)
{
$db->execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . $this->MakeSqlSafe($OrderNumber,1) . "', '3', now(), '0', '" . $this->MakeSqlSafe($comments). "')");
//update order status
$db->execute(" update ".DB_PREFIX."orders set orders_status='3' where orders_id='". $this->MakeSqlSafe($OrderNumber,1) ."'");
}
else
{
if($current_order_status==1)
$change_order_status=2;
else if($current_order_status==2)
$change_order_status=3;
else
$change_order_status=$current_order_status;
$db->execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . $this->MakeSqlSafe($OrderNumber,1) . "', '".$change_order_status."', now(), '0', '" . $this->MakeSqlSafe($comments). "')");
if($change_order_status!=$current_order_status)
$db->execute(" update ".DB_PREFIX."orders set orders_status='$change_order_status' where orders_id='". $this->MakeSqlSafe($OrderNumber,1) ."'");
and replace with...
Code:
if(ZENCART_SHIPPED_STATUS_SET_TO_STATUS_3_DELIVERED==1)
{
$db->execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments, track_id1)
values ('" . $this->MakeSqlSafe($OrderNumber,1) . "', '3', now(), '0', '" . $this->MakeSqlSafe($comments) . "', '" . $TrackingNumber . "')");
//update order status
$db->execute(" update ".DB_PREFIX."orders set orders_status='3' where orders_id='". $this->MakeSqlSafe($OrderNumber,1) ."'");
}
else
{
if($current_order_status==1)
$change_order_status=2;
else if($current_order_status==2)
$change_order_status=3;
else
$change_order_status=$current_order_status;
$db->execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments, track_id1)
values ('" . $this->MakeSqlSafe($OrderNumber,1) . "', '".$change_order_status."', now(), '0', '" . $this->MakeSqlSafe($comments) . "', '" . $TrackingNumber . "')");
if($change_order_status!=$current_order_status)
$db->execute(" update ".DB_PREFIX."orders set orders_status='$change_order_status' where orders_id='". $this->MakeSqlSafe($OrderNumber,1) ."'");
WARNING:
Please take care to determine that your track_id1 field settings in your admin area corresponds to the version of ShipRush that you're currently using!
What I mean is that, for specifcally my store, i use Fedex ShipRush and have Fedex configured for Track_ID1 in the Ty Package Tracker configurations (located in admin -> Configuration -> Ty Package Tracker)
You have to make sure that field 1 in your admin settings for Ty Package Tracker corresponds to the shipping service that you use for ShipRush or else, the linking will be to the wrong tracking website for the tracking number.
Bookmarks