Jump to content

Retrieving product taxes


MrBaseball34

Recommended Posts

I don't have state taxes set up, so I can't test this, but try this:

$result = Db::getInstance()->ExecuteS('SELECT c.`iso_code` AS `country_iso_code`, s.`iso_code` AS `state_iso_code`, t.`rate` FROM `'._DB_PREFIX_.'tax` t LEFT JOIN `'._DB_PREFIX_.'_tax_state` ts ON (t.`id_tax` = ts.`id_tax`) LEFT JOIN `'._DB_PREFIX_.'_state` s ON (ts.`id_state` = s.`id_state`) LEFT JOIN `'._DB_PREFIX_.'_country` c ON (c.`id_country` = s.`id_country`)');

foreach ($result as $row)
  echo $row['country_iso_code'].':'.$row['state_iso_code'].':'.$row['rate']."\n";

Link to comment
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
×
×
  • Create New...