Replies: 2 comments 3 replies
-
I am using custom attributes with filtering right now on current projects. We are handling them in JSONB metadata.attributes object. Also we filter them by creating custom store/products endpoint and utilizing queryBuilder in service. Here is an example of a method in product service:
And filtering like this:
I heard that Medusa is migrating to MikroORM and that is very awesome because we could filter mikroORM jsonb fields just like a simple field in config. But overall I suggest you to create a model |
Beta Was this translation helpful? Give feedback.
-
Hello, reviving this thread. For what i have seen and tried, the medusa-custom-attributes plugin is for defining "markers", to make it easier to filter and search on the Storefront. Apart from having this markers, i also have the need to establish some attributes, which are common to every product or linked to a category (same concept here as defining a custom attribute to a category in the plugin), but for them to impact product_option, so that they can be used to define the product_variants. Is there anything already developed for this? How are people handling this common use case. I am implementing a second handclothing marketplace, and i want to have attributes like Size and Color, with predefined set of values, as required fields for creating a variant. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I already sang my praises here and I still think this is a nice tool with a lot of potential but the experience I had in the past few weeks trying to get some simple things going is a bit frustrating and impacts my efficiency massively.
My main pain point are custom attributes. You know, the thing basically every store needs. :) There are some other things but I think this is by far the most important feedback I can give you.
I made my way through extending models, figuring out how to make fields appear in API responses and creating UIs for actually editing them with lots of trial and error. I patched source code files that enable me to import data to populate those fields because that is easier than to rewrite the entire batch job from scratch, duplicating 99% of the code for no reason with all dependencies. Now I moved to the client side and I have to find out that custom attributes have not been considered to be required as filters or searched by.
How are people using custom attributes, at all, without a way to use them in search or filter? Are most of the people using medusa as an order system and manage product and product related content somewhere else? Or does the learning curve involve rewriting every product endpoint from scratch? Or does everybody run an ES instance right from the start?
This feels so much more convoluted, complicated and hard to understand without advanced knowledge of the entire base system than it would need to be. And I think the most important part about all of this is that everybody who wants to use custom attributes has to walk the same rocky road all over again, more or less.
However, I also have to mention that I always received help when I needed it, for which I am immensely thankful.
Beta Was this translation helpful? Give feedback.
All reactions