Re: Tired of how X-Cart handles product options?
Hi Again,
Languages for variants are kept in / use the xcart_product_options_lng SQL table.
Basically there is always a language indicator in a table where languages appear e.g. US, GB, DE, FR etc. (this is how the code knows which variable to pull out of the table).
Basically general product descriptions etc. are able to be imported ok and are kept in the xcart_products_lng SQL table... so this is a direct match for importing (not big issue).
For Variants e.g. colour, size etc. there is a huge issue...
Basic problem is that variants are based on the variant ID and Option ID links - namely xcart_variant_items table defines these links (uses 4 SQL tables Option ID, Variant ID, Variant ID links and language version of these links).
Therefore you have to know the Variant ID code & Option ID code for each product variant and match this to the language alternative text for each variant (which is kept in xcart_product_options_lng table.).
This is difficult to do as one change in a choice of the number of variants or options for a product and the Variant ID &/ or Option ID and these codes change their ID number (basically delete say white as a colour option and the Variant IDs are all renumbered automatically).
Basically the result is a nightmare for running variants in Multiple languages.
I could however see how your 1 to 1 relationship would make this much, much easier to run and import the information for.
I think you should also be able to have it such that Option1 becomes one table (option language text another) and Option1 sub-table gives the variant items for that option (and option subtable language text is in another table)
Then you link the option tables similar to how you have done.
What we have done in the past is bypass X-Cart variants and coded for set options (which in turn take their values from language tags we have added e.g. all lbl_z_option1_ items link back into the option1 table... so updating a language tag version of option language variant basically gives a global change... the option is then linked to that option table.
Cheers, Asiaplay
PM me if you want to chat more on yahoo or skype on this.
__________________
X-Cart Gold version 4.1.9
(plus built in X-Cart bugs!)
|