How can i get the tax_calculation_rule_id
if i have product tax class and customer tax class. Currently i am working on a module in which i am trying to extend magento API's for tax rules. I have customer tax class name
and product class name
, Is there any function which can give me tax_calculation_rule_id
on the basis of these two
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Try following:
$tax = Mage::getModel('tax/calculation');
//Get the rate based on customer class
$customer_tax_class = '5';
$rates = $tax->load($customer_tax_class, 'customer_tax_class_id');
print_r($rates->getData());
//Get the rate based on product class
$product_tax_class = '2';
$rates = $tax->load($product_tax_class, 'product_tax_class_id');
print_r($rates->getData());