How to create multiple listings for a single product?

Need help to structure database. I’m building a multi vendor marketplace where they can list their product.

I want them to select a existing list of products in order to create a listing. So all listings will be organized under the product.

I need it to be displayed like the screenshot:

I tried to create type “Product” where I manually add each item and also type “Listings”. But I can’t attach them to each other. Not sure what I’m doing is right. Anyone have ideia?


Just to be clear:

  1. You’re going to have a set of vendors.
  2. These vendors can sell products, but can only sell products from your own list of products.

If this is correct, it seems pretty straightforward.

  1. Make your vendor table.
  2. Make your product table.
  3. Make a VendorProduct table, which will have the following fields:
  • vendorID
  • productID

I think that’s all you need db-structure wise.

Then your RG could just select all VendorProduct table rows for a particular vendor.

Or am I missing something?

1 Like