Jump to content

Question - General thoughts


Ninjakreborn

Recommended Posts

I have a general questions.

 

1. I have a list of products.

2. I have a list of each of the 50 states.

3. I have a list of "professions".

 

I need to setup something called "State Verbiage".  However, this is going to be on a per product, per state, per profession level.  So each profession is mapped up to each state and product.

 

So product #1, in State #4, for profession #2 would have verbiage.

Any combination of the three would have different verbiage.  Any advice on the easiest way to set this up, would be appreciated.

Link to comment
Share on other sites

On the frontend a state and profession are selected.  This is used to filter which products show up.  For state verbiage I need to get the verbiage associated with that product/profession/state.  The verbiage would change if any of these 3 things changed (profession, state, or product).

 

I have a general idea of how i want to do it, but pulling all this on the frontend with PHP is going to get tricky. Wanted to see if anyone had any ideas to toss around before I tried the catch all mapping table and just pulled them out on a case by case basis.

Link to comment
Share on other sites

Sorry yeah, I see what you mean. Would a simple map table like this not do the trick..?

 

verbal_id | product_id | state_id | profession_id | verbal_str

1        | 1          | 4        |  2            | 'Text for your example'

 

Although thinking about it, performance would probably be better (and you'd be able to make the column unique) to join the various IDs within a single key:

 

verbal_id | verbal_key | verbal_str

1        | '1:4:2'    | 'Text for your example'

 

But I guess it depends in what ways you'd be using the data.

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.