Jump to content
Sign in to follow this  
pafranklin

Tep Get Tax Contrib

Recommended Posts

I have got in a bit of a mess and could do with some pointers please........

 

I am trying to change the code in the includes/functions/generl.php file, but where the instructions say to replace

tep_get_tax_rate()

with

function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
global $customer_zone_id, $customer_country_id, $osC_Tax;
return $osC_Tax->getTaxRate($class_id, $country_id, $zone_id);
}

.

 

However my code is

function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
global $customer_zone_id, $customer_country_id;

if ( ($country_id == -1) && ($zone_id == -1) ) {
  if (!tep_session_is_registered('customer_id')) {
	$country_id = STORE_COUNTRY;
	$zone_id = STORE_ZONE;
  } else {
	$country_id = $customer_country_id;
	$zone_id = $customer_zone_id;
  }

 

Also it says to replace

tep_get_tax_description()

with

function tep_get_tax_description($class_id, $country_id, $zone_id) {
global $osC_Tax;
return $osC_Tax->getTaxRateDescription($class_id, $country_id, $zone_id);
}

 

But again mine looks different as it is

 

  function tep_get_tax_description($class_id, $country_id, $zone_id) {
$tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' order by tr.tax_priority");
if (tep_db_num_rows($tax_query)) {
  $tax_description = '';
  while ($tax = tep_db_fetch_array($tax_query)) {
	$tax_description .= $tax['tax_description'] . ' + ';
  }
  $tax_description = substr($tax_description, 0, -3);

  return $tax_description;
} else {
  return TEXT_UNKNOWN_TAX_RATE;
}

 

Please could someone tell me where I am going wrong?

Thanks.

 

Paul.


You will never learn if you don't try. And boy am I trying....!

Share this post


Link to post
Share on other sites

Just comment out the complete old function and add the new functions. Yes, the functions look completely different; this is because these functions will get information from the new tax class and most of the code that you don't see is in the class definition.

Share this post


Link to post
Share on other sites

Hi again,

 

Tried this and all that happens is the site gets "Stuck" on one page. Even accessing from another computer only one page will appear (irrespective of the url / link)

 

Help.................?


You will never learn if you don't try. And boy am I trying....!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×