| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
elimination of sales tax for wholesale customers | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#2
|
|||||||
|
|||||||
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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|