How to ADD product to multiple categories?

You did save it as a .php file, right? And navigate to it on a server (i.e.

I’ve zipped up the file and attached it. This might help a bit.

[quote name=‘Lyn’]It seems to me you don’t actually want ten products but just the one product in ten different categories, in which case you have the one main category and all the other nine categories should be listed under the Secondary Categories heading in your .csv.

I suggest you create a test product - add it to one of your main categories. Under the Secondary Categories section, click on “Add Categories” and tick the boxes of all the other categories you want to list this one product in.

Then export that product to a .csv file. This will give you the layout for the Secondary Categories (in Version 1.3.5 they are just separated by semi-colons but I’m not sure about Version 2). Then you can create your .csv file for all the other products and import it.

If you only want the one product in different categories, this is the way to do it and, once you get the hang of it, it should be fairly quick.

That way any changes you make to the one product will be updated in all your categories as you are only working with one product, not ten.

You can have as many secondary categories as you want to.

Hope this is what you are after.[/QUOTE]

This is exactly what i want to do, i know how to set up the secondary categories in both admin and csv import, but i don’t have the time to manually go through my csv and edit all products in that way, and i can’t change the csv layout in that way that the secondary categories would come on one row with just one product code each, i can’t modify my csv so it puts product code only one time per product in the csv, same product appears on many rows in csv. Thats why i’d want to have cs-cart modified that it could add/update the product everytime it changes category in the import/export feature. It’s difficult to explain when my english isn’t so good.

[quote name=‘gginorio’]You did save it as a .php file, right? And navigate to it on a server (i.e.

I’ve zipped up the file and attached it. This might help a bit.[/QUOTE]

I tested the file you provided, it gives an warning: Parse error: syntax error, unexpected ‘=’ in /var/www/vhosts/test/httpdocs/new folder/csv.php on line 25

Here is an example of .csv that i get from supplier, if somebody wants to take a look at it.


Thank You Lyn,

I tried your above idea and it worked just fine with CS cart 2.2.2 version.

I created on Admin side these categories:

Main Category

  • subcategory_1
  • subcategory_2
  • subcategory_3

    I created one product:

    SKU: aaa-product-code linked to 3 above categories.

    I exported only 3 columns:

    Product code, Category and Secondary categories

    on category showed up: Main Category///subcategory_1

    on Secondary categories showed up: Main Category///subcategory_2; Main Category///subcategory_3

    so are divided by semicolon.

    Actually I exported and imported using comma and works just fine.

    I didn't try export/import by semicolon, sorry.

    Thank you and I hope this helps a little on your ongoing job.

    [color=#696969]From Albanian Team[/color]