Order of Service\Provider\Decorator ?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Order of Service\Provider\Decorator ?

Post by MikaelNazarenko » 29 Oct 2019, 13:44

Hi Aimeos, hi everybody. Little question, but important for me. I have created two decorators for shipping. One of them calculates price based on country and second based on order total sum. For me it is important that country decorator must be executed first and then result of second decorator will be added to first. So what is the order of execution of decorators. In admin panel I set like shiping class: Standard, FirstDecorator,SecondDecorator. But seems it doesn't affect how I set decorators

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

Re: Order of Service\Provider\Decorator ?

Post by aimeos » 29 Oct 2019, 13:59

Use "Standard,SecondDecorator,FirstDecorator", i.e. "Standard,Sum,Country". The decorators are stacked up from left to right and executed from right to left (think of decorators like the laysers of an onion).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply