Integrate ShipRush with TY Package Tracker
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.
Re: Integrate ShipRush with TY Package Tracker
hi
you seem knowledgeable about ty can you help?
I have version 1.5 zen cart and just installed ty package tracker.
Installed fine but when turned on in Admin->Tools->Layout Boxes, my website accent, other side boxes and features disappeared, so I turned the two files off. Is it possible to have the ty tracker on its own webpage and not as a side box on store front?
Ty tracker table shows in the sql data base under 'configuration group', but “Settings for Ty Package Tracker features” doesn’t show under admin/ configuration tab. Please let me know where can I configure the Ty Package Tracker features & layout when turned on?
Also how to install it on its own EZ page.
thanks
Meepy
Re: Integrate ShipRush with TY Package Tracker
your mod worked for fedex shiprush. now they have shiprush desktop, is there a way to make it work with that?