Welcome Guest, Not a member yet? Register   Sign In
Seeking advices in how to create several accounts for a single vendor.
#1

Hello,

I'm building an multi-vendor ecommerce website and I need some help with a request that I just got. By default, the website will create a single account per vendor. The request I got is to allow several accounts for a single vendor. For example:

Let's say the vendor ACME is a big retail shop and it wants to list their products on my website. Because of ACME's size, each department manager will be responsible for the products listing. That means the website will need to create an account for each department's manager. 

My question is how do I go from one account per vendor to multiple accounts per vendor? How would you design/change your DB scheme?

Regards,
Castle
Reply
#2

Take a look at this.

https://web.archive.org/web/201103111854...79086.aspx
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#3

Sorry, I don't see how it could help me.
Reply
#4

Use a table companies (vendor) and connect the account(s) to a company.
So 1 account can have 1 company, but 1 company can have multiple accounts.
Reply
#5

(03-26-2018, 12:04 AM)Krycek Wrote: Use a table companies (vendor) and connect the account(s) to a company.
So 1 account can have 1 company, but 1 company can have multiple accounts.

Try making a column on the account table that refers to the vendor the account belongs to? Perhaps a foreign key 'vendor_id' that references 'id' on the 'vendors' table? I'm not going to write the SQL for you, but that should get you started.
Reply
#6

If I was doing it, Vendor would be a role in my authentication, and any person logged in as Vendor would be able to manage the creation/removal of Subvendors (or whatever I was told to name them). This would be super simple, and Community Auth already comes set up to manage role based authentication, and all I'd need to do is implement some basic logic on user creation.
Reply
#7

(This post was last modified: 03-26-2018, 09:26 PM by castle.)

Thank you guys. Do you mean something like this? (plz see the attachment).

@skunkbad i'll check your library.

Attached Files Thumbnail(s)
   
Reply




Theme © iAndrew 2016 - Forum software by © MyBB