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

elimination of sales tax for wholesale customers

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-23-2005, 06:51 AM
 
coupdgras coupdgras is offline
 

Newbie
  
Join Date: Mar 2005
Posts: 3
 

Default elimination of sales tax for wholesale customers

Here is a mod for ver 3.5.x ( it will probably work with 4.x as well). This will eliminate default sales tas for wholesale customers.

Please open include/func.php of your x-cart, fund definition of function func_calculate_taxes and replace

if ($customer_info["s_state"])
$apply_taxes_to_shipping = array_pop(func_query_first("SELECT $sql_tbl[state_tax].tax_shipping FROM $sql_tbl[states], $sql_tbl[state_tax] WHERE $sql_tbl[states].code=$sql_tbl[state_tax].code $provider_condition AND $sql_tbl[state_tax].code='".$customer_info["s_state"]."' AND $sql_tbl[state_tax].country_code='".$customer_info["s_country"]."'"));


with

if ($customer_info["s_state"] && $customer_info['membership'] != 'Wholesale Level 1')
$apply_taxes_to_shipping = array_pop(func_query_first("SELECT $sql_tbl[state_tax].tax_shipping FROM $sql_tbl[states], $sql_tbl[state_tax] WHERE $sql_tbl[states].code=$sql_tbl[state_tax].code $provider_condition AND $sql_tbl[state_tax].code='".$customer_info["s_state"]."' AND $sql_tbl[state_tax].country_code='".$customer_info["s_country"]."'"));


then replace

if ($customer_info["s_state"])
$state_tax = func_query_first("select $sql_tbl[state_tax].* from $sql_tbl[states], $sql_tbl[state_tax] where $sql_tbl[states].code=$sql_tbl[state_tax].code $provider_condition and $sql_tbl[state_tax].code='".$customer_info["s_state"]."' AND $sql_tbl[state_tax].country_code='".$customer_info["s_country"]."'");

with

if ($customer_info["s_state"] && $customer_info['membership'] != 'Wholesale Level 1')
$state_tax = func_query_first("select $sql_tbl[state_tax].* from $sql_tbl[states], $sql_tbl[state_tax] where $sql_tbl[states].code=$sql_tbl[state_tax].code $provider_condition and $sql_tbl[state_tax].code='".$customer_info["s_state"]."' AND $sql_tbl[state_tax].country_code='".$customer_info["s_country"]."'");


In other words, you just need to add additional condition about membership level of a customer to
the function.
__________________
David Gould
CA World WiFi
david@caworldwifi.com
www.caworldwifi.com
x-cart ver 4.1.10
Reply With Quote
  #2  
Old 09-23-2005, 07:30 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Just FYI so as not to confuse 4.x users, you can assign tax rates to specific membership levels in 4.x, so this mod wouldn't be necessary.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
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 02:48 AM.

   

 
X-Cart forums © 2001-2020