Tax based on state

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!
arcandoak
Posts: 12
Joined: 20 Sep 2018, 03:20

Tax based on state

Post by arcandoak » 21 Sep 2018, 01:06

aimeos: ~2018.07
Laravel: 5.6

I'm working on getting Aimeos' Laravel integration setup for my site. I only need to charge tax for orders that come from my state, so I'm hoping I don't need a complicated plugin.
I'm trying to make my own extension plugin that fires on "setAddress.after" and then i call this if it's not my state:

Code: Select all

public function update( \Aimeos\MW\Observer\Publisher\Iface $basket, $event, $value = null )
.
.
.
$basket->getPrice()->setTaxRate('0.00');
Is there anything else I need to do change the tax rate, because it's not updating the tax in the basket/checkout summary?
Is setAddress.after the event I need to grab?

I've tried calling setTaxValue('0.00') as well and that didn't update the basket either.
Aimeos version: ~2018.10, PHP version: 7.2, Laravel version: 5.8

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

Re: Tax based on state

Post by aimeos » 21 Sep 2018, 12:47

You have to set the tax rates of the products to 0.00 and delete/add the products from/to the basket again. You also have to restore the tax rates if the customer changes the country again, so it gets a bit more complicated.

The Aimeos company is offering an extension that handles all the edge-cases:
https://aimeos.com/extensions/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

arcandoak
Posts: 12
Joined: 20 Sep 2018, 03:20

Re: Tax based on state

Post by arcandoak » 21 Sep 2018, 15:02

aimeos wrote:You have to set the tax rates of the products to 0.00 and delete/add the products from/to the basket again. You also have to restore the tax rates if the customer changes the country again, so it gets a bit more complicated.

The Aimeos company is offering an extension that handles all the edge-cases:
https://aimeos.com/extensions/
Thank you! I will give that a try. Is setAddress.after the correct event to use for this?
Aimeos version: ~2018.10, PHP version: 7.2, Laravel version: 5.8

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

Re: Tax based on state

Post by aimeos » 24 Sep 2018, 13:55

Like said, it's a bit more difficult. You need to listen to at least addProduct.after, addService.after, for all the edge cases to a few more.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply