Programming + Design

FedEx Package Type for International Addresses in X-Cart PDF Print E-mail
Written by Brett Brewer   
Tuesday, 27 May 2008
I just completed a simple mod for X-Cart 4.1.9 that will let you specify a different default FedEx package type for international addresses in X-Cart. Normally, when using the FedEx Direct integration method with X-Cart you can only specify a package type for FedEx Express and FedEx Ground service. I ran into a situation with a client who needed to specify FedEx ExpressPak as the package type only for international addresses, so I whipped up this simple mod which you might find helpful...

OPEN: /admin/shipping_options.php


                'packaging_gnd' => $packaging_gnd,                

                'packaging_int' => $packaging_int, //added by so pak rates could be used only for international rates                

{* start added so we could set package type for international addresses *}
    <td><b>{$lng.lbl_packaging} (FedEx International):</b></td>
    <select name="packaging_int">
        <option value="FEDEXENVELOPE"{if $shipping_options.fdx.packaging_int eq "FEDEXENVELOPE"} selected="selected"{/if}>FedEx Envelope</option>
        <option value="FEDEXPAK"{if $shipping_options.fdx.packaging_int eq "FEDEXPAK"} selected="selected"{/if}>FedEx Pak</option>
        <option value="FEDEXBOX"{if $shipping_options.fdx.packaging_int eq "FEDEXBOX"} selected="selected"{/if}>FedEx Box</option>
        <option value="FEDEXTUBE"{if $shipping_options.fdx.packaging_int eq "FEDEXTUBE"} selected="selected"{/if}>FedEx Tube</option>
        <option value="FEDEX10KGBOX"{if $shipping_options.fdx.packaging_int eq "FEDEX10KGBOX"} selected="selected"{/if}>FedEx 10Kg Box</option>
        <option value="FEDEX25KGBOX"{if $shipping_options.fdx.packaging_int eq "FEDEX25KGBOX"} selected="selected"{/if}>FedEx 25Kg Box</option>
        <option value="YOURPACKAGING"{if $shipping_options.fdx.packaging_int eq "YOURPACKAGING"} selected="selected"{/if}>My packaging</option>
{* end added so we could set package type for international addresses *}

OPEN: /shipping/mod_FEDEX_direct.php
FIND: 'packaging_gnd' => 'FEDEXENVELOPE',
AFTER ADD:  'packaging_int' => 'FEDEXENVELOPE',//added by for international default package type

FIND: $fedex_options['packaging'] = ($_carrier_code == 'FDXE' ? $fedex_options['packaging_exp'] : $fedex_options['packaging_gnd']);
 // added to override the package type for international addresses only.... we override the package type for either express or ground...
            //...default to FEDEXPAK package type
            if($userinfo['s_country'] != 'US'){
                    $fedex_options['packaging'] = $fedex_options['packaging_int']?$fedex_options['packaging_int']:"FEDEXPAK";        

Last Updated ( Wednesday, 24 September 2008 )
< Prev   Next >


Who's Online

© 2017
Joomla! is Free Software released under the GNU/GPL License.