Jump to content

[Resolved] Categories IDs in multi languages


Recommended Posts

Hi, Prestashop Members,

 

I have a question related to categories import in 1.6.0.11.

 

I'd like to import categories in multi languages, say English and French.

 

The categories structure is defined as below:

 

*Home (Category ID 2)

    *Cosmetics (SubCategory ID 3)

          - subsubcategoryA (ID 10)

          - subsubcategoryB (ID 11)

          - subsubcategoryC (ID 12)

          - .....

 

* Accueil (Category ID 2)

    * Cosmétiques (SubCategory ID 3)

           - sousouscatégorieA (ID 10)

           - sousouscatégorieB (ID 11)

           - sousouscatégorieC (ID 12)

           - .....

 

The problem is after importing categories in 2 languages, I got both "Cosmetics"(ID 3) and "Cosmétiques (ID 4)" as new category in ps_category_lang table, 

 

+-------------+---------+---------+-------------+
| id_category | id_shop | id_lang | name        |
+-------------+---------+---------+-------------+
| 47                | 1           | 1       | Cosmétique |
| 47                | 1           | 2       | Cosmétique |
| 47                | 1           | 4       | Cosmétique |
| 56                | 1           | 1       | Cosmetics   |
| 56                | 1           | 2       | Cosmetics   |
| 56                | 1           | 4       | Cosmetics   |
+-------------+---------+---------+-------------+

 

What's expected should be

+-------------+---------+---------+-------------+
| id_category | id_shop | id_lang | name        |
+-------------+---------+---------+-------------+
| 47                | 1           | 1       | Cosmetics   |
| 47                | 1           | 2       | Cosmétique |
| 47                | 1           | 4       | Cosméticos |
+-------------+---------+---------+-------------+
 
In my csv file, say category_en.csv and category_fr.csv, both ID column have been set. like
EN
+-------------+------------+------------+-------------+
| ID                | Active(0/1)| Name        | Parent       |
+-------------+------------+------------+-------------+
| 3                  | 1              | Cosmetics | Home        |
| 4                  | 1              | xxxx           | Home        |
| 5                  | 1              | xxxxx         | Home        |
+-------------+------------+-------------+-------------------+
 

FR

+-------------+------------+--------------+-------------+
| ID                | Active(0/1)| Name          | Parent        |
+-------------+------------+--------------+-------------+
| 3                  | 1              | Cosmetique | Accueil        |
| 4                  | 1              | xxxx             | Accueil        |
| 5                  | 1              | xxxxx           | Accueil        |
+-------------+------------+--------------+--------------+

 

 

PS: This 2 csv file works when they are imported in shop combined with sample data, the sample data will just be overridden in case of same category ids, however, it seems no longer work after wiping out all sample data, importing categories from scratch.

 

Any one has a suggestion ?

 

Thanks in advance.

 

Best Regards

Edited by xiparos (see edit history)
Link to comment
Share on other sites

OK, it's been resolved. My bad...

 

I should turn on the option : Force all ID numbers

 

This will force id numbers as-is in tables, otherwise ps will generate auto-incremented ID for each imported category.

 

For anyone who encountered the same problem.

 

Topic marked as Resolved.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...