从magento的Tax类获取tax_calculation_rule_id [英] Get tax_calculation_rule_id from Tax class in magento

查看:65
本文介绍了从magento的Tax类获取tax_calculation_rule_id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我具有产品税类和客户税类,如何获得tax_calculation_rule_id.目前,我正在一个模块中尝试扩展magento API的税收规则.我有customer tax class nameproduct class name,在这两个函数的基础上,有什么功能可以给我tax_calculation_rule_id

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

推荐答案

尝试以下操作:

$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());

这篇关于从magento的Tax类获取tax_calculation_rule_id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆