Adapt payment options dependent on products

Questions around the TYPO3 integration and plugins
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!
Dennis
Posts: 15
Joined: 30 Nov 2016, 09:16

Adapt payment options dependent on products

Post by Dennis » 30 Nov 2016, 10:28

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

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Adapt payment options dependent on products

Post by aimeos » 30 Nov 2016, 11:30

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply