Open surajreddy opened 6 years ago
TL;DR tax_class_id
is not meaningful enough for us to know if the product is taxable or not. No API for tax is available, has to visit the database
Apparently Magento supports custom tax class on both product and customer levels. This means that we need to query the database to retrieve a list of all product tax_class_id
, given there is no existing Magento APIs for tax info. The pictures below show examples of customer/product tax classes in Magento.
The way tax works in Magento is as follows: both product and customer have one tax class associated with them. Magento supports such a concept called tax rule - a tax rule applies to a pair of pre-defined customer tax class and product tax class with a certain tax rate. All the tax information, including tax rules, tax rate and tax classes, has no API available. The only way to retrieve them is through database. The picture below shows what tax rules look like in Magento.
According to how tax works in Magento, there is no way of knowing if the product is taxable beforehand. The tax_class_id
itself is not meaningful until being considered in the context of tax rules. To make the matter worse, we don't know which tax rule will be applied to a product until the customer makes an order.
The original intention of the ticket is to investigate how tax_class_id
works in Magento and if it is possible to map tax_class_id
to taxable
field of product in Shopify directly. Throughout the investigation it turns out that tax handling of product/customer is more complicated than we anticipated. As of the meeting today we've decided to hold off on this ticket, until we've gathered more input from merchants about if they'd like to use this feature.
Magento simple products seem to have a
tax_class_id
which corresponds to Taxable Goods, Shipping and Tax Exempt. It might be possible to extract these as theVariant Taxable
field.I'm not sure if this changes across Magento instances - if it does, we might need to fetch the values for the
tax_class_id
from the database.