tax calculation for orders not being calculated / stored

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
woo13244
Posts: 10
Joined: 02 Aug 2018, 21:49

tax calculation for orders not being calculated / stored

Post by woo13244 » 10 Aug 2018, 13:40

I am building in Laravel with the latest version of Aimeos. I have been utilizing a tax plugin with Aimeos called taxjar. I needed to base the tax rate on the customer's shipping address. I have successfully done this for the front end of the aimeos shop but when I check the admin panel in "orders" that tax is not calculated in the order details. I have looked through the database and I see that the tax is being reset before being put into the database. I have looked in mshop_order_base_product table and the tax is being stored as 0.00. Do I have to manipulate the order further down the line to have it be saved to the database and shown in the admin panel? I have found the controller for the order confirmation and when I dump the $view->summaryTaxRates variable in the
``` ai-client-thml/client/html/src/client/html/checkout/confirm/order/standard.php. ```, and It still contains my custom taxrate. Maybe there is a controller between the confirmation and the actual storage of data??

Thanks For BEING AWESOME!

The help is greatly appreciated.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: tax calculation for orders not being calculated / stored

Post by aimeos » 10 Aug 2018, 18:48

Tax is being recalculated based on the tax rate, so our first try would be to set the tax rate as well.

If you set the tax in the price item of the order base item (basket) then it will be overwritten for sure:
https://github.com/aimeos/aimeos-core/b ... d.php#L358

If you put the tax into the price item of the order product item, it might survive but we would recommend to set the tax rate too, even if you have to calculate it yourself. This ensures that your database content and frontend/backend output is always correct
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply