![]() |
Ability to select shipping carrier for tracking numbers
X-cart chooses the shipping carrier based and the shipping selection that the customer used when checking out. However, to change the carrier and have the tracking function still work. Here is a mod that will allow you to select which shipping carrier you used: UPS, Fedex, USPS and will associate xcarts tracking functions to the option you selected.
First we need to create a new column in the database xcart_orders. The easiest way to do this is to go to 'Patch/Upgrade' under 'Administration' in your xcart admin. Copy the following in your SQL query(ies): box and click on apply. Code:
ALTER TABLE xcart_orders Then you need to replace the following code in your admin/order.php Code:
db_query("update $sql_tbl[orders] set tracking='$tracking', notes='$notes', details='". With this code: Code:
db_query("update $sql_tbl[orders] set tracking='$tracking', notes='$notes', ". Then you will need to add a template under 'main' called 'order_shipping_vendor.tpl' containing the following code: Code:
{* $Id: order_shipping_vendor.tpl,v 1.4 2004/05/28 12:21:03 max Exp $ *} Finally you will need to edit template file 'main/history_order.tpl'. Replace the following: Code:
{assign var="postal_service" value=$order.shipping|truncate:3:"":true} With this Code:
{assign var="postal_service" value=$order.shipping_vendor|truncate:3:"":true} And add the following: Code:
After this line in the main/history_order.tpl Code:
{include file="main/order_status.tpl" status=$order.status mode="select" name="status"} After applying this mod when you log in to view your order to enter tracking numbers right above your tracking number box you can select which shipping carrier was used. After applying your changes you will see a 'track it' button at the bottom of the page that allows you to track the shipment. |
Nice mod. I assume this is for 4.0.3.
|
version 4.0.3
Yes, it is for 4.0.3.
|
3.4.11 ?
Do you guys know offhand if this mod will work with 3.4.11? It looks like it's almost a stand-alone mod.
|
It was designed for 4.x but you could try on 3.4.11. You should try and post back to the forum your results. I personally have not tried it on 3.4.11.
|
Thank you for this mod, everything seems to be working except the Track It button does not show up.
I was wondering where exactly this track IT button shows up (I assumed it would be on the page around where I chose shipping company, and entered tracking... but I do not see it;( Any assistance would be greatly appreciated. Thanks :D using v4.0.4 X-CART |
The 'track it' button is on the bottom of the 'Order details' page (the same page that you select your shipping carrier and enter your tracking number) You need to select a carrier and enter a tracking number and click apply changes near the bottom of the page. Then go back to the same order again and you will see the 'track it' button at the bottom of the page. Please let me know if you need further assistance.
|
I'm using 4.0.9. In your second step, the code doesn't match up and I'm not sure how to change it. Could anyone take a stab? This is my code:
Code:
db_query("update $sql_tbl[orders] set tracking='$tracking', notes='$notes' $details where orderid='$orderid'"); |
If your code doesn't match the SQL query listed above, here is what to do.
In admin/order.php, change this line: Code:
db_query("update $sql_tbl[orders] set tracking='$tracking', notes='$notes' $details where orderid='$orderid'"); To this: Code:
db_query("update $sql_tbl[orders] set tracking='$tracking', shipping_vendor='$shipping_vendor', notes='$notes' $details where orderid='$orderid'"); Works great! |
Works Perfectly with 4.0.13.
|
This mod is great it comes in very handy when you consider how many times I've switch carriers :oops:
Which brings me to my question how could I get this mod to default to the customer's selected carrier instead of having to select it. I use he real time shipping feature and say for e.g. a customer selects UPS 2nd Day Air the shipping vendor would then be UPS if they had selected USPS Priority Mail hen it would be USPS. Any ideas. Thanks in advance. |
Re: Ability to select shipping carrier for tracking numbers
this should take care of the same thing without adding anything to sql table
{assign var="postal_service" value=$order.shipping|truncate:3:"":true} {if $active_modules.Order_Tracking ne ""} UPS {include file="modules/Order_Tracking/ups.tpl"} USPS {include file="modules/Order_Tracking/usps.tpl"} FEDEX {include file="modules/Order_Tracking/fedex.tpl"} {/if} {/if} |
Re: Ability to select shipping carrier for tracking numbers
What about this mod upgrading to work in 4.1.7 version???
Thank you! |
Re: Ability to select shipping carrier for tracking numbers
I really like this mod and I changed it to work with my 4.1.8 xcart. Here is what I have:
First we need to create a new column in the database xcart_orders. The easiest way to do this is to go to 'Patch/Upgrade' under 'Administration' in your xcart admin. Copy the following in your SQL query(ies): box and click on apply. Quote:
Step 2: In admin/order.php, replace this code:
Quote:
Quote:
Step 3: Then you will need to add a template under skin1/main called 'order_shipping_vendor.tpl' containing the following code: Quote:
Step 4: Finally you will need to edit template file skin1/main/history_order.tpl. Find: Quote:
Replace with: Quote:
Find: Quote:
Replace with:
Quote:
Find:
Quote:
After the line above add:
Quote:
Many thanks to the original author of this mod. It's just what the doctor ordered for my site. I make no promises that this code will work with your site; each environment is different and your code may function differently especially if it has already been moded. I can't provide any support for this mod. Install only if you have the resources to fix any problems that may occur.
|
Re: Ability to select shipping carrier for tracking numbers
This looks great. Any ideas what effect this has on the tracking link in completed emails?
|
Re: Ability to select shipping carrier for tracking numbers
Does anybody now to implement tracking for Canada Post?
|
Re: Ability to select shipping carrier for tracking numbers
Quote:
I second that.. Any idea's!? Thanks a lot! :mrgreen: |
Re: Ability to select shipping carrier for tracking numbers
I wasn't keen to add any more tables to my database or make too many mods to my X-cart installation for fear of difficulat upgrades in the future. I was keen to get a Track It button embedded in my Order Completion email, and implemented a slight modification of MoonDog's method.
In MoonDog's method, it looks to rely on extra database fields that relate each order to the shipping method used. As I use two different trackable shipping companies, I was keen to have the Order Completion email offer just one Track It! button that was already coded to go to the correct carrier's tracking web page. Additionally, I wanted the text in the Order Completion email to still refer to the specific carrier that the customer selected (per MoonDog's original method). Each of my carriers uses a different prefix for their consignment numbers, so I just stripped out the first two characters of the consignment number to differentiate between the two companies. Any order with a con number starting with "EC" belongs to TNT, and any starting with "13" belongs to Couriers Please. Here's my version of MoonDog's Order Completion email that requires no DB mods etc: Code:
{* $Id: order_customer_complete.tpl,v 1.10 2006/03/31 05:51:43 svowl Exp $ *} Please overlook the slight duplication of code. It works well thanks to MoonDog's hard work and my slight mods. If you're worried about having to do too many changes to your X-Cart installation to associate your trackable carrier to your orders, this is a way around it (so long as your carriers use different Con note numbering systems). Dean |
Re: Ability to select shipping carrier for tracking numbers
I'm revisiting the issue after almost a year:
Any ideas how to implement tracking for Canada Post services? |
Re: Ability to select shipping carrier for tracking numbers
Quote:
This is one I'd like to see as well. I may take a look at it in the next few days. Jason |
Re: Ability to select shipping carrier for tracking numbers
If you're after the ability to get the TRACK IT! button working for Canada Post, would you mind posting a valid tracking number that I can use?
TIA Dean |
Re: Ability to select shipping carrier for tracking numbers
Ok, I've worked the Canada Post "Track It" template code out. I grabbed a consignment ID from a friend in Canada to test with.
In your canada_post.tpl in modules/Order_Tracking you need the code to be as follows: Code:
{* $Id: canada_post.tpl,v 1.0 2008/09/26 14:07:32 twice Exp $ *} Hope that helps guys. For the life of me, I can't remember what ties the tracking template to the shipping method though. It was a while ago when I set up my shipping methods and my goldfish-memory is true to form. Does anyone know what template / php / screen ties shipping methods to tracking templates? Dean |
Re: Ability to select shipping carrier for tracking numbers
In skin1/main/history_order.tpl find:
Code:
and change it to: Code:
Thanks to floyd_2 for the tracking code! One more thing, in skin1/modules/Order_Tracking/canada_post.tpl, change Code:
{$lng.txt_apost_redirection} Code:
{$lng.txt_cpc_redirection} |
Re: Ability to select shipping carrier for tracking numbers
Thanks imexhouse - the memories came flooding back when I read your post. I will now be able to sleep peacefully tonight without continuing to wonder where that template was :)
Dean |
Re: Ability to select shipping carrier for tracking numbers
You're welcome :)
|
Re: Ability to select shipping carrier for tracking numbers
Here's an even better way to interface with TNT Australia for your tracking needs:
HTML Code:
Nice and neat, and it returns ONLY the tracking information, without any other TNT web page clutter. Dean |
Re: Ability to select shipping carrier for tracking numbers
There's no stopping you now!
:) |
Re: Ability to select shipping carrier for tracking numbers
Ok...this is my last word on the topic for the evening lol.
Here is a much tidier way of handling Couriers Please in Australia: HTML Code:
If you prefer a plain HTML result page without the Couriers Please banner on the top, just remove "printable=true&" and you'll get the plain result page. I figure that the printable version of the page with the Couriers Please logo on top is better for my customers. Don't forget to go to Languages and add txt_cplease_redirection with appropriate text (like "You will be redirected to Couriers Please Delivery service site, by clicking this button."). Also update skin1/main/history_order.tpl using the post above by imexhouse as a guide. Dean |
Re: Ability to select shipping carrier for tracking numbers
Looks like I lied...this is really my last post for the evening. I have tidied up the CanadaPost code now - much better this way:
HTML Code:
Dean |
Re: Ability to select shipping carrier for tracking numbers
Thanks very much for the code Dean. I look forward to getting this implemented into my shop. Now I just need a few spare minutes...
Jason |
Re: Ability to select shipping carrier for tracking numbers
Perfect! Without all the unnecessary clutter.
Thanks, floyd_2! |
Re: Ability to select shipping carrier for tracking numbers
I know it's been months since the last post, but does anybody know how to modify the code to make it work with mulitple tracking numbers?
|
Re: Ability to select shipping carrier for tracking numbers
Hi imexhouse,
this is potentially a very simple one. With TNT in Australia for example, you just need to separate your tracking numbers with a comma. For example: ECN002206500,ECN002206501 When that string is passed in the $order.tracking variable, TNT parses each tracking number in turn in the tracking results page. With Canada Post, by memory the tracking screen only accepts a single tracking number as input. I don't have any valid tracking numbers any more to test their site though. I know they have a second page for tracking multiple packages too. For starters, it might be worth just substituting a comma separated list of two tracking numbers into $order.tracking and see if CA Post accepts it. Are you still using CA Post? Dean |
Re: Ability to select shipping carrier for tracking numbers
Ok, you knew I wouldn't let it go at that didn't you...
Assuming you're using CA Post...CA Post uses a slightly different URL for multi consignment tracking. The code you need to use is based on this: Forgetting the two dummy consignment numbers in there, you really just need to change basicPin.do to multiPinPool.do in your existing query string. That's the first bit. Secondly, you need to be able to string your consignment numbers in such a way that a line feed is generated between each one, whilst still keeping the syntax of the URL correct. This is just a little ugly, but it IS cheap :) Delimit your consignment numbers when you type them into the Tracking Number field for an order inside X-Cart with the following string: Quote:
This will generate a line feed in the CA Post multi tracking number input window. Whilst it will look just a little odd to the end user when they see a tracking number like: Quote:
it will actually work. Besides....who really looks at the actual number - its the results that we're after! Give it a try - it worked in my tests here and means absolutely minimal changes to your X-Cart. Dean |
Re: Ability to select shipping carrier for tracking numbers
floyd_2:
Thank you for your input. I knew that the URL for the multiple tracking numbers for Canada Post was different. What I choked on was the separation of the 2, or 3, or more tracking numbers. I'll try %0d%0a. Now, if I wanted to replace the Quote:
in the main/history_order.tpl with <textarea>, and then put the numbers on separate lines, how would we represent the split by line in the <textarea> tag? Would we still use the %0d%0a? If so, than exactly how? I've tried multiple "solutions", mainly javascript that are floating out there, but nothing seems to split the text by line breaks. So, although I have in the text area: 717124500043433 717125465055500 the numbers get concatenated when the input gets to CPC tracking page and we get an error :( To answer your question "Who actually looks at the tracking numbers", my customers do - more and more frequently, they use tracking numbers to locate their shipments, given the poor performance of CPC lately (misdirected and late shipments). In the past week alone, I've had 3 customers complaining about not getting their complete orders, although all their boxes would've been shipped at the same time. This is particularly so with heavy boxes - orders that consists of 2 boxes, one 5 lbs and one 55 lbs. Mysteriously, only the light box would be delievered on time, and the heavy one would get left behind :) Thanks. |
Re: Ability to select shipping carrier for tracking numbers
Canada Post has changed their tracking page, and the old tracking code no longer works.
Here's the new version: Quote:
|
Re: Ability to select shipping carrier for tracking numbers
Hi
I rellay like this mod by inksticks, would anyone know if this will work ok with 4.2 or is there a mod that will? Thanks Stuart |
Re: Ability to select shipping carrier for tracking numbers
Here is an updated version I did to work with 4.2.x
This version does not add another database table field it uses the existing field and updates the order information accordingly. Open /admin/order.php Find: Code:
require $xcart_dir."/include/history_order.php"; Below add: Code:
# Get Shipping Options for order admin area to update manually (Addon) Find: Code:
$query_data = array ( Replace with: Code:
# Get Updated Shipping Id For Admin Area Create New Template (order_shipping_vendor.tpl) Save to /skin1/main/order_shipping_vendor.tpl Code:
{* $Id: order_shipping_vendor.tpl,v 1.4 2004/05/28 12:21:03 max Exp $ *} Open /skin1/main/order_history.tpl Find: Code:
Add After:
Code:
Now login to your admin area and view an order, under the Order Status you will see a new drop down option called "Shipping Carrier" the default selection is what the customer requested as a carrier. You can change this it will update the order to the new carrier. |
All times are GMT -8. The time now is 03:19 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.