Jump to content

Adding products by retailer


hance2105

Recommended Posts

hello guys, i have a login table where customer and retailer logins are stored. roles that are defined in the table are retailer and customer next to each login details.

customers and retailers both are given user_ids when registering. since i have many retailers who will add the same products but with different product details and prices, i want to know how to differentiate between those retailers when they add products. it will be much easier to do a query by retailer then.

every product added are stored in the tbl_product table in the database. queries are done from that table.

suppose retailer A has added product A, retailer B has added product A as well but with a different description and a different price.

is it possible? can i have a tutorial somewhere?

Link to comment
Share on other sites

It's not difficult at all. All you need to do is have a field in your products table which is the ID of the retailer in the users table (which I think from your comments is called user_ids). That way the two tables are linked through the retailers ID, and you can get all of the retailers information and all of their products in one hit.

Link to comment
Share on other sites

I can understand that retailers would have different prices but why would descriptions of the same product be different for each retailer? More likely the model would be more like this

+------------+                                       +--------------+
| retailer   |                                       | product      |
+------------+                                       +--------------+
| user_id    |----+    +------------------+    +-----| product_id   |
| user_name  |    |    | retailer_product |    |     | prod_name    |
| etc        |    |    +------------------+    |     | prod_desc    |
+------------+    +---<|  user_id         |    |     | manufacturer |
                       |  product_id      |>---+     | product_code |
                       |  price           |          | etc          |
                       +------------------+          +--------------+
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.