mshop/price/taxflag set to 0, VAT not added to total

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: mshop/price/taxflag set to 0, VAT not added to total

Post by aimeos » 14 Jul 2019, 15:44

If the service prices are modified after updating the services, the basket plugins may have been executed. For the "setServices" event, only two plugins register in the core:
- https://github.com/aimeos/aimeos-core/b ... Coupon.php
- https://github.com/aimeos/aimeos-core/b ... ipping.php

Can you post a screenshot of your basket plugin panel list?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nos3
Posts: 87
Joined: 01 Sep 2015, 13:26

Re: mshop/price/taxflag set to 0, VAT not added to total

Post by nos3 » 15 Jul 2019, 08:43

Hello Sacha

Objects are references in PHP and if they are not cloned, modifying them also updates service objects in the basket immediately without setting them again. I think the problem you are facing is related to basket plugins and how they are called because setServices() activates the ServicesUpdate plugin which replaces the delivery service objects in your basket. This would normally activate AddVat again but due to the singleton that enforces a plugin to run only once, the VAT value isn't set to 0.00 again.

The solution might be to remove that line in modifyVat():

Code: Select all

$basket->setProducts( $products )->setServices( $services )
The product and service tax rates are updated nevertheless because the objects are references.
Can you give it a try?

Best regards,


Norbert

nos3
Posts: 87
Joined: 01 Sep 2015, 13:26

Re: mshop/price/taxflag set to 0, VAT not added to total

Post by nos3 » 15 Jul 2019, 16:07

Hello Sacha

Yes, it works like expected in our current test installation so it must be a minor difference in your setup that causes the problem and we need to find out why this happens to make the extension work unter any circumstances.

We give you a two hour support package for free for your help, just contact me privately.

Best regards,


Norbert

nos3
Posts: 87
Joined: 01 Sep 2015, 13:26

Re: mshop/price/taxflag set to 0, VAT not added to total

Post by nos3 » 16 Jul 2019, 10:21

Hello Sacha

Yes, that is related but we need a solution where it still works with the ServiceUpdate plugin enabled. Removing the line completely doesn't work because then, the basket prices isn't updated any more after it has been reset. Can you please try to use this instead?

Code: Select all

return $basket->setModified();
Best regards,


Norbert

Post Reply