Decorators How they work and problems

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!
User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Decorators How they work and problems

Post by aimeos » 16 Apr 2021, 15:32

This explains the technical details of how service decorators work:
https://aimeos.org/docs/latest/provider ... ecorators/

From a user perspective, you create one service option for each possibility in the admin backend. Without decorators, they are all shown to the customers. Now you add the decorators for each service option to restrict if they are shown or not, e.g. one is only shown if the weight of the products is less than 10 (kg, lbs, etc.) and you therefore add the "Weight" decorator with a "weight.max: 9.999" configuration. For the other service option which should be shown if the sum or all product weights is equal or above 10 you add "weight.min: 10". Now, only one of the delivery option is shown depending of the weight of the products in the basket.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Decorators How they work and problems

Post by Shopmister » 17 Apr 2021, 06:30

From a user perspective, you create one service option for each possibility in the admin backend. Without decorators, they are all shown to the customers. Now you add the decorators for each service option to restrict if they are shown or not, e.g. one is only shown if the weight of the products is less than 10 (kg, lbs, etc.) and you therefore add the "Weight" decorator with a "weight.max: 9.999" configuration. For the other service option which should be shown if the sum or all product weights is equal or above 10 you add "weight.min: 10". Now, only one of the delivery option is shown depending of the weight of the products in the basket.
Oh, yes all i did so i think. see the pictures but that i do with download.all nothing happens, and that i did with max and min-weight, nothing happens in frontend and with reduction 100 percent too i think. I used the demo-article for to do in basket, it have already weight. I hope i have an fail in, please tell me :).
servicedecorator3.png
servicedecorator3.png (19.87 KiB) Viewed 4182 times
servicedecorator2.png
servicedecorator2.png (22.11 KiB) Viewed 4182 times
servicedecorator1.png
servicedecorator1.png (19.08 KiB) Viewed 4182 times

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

Re: Decorators How they work and problems

Post by aimeos » 20 Apr 2021, 10:19

For using the Weight decorator you have to add the Weight decorator to the provider field. Otherwise, you have configuration that isn't used.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Decorators How they work and problems

Post by Shopmister » 21 Apr 2021, 07:30

I think its working now, but it was a bit tricky sometimes to save the Values/Provider. And i think some providers possible to set after an OPption and Value and some vice versa. But i think only.

But a view questions i still have. Normally to set the value and the product weghit in Kilo or in gramm? BEcause your example was 9999 and in the pproducts of AImeos demo are 2,5 as example. :). The same for height.

And whats the difference between decorators and Service decorators. Or Without service , decorators dont exist, and that are then subclients?

And the doku said something like its possible to use the service decoratoors like we talked about, but as an lala.lala = Value too?

Maybe it would be good to have an option in the forum, to can say two things:
- thats the helpfull answer
- And found a solution
And if solution found the topic go to the archive or something like that. Its maybe easier to handle and better for the users they try to found solutions :).

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

Re: Decorators How they work and problems

Post by aimeos » 24 Apr 2021, 09:14

Shopmister wrote: 21 Apr 2021, 07:30 But a view questions i still have. Normally to set the value and the product weghit in Kilo or in gramm? BEcause your example was 9999 and in the pproducts of AImeos demo are 2,5 as example. :). The same for height.
That depends up to you. You can chose any unit but you have to use that unit all over, i.e. always kilogramm for weights, meter for sizes, etc.
Shopmister wrote: 21 Apr 2021, 07:30 And whats the difference between decorators and Service decorators. Or Without service , decorators dont exist, and that are then subclients?
Decorators exists for different class types because they share the same interface.
Shopmister wrote: 21 Apr 2021, 07:30 And the doku said something like its possible to use the service decoratoors like we talked about, but as an lala.lala = Value too?
Don't know what you are talking about.
Shopmister wrote: 21 Apr 2021, 07:30 Maybe it would be good to have an option in the forum, to can say two things:
- thats the helpfull answer
- And found a solution
And if solution found the topic go to the archive or something like that. Its maybe easier to handle and better for the users they try to found solutions :).
Don't know if phpbb offers such features but you can change the title of the topic and add "[solved]" at the beginning.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply