Skip to content
Back to Articles

Category Mapping for PrestaShop imports: stop trusting supplier category names

Supplier feeds & catalogue normalization
DATA MAP
SOURCE
Men > Tops > Casual Shirts

NORMALIZE

MAP

id_category = 42
Import & Export
Beginner → Intermediate
PrestaHacks 2 min read

Your supplier writes Men > Tops > Casual Shirts. Your shop has MEN > SHIRTS.

If you import the supplier taxonomy as-is, you did not build an integration. You imported the supplier's catalogue chaos into your own.

1. Source taxonomy is not shop taxonomy

TEXT
SUPPLIER CATEGORY
       ↓
NORMALIZE
       ↓
MAP
       ↓
PRESTASHOP CATEGORY

2. Mapping table

Source PrestaShop ID Category
Men/Tops/Shirts 24 Shirts
Men/Bottoms/Cargo 31 Cargo
Accessories/Bags 44 Bags

The stable target is often id_category.

3. Why IDs?

Names change, can be translated and may be duplicated.

4. Category dataset

SQL
SELECT
    c.id_category,
    c.id_parent,
    c.active,
    cl.name
FROM ps_category c
INNER JOIN ps_category_lang cl
    ON cl.id_category = c.id_category
    AND cl.id_lang = 1
    AND cl.id_shop = 1
ORDER BY c.id_parent, c.position;

5. Normalize source values

Different supplier strings such as MEN > SHIRTS, Men/Shirts and Mens > Shirts can normalize to a single key:

TEXT
MEN_SHIRTS → id_category 24

6. Unknown-category policy

TEXT
KNOWN → map
UNKNOWN → quarantine / review

Do not automatically create a new shop category for every new supplier label.

7. Google Sheets workflow

Use separate tabs for RAW_PRODUCTS, CATEGORY_MAPPING, READY_FOR_IMPORT and UNMAPPED.

8. Multiple categories

Define a business rule for Default category versus Additional categories.

Production workflow

TEXT
SUPPLIER FILE
      ↓
RAW
      ↓
NORMALIZE
      ↓
MAP
      ↓
FLAG UNKNOWN
      ↓
HUMAN REVIEW
      ↓
READY
      ↓
IMPORT

Mapping is not cleanup. It is the business rule that translates a third party's catalogue into the structure of your own shop.

What to do next

Place the mapping table inside the supplier-feed transformation pipeline, with an explicit UNMAPPED review state. Then validate the resolved category identifiers in a small CSV product import before processing the full feed.

STAY TUNED

Get practical PrestaShop hacks in your inbox.

INACTIVE