Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Advice on User Support

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #172113
    Josh
    Participant

    Hey everyone,

    I’m looking for advice on how to tackle this. Someone’s asking me if this is possible, and I’m just not quite sure how it might be done from a content management standpoint.

    Imagine you have a set of like 10 products. Each one has it’s own set of support documents or software. One customer might own 2 or 3 of these products. They’re asking if there is any way to put in a new customer to be able to log into the site and then define which products that customer has. So that when they log in, they’ll see the support items associated with those 2 or 3 products and not the others.

    It sounds kind of like a nightmare from the client side to go through the steps to define who should have what. Is there a conceivable way that this might be relatively easy in something like WordPress or Expression Engine?

    #172146
    __
    Participant

    If you’re looking to integrate with WP or EE, you’d probably have to (find someone to) write a custom plugin. Couldn’t help you much there.

    Otherwise, it’s mostly an issue of how you structure your database.

    create table user(
        id serial primary key,
        -- user details, etc.  ...
    )engine=innodb;
    
    create table product(
        id serial primary key,
        -- product info, etc.  ...
    )engine=innodb;
    
    create table product_supportitems(
        id serial primary key,
        product bigint unsigned not null,
        -- support item content, info, etc.  ...
        foreign key(product) references product(id)
    )engine=innodb;
    
    create table user_product(
        user bigint unsigned not null,
        product bigint unsigned not null,
        primary key(user,product),
        foreign key(user) references user(id),
        foreign key(product) references product(id)
    )engine=innodb;
    

    Then, you could find support items that match products a given user owns like so:

    select list,col,names,you,want from product_supportitems
        where product in(
            select product from user_product where user=:userID
        );
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.