What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello, does somebody ever handled “multiple attributes” for one abstract/concrete in Spryker success
Hello,
does somebody ever handled “multiple attributes” for one abstract/concrete in Spryker successfully?
We currently need to represent a scenario where a product variant can have for example multiple colors like green, black and white but are not limited to just one of those colors. The user should get displayed a “multi-value” filter where he can select any of those colors. as long as he matches any color being in the variant, the product should be visible.
First idea was to set up multiple color attributes like color_1, color_2, color_3 etc. … but since we don’t know how many colors a product might have, we cannot declare it in advance. Also it makes no sense if the order of color changes … because if color_1 = red and color_2=white, it should be the same as color_1 = white and color_2 = red.
Technically it feels like it should behave more like a tag which can be filtered in elasticsearch also, but spryker seems not to be capable to handle this.
Any ideas/suggestions and or experience from your projects? Is there anything planned in future?
Best regards
Comments
-
Usually color is super attribute and every color equals separate concrete product.
Product abstract = T-shirt
Product concrete 1 = Black T-shirt
Product concrete 2 = Blue T-shirtetc.
0 -
The filters you described will work as well in such case.
0 -
We use it and spryker can do it out of the box. The only error is the BE, but its is fixable with twig and if you want to also save it in zed there is a lil more effort to do. The attribute value has to be saved as an array in database, synced with ES and redis and voila, everything works fine as multi value filter in FE.
0 -
@U02DBNVTTAS I am not sure if you got me right. Its not about having one color as a super attribute … its more about that ONE concrete has multiple Colors attached .. so instead of being a blue variant, its blue AND red AND yellow at the same time … but whenever i choose one of those 3 colors, the variant should be in the result set
0 -
you mean something like this?
0 -
yes but for one variant … the multi filter is originally intended to use across variants i guess …
0 -
so must be something like color = {brown, yellow, red …} …
0 -
@UPWG9AYH2 ah.. I used color_1, color_2… as you mentioned in the original message. (primary, secondary, thirdary) So not good way was found by me
0 -
this is one variant. in my example its a shoe. another variant has for example blue, red
0 -
yeah thats the problem if you dont know how many colors will be used in the end … thats why i think it must more behave like a tag or a label
0 -
but how does ES work with this? How to split in separate filters again on yves again? seems to me complicated
0 -
the split is made automatically
0 -
each color will be one facete
0 -
really? okay then in backend the form has to be extended to accept something like a json you mentioned?
0 -
no json, just array. try it yourself. edit the attributes in db and trigger the event for sync to es and redis.
0 -
zed will throw exception for viewing the attributes, but you can check via twig if productAttributes[localeCode][key] is iterable and handle it different. So you can implement something like tagging or something else. Or you handle it as json but for saving you have to convert it back to array. many ways for archiving this goal
0 -
thanks, ill try that … do you know if this is documented somewhere? I am really not aware of this capability but it’s maybe very essential to us
0 -
Nope, sry. Last week I had the to do for a technical spike for this stuff. So I only analyzed and debugged this and made the internal docs and a protoype for some ways of solving this. Next week we will discuss which way we take
0 -
Thanks a lot guys, i’ll try something 🙂
0 -
Okay, it does not seem to work ootb. I managed it to have it as an array synced to redis with the attribute map like
```"super:attr:test": [
"Option 1",
[
"Option 1",
"Option 3"
],
"Option 2"
],```
But if i define it as a filter its just showing Option 1 and 2, but not Option 3 … what am i missing? 🤔
0 -
dunno if it can handle handle those
0 -
maybe you have to extend this case
0 -
yes, i have to look … so i think there are two cases … this one is about product variations … the other is about filtering on the category pages … if the latter would work ootb, it would help me a lot
0 -
I think im my case, we only use it for normal attributes, not for super attributes which are nested like you do
0 -
But even for “normal” attributes … so I am a bit confused now. How does it behave ootb on your side? How do you use it?
I can see the attributes coming as an array from Redis for the product abstract attribute map, but won’t return as a filterable value from elasticsearch … i expected now something that when i add a filter to the category page for such an attribute that can be selected then … but it does not seem to behave like this0 -
For me it will show up in ES as attribute array and also for every value a string facet
0 -
In FE it shows up as single filter
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random