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
  #11  
Old 03-27-2006, 08:02 PM
  jedak's Avatar 
jedak jedak is offline
 

Senior Member
  
Join Date: Apr 2005
Location: NY
Posts: 149
 

Default

This mod is great it comes in very handy when you consider how many times I've switch carriers
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.
__________________
X-Cart pro v4.0.17
X-Cart pro v4.1.6
X-Cart pro v4.2
Reply With Quote
  #12  
Old 02-20-2007, 07:41 PM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default 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}
__________________
X-Cart version 4.0.19
Reply With Quote
  #13  
Old 04-29-2007, 04:19 PM
  vtonya's Avatar 
vtonya vtonya is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 61
 

Default Re: Ability to select shipping carrier for tracking numbers

What about this mod upgrading to work in 4.1.7 version???

Thank you!
__________________
X-card Gold 4.1.7
Batch Order Mod/Order Processing
Detailed Order Management Mod
Order Audit/Profit reports
Advanced Product Search
Ajax Username Checker
Direct Product Enquiry Form
FAQ Manager
Social Bookmarking
Tabs Mod v3
MagneticOne.com All-IN-ONE X-Cart Export
Show Referrer Information on Order Details Page
www.medsmarket.net
Reply With Quote
  #14  
Old 07-23-2007, 12:21 AM
 
pavant pavant is offline
 

Advanced Member
  
Join Date: Oct 2004
Location: Chicago, Illinois
Posts: 84
 

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

Step 2: In admin/order.php, replace this code:
Quote:

#
# Update order
#
$query_data = array (
"tracking" => $tracking,
"customer_notes" => $customer_notes,
"notes" => $notes
);
With this code:

Quote:

#
# Update order
#
$query_data = array (
"tracking" => $tracking,
"shipping_vendor" => $shipping_vendor,
"customer_notes" => $customer_notes,
"notes" => $notes
);

Step 3: Then you will need to add a template under skin1/main called 'order_shipping_vendor.tpl' containing the following code:
Quote:


{* $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>
<OPTION value="DHL"{if $status eq "DHL"} selected{/if}>DHL</OPTION>
</SELECT>

Step 4: Finally you will need to edit template file skin1/main/history_order.tpl.
Find:

Quote:

{if $usertype eq "A"}
{if $active_modules.Google_Checkout ne '' and $order.extra.goid ne ''}
{include file="main/order_status.tpl" status=$order.status mode="select" name="status" extra="disabled='disabled'"}
<br />
{$lng.txt_gcheckout_order_status_note}
{else}
{include file="main/order_status.tpl" status=$order.status mode="select" name="status"}
{/if}
{else}
<b>{include file="main/order_status.tpl" status=$order.status mode="static"}</b>
{/if}

Replace with:

Quote:

{if $usertype eq "A"}
{if $active_modules.Google_Checkout ne '' and $order.extra.goid ne ''}
{include file="main/order_status.tpl" status=$order.status mode="select" name="status" extra="disabled='disabled'"}
<br />
{$lng.txt_gcheckout_order_status_note}
<br /><br />
Shipping vendor:
{include file="main/order_shipping_vendor.tpl" status=$order.shipping_vendor mode="select" name="shipping_vendor"}
{else}
{include file="main/order_status.tpl" status=$order.status mode="select" name="status"}
<br /><br />
Shipping vendor:
{include file="main/order_shipping_vendor.tpl" status=$order.shipping_vendor mode="select" name="shipping_vendor"}
{/if}
{else}
<b>{include file="main/order_status.tpl" status=$order.status mode="static"}</b>
{/if}


Find:


Quote:
{include file="main/subheader.tpl" title=$lng.lbl_tracking_order}



{assign var="postal_service" value=$order.shipping_vendor|truncate:3:"":true}


Replace with:
Quote:

{include file="main/subheader.tpl" title=$lng.lbl_tracking_order}

{assign var="postal_service" value=$order.shipping_vendor|truncate:3:"":true}




Find:
Quote:

{elseif $postal_service eq "Fed"}


{include file="modules/Order_Tracking/fedex.tpl"}




After the line above add:

Quote:

{elseif $postal_service eq "DHL"}
{include file="modules/Order_Tracking/dhl.tpl"}




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.








__________________
X-Cart Gold v 4.1.10
PHP 5.2.4
MySQL 5.0.45 standard
Apache/2.2.6
OS - Linux
Reply With Quote
  #15  
Old 11-05-2007, 10:18 AM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default 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?
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #16  
Old 11-09-2007, 04:33 PM
  imexhouse's Avatar 
imexhouse imexhouse is offline
 

eXpert
  
Join Date: May 2006
Location: Canada
Posts: 377
 

Default Re: Ability to select shipping carrier for tracking numbers

Does anybody now to implement tracking for Canada Post?
__________________
Jack@AquasanaCA
X-CART GOLD 4.0.19 Live
DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts
AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America!
X-CART GOLD 4.4.5 Live
CDSEO Pro v. 1.8.4
AquasanaMontreal.com
Aquasana╝ & Rhino Water Filtration Systems
Reply With Quote
  #17  
Old 12-20-2007, 08:45 AM
 
samz724 samz724 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 84
 

Exclamation Re: Ability to select shipping carrier for tracking numbers

Quote:
Originally Posted by 2coolbaby
This looks great. Any ideas what effect this has on the tracking link in completed emails?

I second that.. Any idea's!?

Thanks a lot!
__________________
Samz
--------------------------------------
Heavily modified
X-Cart Gold v4.1.10
Reply With Quote
  #18  
Old 09-25-2008, 04:00 AM
 
floyd_2 floyd_2 is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 69
 

Default 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 $ *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} <p />{$lng.eml_dear|substitute:"customer":"`$customer.title` `$customer.firstname` `$customer.lastname`"}, <p />{$lng.eml_order_complete} <br> This is confirmation that the products you ordered have been shipped to you! <br> Shipping usually takes 3-5 days depending on your location. <br> {if $order.tracking} {assign var="postal_carrier" value=$order.tracking|truncate:2:"":true} {if $postal_carrier eq "EC"} {assign var="postal_carrier_name" value="TNT Road Express"} {elseif $postal_carrier eq "13"} {assign var="postal_carrier_name" value="Couriers Please"} {/if} Your {$postal_carrier_name} tracking number is {$order.tracking} <br> Please allow up to 24 hours for the {$postal_carrier_name} tracking system to update this information. {/if} <hr size="1" noshade="noshade" /> <p /> <table cellpadding="2" cellspacing="1" width="100%"> <tr> <td width="20%"><b>{$lng.lbl_order_id}:</b></td> <td width="10">&nbsp;</td> <td width="80%"><tt>#{$order.orderid}</tt></td> </tr> <tr> <td><b>{$lng.lbl_order_date}:</b></td> <td width="10">&nbsp;</td> <td><tt>{$order.date|date_format:$config.Appearance.datetime_format}</tt></td> </tr> {if $order.tracking} <tr> <td><b>{$lng.lbl_tracking_number}:</b></td> <td width="10">&nbsp;</td> <td><tt>{$order.tracking}</tt></td> <tr> <td><b>Track your order:</b></td> <td width="10">&nbsp;</td> {assign var="postal_service" value=$order.tracking|truncate:2:"":true} <td><tt> {if $postal_service eq "EC"} {include file="modules/Order_Tracking/tnt.tpl"} {elseif $postal_service eq "13"} {include file="modules/Order_Tracking/couriers_please.tpl"} {else $order.tracking} {/if} {/if} </tt></td></tr> <tr> <td colspan="3">{include file="mail/html/order_data.tpl"}</td> </tr> </table> {include file="mail/html/signature.tpl"}

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
__________________
X-Cart Gold v4.1.8
Reply With Quote
  #19  
Old 09-25-2008, 06:01 PM
  imexhouse's Avatar 
imexhouse imexhouse is offline
 

eXpert
  
Join Date: May 2006
Location: Canada
Posts: 377
 

Default 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?
__________________
Jack@AquasanaCA
X-CART GOLD 4.0.19 Live
DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts
AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America!
X-CART GOLD 4.4.5 Live
CDSEO Pro v. 1.8.4
AquasanaMontreal.com
Aquasana╝ & Rhino Water Filtration Systems
Reply With Quote
  #20  
Old 09-25-2008, 07:01 PM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default Re: Ability to select shipping carrier for tracking numbers

Quote:
Originally Posted by imexhouse
I'm revisiting the issue after almost a year:

Any ideas how to implement tracking for Canada Post services?

This is one I'd like to see as well. I may take a look at it in the next few days.

Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
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 06:50 PM.

   

 
X-Cart forums © 2001-2020