Skip to content

Show products based on customer group #438

Answered by sags95
bakerhaider asked this question in Help
Discussion options

You must be logged in to vote

Hi @BakerAlblam, you can likely do this a few ways. Using only the frontend API you can do something like the following

  • On products, add a "customer group" attribute with a value for the customer group that the product should be linked to
  • On the storefront, authenticate the customer, this will also return the group field that denotes the customer group.
  • Fetch products with the customer group attribute value that matches the group id. It can be something like this:
await swell.products.list({
   $filters: {
      customer_group: '<customer_group>'
   }
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bakerhaider
Comment options

Answer selected by logeshswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
2 participants