How to implement required Facets #1900
Replies: 4 comments 12 replies
-
@michaelbromley
it cannot be found, i assume it has to be generated prior api launch by some tool from graphQl schema ? |
Beta Was this translation helpful? Give feedback.
-
I've just tried to open that video. It won't render. |
Beta Was this translation helpful? Give feedback.
-
At Pinelab we've had this feature request quite often. It's such a useful feature for most shops that @dalyathan packaged this feature into a plugin: https://pinelab-plugins.com/plugin/vendure-plugin-facet-suggestions/ Now you can just install it without having to implement and maintain it. *️⃣ The plugin version is slightly different from the feature in the video, in that facets are suggested and never mandatory. |
Beta Was this translation helpful? Give feedback.
-
I have an issue here I want to populate the product data with my custom input fields how can I achieve that?
|
Beta Was this translation helpful? Give feedback.
-
In the video Vendure extensibility: Advanced custom fields & UI extensions I demonstrate a UI extension that helps admins to ensure that products always include the expected facets.
This solution is not open source (it's just part of one of my own projects) but since a lot of people asked about it, I'm dumping the code required to implement:
Custom fields
You need to define the following custom fields on Facet:
Admin API extension
The ui component uses this custom query on the Admin API:
admin.resolver.ts
UI Component
The ui component files:
required-facets.component.html
required-facets.component.ts
required-facets.component.scss
required-facets.graphql.ts
Then register the component in your ui extension module
Beta Was this translation helpful? Give feedback.
All reactions