Re: Re: Add tax to product price

sebi_tl@drupal.org's picture
Offline
Joined: 11/10/2007
Juice: 4
Re: Re: Add tax to product price

k, sry hat was stupid, pls ignore my last post... i looked up the api and saw that node_get_types expects an input in form of
node_get_types($op, $node, $reset)
anyways, i got it to work by adding an additional step to determine the "type's type" Eye-wink
the whole function now looks like this in my installation and seems to work for me:

function _uc_product_taxes_calculate($node) {
$gettype = node_get_types('type', $node);
$type = $gettype->type;
$taxes = uc_taxes_get_rates();
foreach ($taxes as $taxe) {
foreach ($taxe->taxed_product_types as $taxed_product_type) {
if($type == $taxed_product_type) {
$taxes_amount += $taxe->rate;
}
}
}
return $taxes_amount;
}
Add tax to product price By: zmove (68 replies) Fri, 10/26/2007 - 09:35