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

Ship From address not the same as Company location address

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-02-2008, 09:27 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Ship From address not the same as Company location address

* Please move if not in the right forum *

This was tested on 4.1.10 Gold only and UPS Real Time USA only. By default X-Cart uses company location address as Ship From address. If these 2 adresses are different for you (in other words your company is in CA and the warehouse you ship from in KS) using the default X-Cart behaviour will result in inaccurate rates. This code makes it possible to have Ship From address different from company location address. Use at your own risk. No warranties of any kind. Make sure you backup first before making any changes. The code works for me. Here it is

Apply the following SQL patch (i did it with phpMyAdmin)
Code:
INSERT INTO `xcart_config` (`name`, `comment`, `value`, `category`, `orderby`, `type`, `defvalue`, `variants`, `validation`) VALUES ('ship_from_address', 'Street address', 'STREET GOES HERE', 'Company', 265, 'text', '', '', ''), ('ship_from_city', 'City', 'CITY GOES HERE', 'Company', 270, 'text', '', '', ''), ('ship_from_state', 'State', 'STATE ABBR GOES HERE', 'Company', 275, 'text', 'CA', '', ''), ('ship_from_zipcode', 'Zip/postal code', 'ZIP GOES HERE', 'Company', 280, 'text', '', '', ''), ('ship_from_country', 'Country', 'COUNTRY ABBR GOES HERE', 'Company', 285, 'text', 'US', '', ''), ('nov2', 'Ship from address', '', 'Company', 260, 'separator', '', '', '');
Replace the red with your own details. Also you will be able to change then from inside X-Cart Admin Area - Company details, any time you need to.


Next open /shipping/mod_UPS.php and find
Code:
# # The origin address - from Company options # (suppose that ShipperAddress and ShipFrom is equal) # $src_country_code = $config["Company"]["location_country"]; $src_city = func_ups_xml_quote($config["Company"]["location_city"]); $src_state_code = func_ups_xml_quote($config["Company"]["location_state"]); $src_zipcode = $config["Company"]["location_zipcode"];
after add
Code:
# # The Ship From address - from Company options # (suppose that ShipperAddress and ShipFrom are different) # $src_ship_from_country_code = $config["Company"]["ship_from_country"]; $src_ship_from_city = func_ups_xml_quote($config["Company"]["ship_from_city"]); $src_ship_from_state_code = func_ups_xml_quote($config["Company"]["ship_from_state"]); $src_ship_from_zipcode = $config["Company"]["ship_from_zipcode"];

In the same file find
Code:
<ShipFrom> <Address> <City>$src_city</City> <StateProvinceCode>$src_state_code</StateProvinceCode> <PostalCode>$src_zipcode</PostalCode> <CountryCode>$src_country_code</CountryCode> </Address> </ShipFrom>
and replace with
Code:
<ShipFrom> <Address> <City>$src_ship_from_city</City> <StateProvinceCode>$src_ship_from_state_code</StateProvinceCode> <PostalCode>$src_ship_from_zipcode</PostalCode> <CountryCode>$src_ship_from_country_code</CountryCode> </Address> </ShipFrom>

That's it. I will assume that for USPS and FedEx there will be similar changes but I do not use them so I didn't bother to check.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #2  
Old 11-04-2008, 05:10 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Ship From address not the same as Company location address

How does this affect your tax structure? I mean, suppose I am in California, and your product ships from Kansas. Do I get charged Cal Sales Tax? What if I lived in Kansas, same question.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #3  
Old 11-04-2008, 05:56 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Ship From address not the same as Company location address

This change has nothing to do with taxes. It only applies for real time shipping rates - ship from / ship to addresses send to UPS to calc the shipping charge.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 12-05-2008, 10:17 AM
 
Serra Serra is offline
 

Member
  
Join Date: Dec 2004
Posts: 26
 

Default Re: Ship From address not the same as Company location address

Quote:
Originally Posted by JWait
How does this affect your tax structure? I mean, suppose I am in California, and your product ships from Kansas. Do I get charged Cal Sales Tax? What if I lived in Kansas, same question.

That depends on state law. Normally, if you have a location in a specific state, then you have to charge tax in that state. If you have a location in CA and KS, then you charge state tax for shipments in both states.
__________________
Serra
Using X-Cart Gold 4.1.9
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 03:36 AM.

   

 
X-Cart forums © 2001-2020