Wrong price send to payment provider when using NoVat?

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!
danielsiepmann
Posts: 14
Joined: 12 Jun 2023, 06:49

Wrong price send to payment provider when using NoVat?

Post by danielsiepmann » 20 Apr 2026, 11:55

We updated a customer project using the paid aimeoscom/ai-vatcheck package from 2021.04 to 2025.04.3.

It looks like there was some internal refactoring within aimeos regarding the recalculation logic of the basket/invoice price.
The packege called

Code: Select all

$basket->setModified()
in the past. It now misses any call leading to no properly applying the NoVat logic to the final price send to the payment provider.

We could fix it by adding the following line instead:

Code: Select all

$basket->getPrice()->setModified();
I'm not 100% sure I got everything right. So it would be cool to know if this fix is correct or what we should do instead.
I'd opened an issue instead of this help post, but get a 404 as the source code, for obvious reasons, is not public.

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

Re: Wrong price send to payment provider when using NoVat?

Post by nos3 » 20 Apr 2026, 13:12

Hi Daniel
danielsiepmann wrote: 20 Apr 2026, 11:55 It looks like there was some internal refactoring within aimeos regarding the recalculation logic of the basket/invoice price.
The packege called

Code: Select all

$basket->setModified()
in the past. It now misses any call leading to no properly applying the NoVat logic to the final price send to the payment provider.

We could fix it by adding the following line instead:

Code: Select all

$basket->getPrice()->setModified();
Using $basket->getPrice()->setModified() looks good to me. Where is that missing in the 2025.10 version?

danielsiepmann
Posts: 14
Joined: 12 Jun 2023, 06:49

Re: Wrong price send to payment provider when using NoVat?

Post by danielsiepmann » 21 Apr 2026, 05:07

Thanks for the fast response.

It is missing at the end of:

Code: Select all

Aimeos\MShop\Plugin\Provider\Order\NoVat->calcVat()
That's our current patch for the package:

Code: Select all

--- a/src/MShop/Plugin/Provider/Order/NoVat.php
+++ b/src/MShop/Plugin/Provider/Order/NoVat.php
@@ -206,6 +206,7 @@ class NoVat
 		$basket->getPrice()->setTaxFlag( false );
 		$session->set( $this->key, $prices );
 
+		$basket->getPrice()->setModified();
 		return $basket;
 	}
 
We also have still issues with renew process of subscriptions. But I'm still debugging this part. The provider is called, but the address, for whatever reason, is missing after the product was added. That leads to not properly applying the NoVat logic.
I'll post more info here if I figured out the issue, and if it is related to Aimeos own code, and not to our custom code.

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

Re: Wrong price send to payment provider when using NoVat?

Post by nos3 » 21 Apr 2026, 08:44

danielsiepmann wrote: 21 Apr 2026, 05:07

Code: Select all

--- a/src/MShop/Plugin/Provider/Order/NoVat.php
+++ b/src/MShop/Plugin/Provider/Order/NoVat.php
@@ -206,6 +206,7 @@ class NoVat
 		$basket->getPrice()->setTaxFlag( false );
 		$session->set( $this->key, $prices );
 
+		$basket->getPrice()->setModified();
 		return $basket;
 	}
 
The method already contains

Code: Select all

$basket->getPrice()->setTaxFlag( false )
, so the price item should be already modified. The issue may not be in the NoVat plugin but in the Aimeos core. The setTaxFlag() method uses set() of the common item here: https://github.com/aimeos/aimeos-core/b ... e.php#L213

Can you please check, why setModified() isn't called here?
https://github.com/aimeos/aimeos-core/b ... e.php#L213

danielsiepmann
Posts: 14
Joined: 12 Jun 2023, 06:49

Re: Wrong price send to payment provider when using NoVat?

Post by danielsiepmann » 21 Apr 2026, 09:13

In our case the taxFlag was already false. I didn't investigate that further.
That lead to not marking the price as modified.

To me, it looks like the NoVat only modifies the price of the products for our setup. But that modification is unknown to the price of the basket/order and not taken into account for that reason.

Regarding our further issue: That was our own fault, not updating the static_info_country column once a user logs in from our provider, but only the country column. Not sure if this should be changed within aimeos. But we fixed our integration to update both columns. And fixed existing data via an update query.

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

Re: Wrong price send to payment provider when using NoVat?

Post by nos3 » 21 Apr 2026, 14:26

The latest 2025.10.x-dev commit of the ai-vatcheck extension forces recalculation of the basket price now.
Can you please check if it works for you too?

danielsiepmann
Posts: 14
Joined: 12 Jun 2023, 06:49

Re: Wrong price send to payment provider when using NoVat?

Post by danielsiepmann » 22 Apr 2026, 07:43

We are still on 2025.04 within the project, so I'm unable to test 2025.10. Sorry.

Post Reply