Wrong price send to payment provider when using NoVat?
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!
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?
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 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:
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.
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()We could fix it by adding the following line instead:
Code: Select all
$basket->getPrice()->setModified();I'd opened an issue instead of this help post, but get a 404 as the source code, for obvious reasons, is not public.
Re: Wrong price send to payment provider when using NoVat?
Hi Daniel
Using $basket->getPrice()->setModified() looks good to me. Where is that missing in the 2025.10 version?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 calledin the past. It now misses any call leading to no properly applying the NoVat logic to the final price send to the payment provider.Code: Select all
$basket->setModified()
We could fix it by adding the following line instead:Code: Select all
$basket->getPrice()->setModified();
-
danielsiepmann
- Posts: 14
- Joined: 12 Jun 2023, 06:49
Re: Wrong price send to payment provider when using NoVat?
Thanks for the fast response.
It is missing at the end of:
That's our current patch for the package:
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.
It is missing at the end of:
Code: Select all
Aimeos\MShop\Plugin\Provider\Order\NoVat->calcVat()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;
}
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.
Re: Wrong price send to payment provider when using NoVat?
The method already containsdanielsiepmann wrote: ↑21 Apr 2026, 05:07Code: 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; }
Code: Select all
$basket->getPrice()->setTaxFlag( false )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?
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.
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.
Re: Wrong price send to payment provider when using NoVat?
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?
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?
We are still on 2025.04 within the project, so I'm unable to test 2025.10. Sorry.