Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Ability to select shipping carrier for tracking numbers

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-14-2004, 07:51 AM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default 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 ADD shipping_vendor char(5) NOT NULL default '' AFTER shippingid;

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', ". "shipping_vendor='".$shipping_vendor."', details='".

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 $ *} <SELECT name="shipping_vendor"> {if $status eq ""}<OPTION value="">Select one</OPTION> {/if} <OPTION value="FedEx"{if $status eq "FedEx"} selected{/if}>FedEx</OPTION> <OPTION value="UPS"{if $status eq "UPS"} selected{/if}>UPS</OPTION> <OPTION value="USPS"{if $status eq "USPS"} selected{/if}>USPS</OPTION> </SELECT>

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:
Shipping vendor: {include file="main/order_shipping_vendor.tpl" status=$order.shipping_vendor mode="select" name="shipping_vendor"}

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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #2  
Old 09-14-2004, 09:09 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Nice mod. I assume this is for 4.0.3.
Reply With Quote
  #3  
Old 09-14-2004, 09:14 AM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default version 4.0.3

Yes, it is for 4.0.3.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #4  
Old 09-28-2004, 07:23 PM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default 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.
__________________
|| E L E V E N ||
Reply With Quote
  #5  
Old 09-29-2004, 05:47 AM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default

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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #6  
Old 09-30-2004, 11:50 PM
 
jimmy_ jimmy_ is offline
 

Advanced Member
  
Join Date: Sep 2004
Posts: 37
 

Default

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


using v4.0.4 X-CART
Reply With Quote
  #7  
Old 10-01-2004, 07:31 AM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default

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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #8  
Old 01-08-2005, 07:46 PM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

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'");
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #9  
Old 04-06-2005, 10:56 AM
 
sportruck sportruck is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 70
 

Default

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!
Reply With Quote
  #10  
Old 04-07-2005, 08:19 AM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

Works Perfectly with 4.0.13.
__________________
Core version:
5.3.2.7

PHP:
5.6.29
MySQL server:
5.5.5-10.0.27-MariaDB-cll-lve  (InnoDB engine support enabled)
Web server:
Apache
Operating system:
Linux
XML parser:
found
GDLib:
found (0)
Translation driver:
Database
Curl version:
7.29.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:18 PM.

   

 
X-Cart forums © 2001-2020