Page 1 of 1

Adapt payment options dependent on products

Posted: 30 Nov 2016, 10:28
by Dennis
Hi,

in my project the payment options (PayPal, invoice, Cash on delivery, Prepayment, ...) should be different dependent on the products the costumer has chosen to buy. More precisely, a customer can buy special codes (in addition to normal products) and for these codes only Prepayment should be possible as payment option, for example.

In aimeos I have only found so far the possibilty to specify the payment options globally for all products and there is no differentiation between the products.

Now my question: What is the best way to achieve this feature in aimeos? Where in the code do I have to work on?

Many thanks in advance!

TYPO3 7.6.13, Aimeos web shop 16.10.1, PHP version 5.6.24-0+deb8u1, Linux

Re: Adapt payment options dependent on products

Posted: 30 Nov 2016, 11:30
by aimeos
You can write your own service decorator that checks the products in the basket. Configure it for all payment options besides prepayment and then, it must return false in the isAvailable() method if one of those products is found.

Documentation about service decorators is available here:
https://aimeos.org/docs/Developers/Libr ... _decorator