Change product price in payment provider
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Change product price in payment provider
Hello,
I want to change the price of all products and its sum in the basket if my self created payment provider is selected as payment option.
I try to do that in the calcPrice() method.
On the confirmation page the price is correctly changed but after completion the old price is shown again in the order.
Is that the right place to change the prices or might be a basket plugin the better place?
Best regard,
Moritz
I want to change the price of all products and its sum in the basket if my self created payment provider is selected as payment option.
I try to do that in the calcPrice() method.
On the confirmation page the price is correctly changed but after completion the old price is shown again in the order.
Is that the right place to change the prices or might be a basket plugin the better place?
Best regard,
Moritz
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
Re: Change product price in payment provider
In calcPrice() of service decorators can should only set the shipping costs or shipping rebates but not modify the price items of the basket because calcPrice() is called even if it isn't selected. In a basket plugin you can do what you want but make sure that you add a new line with the rebate in the basket because the total is constantly recalculated based on the basket content.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Change product price in payment provider
Ok, thanks!
I tried it with a plugin to set all prices to 0.00€ if the configured payment is selected.
That works until I click 'change payment' on confirmation page and select a different payment.
The prices then are 0.00€ aswell.
Maybe I should call something like resetPrices() if a different payment as the configured is set.
Here is my code for better understanding:
I tried it with a plugin to set all prices to 0.00€ if the configured payment is selected.
That works until I click 'change payment' on confirmation page and select a different payment.
The prices then are 0.00€ aswell.
Maybe I should call something like resetPrices() if a different payment as the configured is set.
Here is my code for better understanding:
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
Re: Change product price in payment provider
Most likely, the ProductPrice basket plugin will update the price of the product again. Can you check?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Change product price in payment provider
The price will only be updated when I return to the shopping cart or click on "Buy Now".
However, I get an error message that the price has changed and have to click the button again to continue.
This may make sense if the price changes from 0.00€ to 19.99€.
However, if the prices are all changed to 0.00€ due to the chosen payment method, I would like to avoid the error message.
However, I get an error message that the price has changed and have to click the button again to continue.
This may make sense if the price changes from 0.00€ to 19.99€.
However, if the prices are all changed to 0.00€ due to the chosen payment method, I would like to avoid the error message.
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
Re: Change product price in payment provider
You have to disable the ProductPrice basket plugin to avoid this.
In the latest version, modified prices are skipped by the ProductPrice plugin so they will stay as is.
In the latest version, modified prices are skipped by the ProductPrice plugin so they will stay as is.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Change product price in payment provider
Disable the ProductPrice plugin is no option for me because then no price will be reset if I choose an other payment.
I think the error messages are ok for me.
My main problem is currently that I can't place an order if the prices are set to 0.00€ before.
When clicking "buy now" I get the price changed error again and again.
I think the error messages are ok for me.
My main problem is currently that I can't place an order if the prices are set to 0.00€ before.
When clicking "buy now" I get the price changed error again and again.
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3
Re: Change product price in payment provider
Because you ar getting into a loop at which the ProductPrice plugin updates the price again and throws an error that displays the warning. The solution is that you manage the product price in your own plugin (reduce the price if necessary and restore the price if a different option is chosen) with the ProductPrice plugin disabled.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star