0

I implementing a car parts store using Magento CE and I am having a problem with getting tax to work.. ----High Level Scenario---- My country is Sri Lanka and this how the tax system for vehicle products work. Say the customer ordered a starter motor and then as highlighted below it will fall under HS Code 8511 and a tax of 4% of product will be applied.

-----------Category------------------------------HS CODE------------------Tax %----

1.Body and main parts------------------------8708.99.90-----------------2%

1.1 Doors

1.2 Windows

2 Electrical and electronics

2.1 Audio/video devices----------------------8519 -------------------------2.5%

2.2 Charging system

2.3 Electrical supply system

2.4 Gauges and meters

2.5 Ignition system----------------------------8511---------------------------1%

2.6 Lighting and signaling system--------8512.3------------------------ 0.5%

2.7 Sensors

2.8 Starting system---------------------------8511------------------------------4%

2.9 Switches-----------------------------------8536

Now my need it to calculate the tax by looking at the HS Code. I do not care how this happens either way using a table rates as shipping price I just want the customer to see the whole amount that have have to bear.

What I have already tried is using a Fixed Product Tax attribute for each product. I can put the relevant Tax for that product. But where I am getting stuck is that the Government only change the HS Code category tax percentage only.They say This HS Code category is increased by 2%. So I will have to iterate through the complete product list to

1)first, find which HS Code category a certain product belong to

2)Then update the change amount

My product list will have like many thousand products. So I guess this is going to be very hard.

I need a way,,,,,in the final process of checkout that checks for the HS Code of the product and apply the necessary tax rate and show the customer the final bill....I am fine with putting HS Code as a product attribute. I think I need to write some database acccess coding for this.

I just need need to show the customer how much he has to pay ultimately. Any help would be strongly appreciated....

Thank you so much people.

1
  • It's been awhile, and hopefully you've solved this. It's an interesting question for sure. Do you need to show both item price and tax amount?
    – benmarks
    Commented Feb 14, 2015 at 15:04

2 Answers 2

1

Naturally I have an epiphany after this. Why not use FPT plus an hs_code attribute. You can create an HS code entity as in my previous answer (hs_code entity in the DB with three columns: id, label, and tax_rate).

Then create a product attribute with a custom attribute source model which will read this table.

Each product is linked with an HS Code attribute and rate, and then you can simply write a simple method which will process changes and apply rates to product prices. Much better than my first answer.

0

At the very least you need to represent the HS code entity hs_code in the DB with three columns: id, label, and tax_rate.

I ran through various scenarios in my head. The most instinctively appealing of these was to modify the price indexer so that it would factor in the hs_code amount when processing data. The problem with this approach though is that direct queries of a product's price attribute will not include this price. As long as you know this though you should be fine to rewrite \Mage_Catalog_Model_Resource_Product_Indexer_Price_Default::_prepareFinalPriceData() (along with other product type indexers if needed).

Alternately, you can set up an untaxed_price (for example) attribute on the product entity which will store the untaxed price. You can then use a number of methods (rewrites or event observers) to generate the price value based on the hs_code. The one thing you must ensure for this approach is that you do not have a race condition in which you are simply always updating price on product save, probably by checking that price is same as it was, calculating that the price is already adjusted based on hs_code factor, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.