Zen Cart Logo
Forums / General Questions / Database storage logic: mutli-language quesstion.

Database storage logic: mutli-language quesstion.

Views: 554

Results 1 to 4 of 4
17 Sep 2013, 9:57 AM
#1
k9dug avatar

k9dug

New Zenner

Join Date:
Oct 2010
Location:
Glasgow, Scotland
Posts:
29
Plugin Contributions:
0

Database storage logic: mutli-language quesstion.

Hi,

I am modifying an addon and have a question regarding the rules to apply for storing data in the products_options table. (This question may apply to other tables too).

I am adding new Product Options. For this I have to insert values for the three most important fields:

products_options_id
language_id
products_options_name

The first two comprise a combined primary key.

My question is: if I have the option "Size" (English), and I want to add the Spanish equivalent "Tamaño", should both entries share the same
products_options_id and just different language_id? ie:

products_options_id = 1
language_id = 1
products_options_name = Size

products_options_id = 1
language_id = 2
products_options_name = Tamaño

Alternatively, Should both entries have both primary fields different? ie:

products_options_id = 1
language_id = 1
products_options_name = Size

products_options_id = 2
language_id = 2
products_options_name = Tamaño

Both options would produce two unique combined primary keys.

I need to know this to ensure that when switching language in my shop, the system continues to display the correct options, just in the different language.

I would expect that the first scenario is the correct one, but I cannot find any documentation anywhere to confirm this (is it available anywhere?).

Thanks.

17 Sep 2013, 4:25 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Database storage logic: mutli-language quesstion.

Out of the box with an additional language added there are files already that address this

Check for the spanish language pack and see

http://www.zen-cart.com/downloads.php?do=file&id=1110

18 Sep 2013, 12:37 PM
#3
k9dug avatar

k9dug

New Zenner

Join Date:
Oct 2010
Location:
Glasgow, Scotland
Posts:
29
Plugin Contributions:
0

Re: Database storage logic: mutli-language quesstion.

Corrected but double-posted for some reason :-(
Feel free to delete this entry.

18 Sep 2013, 12:37 PM
#4
k9dug avatar

k9dug

New Zenner

Join Date:
Oct 2010
Location:
Glasgow, Scotland
Posts:
29
Plugin Contributions:
0

Re: Database storage logic: mutli-language quesstion.

Thanks kobra.

Without going to the extent of installing a language pack to find this out, are there any sources of info on the data model/database, such as a data dictionary etc., which explain the purpose and/or general usage of tables and fields? Where would Plugin/Addon developers source this information? I have seen the wiki entries on the database but this doesn't say much more than can be seen looking at the database itself.