Import / Export Categories

Hi,



Anyone knows how to import and export categories? I could find that functionality in admin menu.



Thanks

The attached file should do it for you. It is compatible with 2.x and 3.x. I thought about selling it since I had to pay to get it created, but since it doesn't seem like I have time to market it, I might as well just put it on here.



I hope it helps,



Brandon

category_imports.zip

thanks Brandon,



John

Thanks mate very usefull…

[quote name=‘brandonvd’ timestamp=‘1348585548’ post=‘145716’]

The attached file should do it for you. It is compatible with 2.x and 3.x. I thought about selling it since I had to pay to get it created, but since it doesn’t seem like I have time to market it, I might as well just put it on here.



I hope it helps,



Brandon

[/quote]



Thanks m8 it seams promising ill try it later wen i have had the chance to look true the code



Joachim






I just tested it and i must say thanks for sharing this. this should be implemented as default in cs if you ask me



thumbs up :D (no thumbs up smiley)

how can i use it ?

need help

Just upload the files and then go to Administration => Export and there will be a tab for the categories.



Thanks,



Brandon

what path do I use for the category images on the upload? I have tried everything to get the images to upload. I even selected an image for a category, exported that category, and used the same path. Everything else is working fine.

Easiest thing to do is add a test product (or category). Export it. Then you have an example of what it should look like.



David



!!GO GATORS!!

#2 in the country! Go Gators!



I did that but I could not get it to work. I can upload the pictures to the products, but not the categories for some reason.

Brandon, thanks a lot for sharing this addon and many others. I tested it for v3.x (latest) although it got the categories right, when you click on parent category on the admin panel, it doesn't show the newly imported categories.



A quick fix for this:

if the new added categories were only one level sub category (ex: Computer->Laptops):


update `cscart_categories` set timestamp = unix_timestamp(), id_path = concat(parent_id,"/",category_id) WHERE `timestamp` = 0



If the new added categories also included sub-sub category (ex: Computer->Laptops->HP)




update `cscart_categories` cs set cs.timestamp = unix_timestamp(), cs.id_path =
concat((select id_path from (select * from cscart_categories) x where x.category_id = cs.parent_id), "/", cs.category_id) WHERE `timestamp` = 0

Ahhh mazter,



Could you tell me where to put this code for the subcats ?



I looked in the file i downloaded from brandon but no idea where to put it.



Thanks for your time.



Also thank you Brandon for sharing.



Dan

Thank you mate! It' s so helpfull…

Can this script work with CS-Cart 4.x.x ? If not can someone please modify the script to work, and share it here for the community? This is a very useful feature. Thank you!

[quote name='dan4288' timestamp='1366661956' post='160454']

Ahhh mazter,



Could you tell me where to put this code for the subcats ? I looked in the file i downloaded from brandon but no idea where to put it.

Dan

[/quote]



Hi Dan, I just realized you had asked a question to me. The queries should be run in the database. You may run it through PhpMyAdmin. The categories on my site are mostly static so I used these queries when I needed to update them.

Yes, it will be great if someone can modify the script to work with current version.

Please pay attention to our Categories Export/Import module

I want add a custom field to the categories, but not to show that field on category page. it's just for myself to know which category it was on my external different database. is that possible to POST with the API a custom field to the categories?

I don't need to show it on anywhere on website, but when in future if I need to whole change categories with the API, it will be a reference for me to compare with my external different database.

I would appreciate your input, suggestions.

Thanks in advance!

Actually received data is processed by the fn_update_category function. You can use hooks in this function (app/functions/fn.catalog.php) to add custom fields to database

I don't think category data FROM the api is filtered out. If you have a matching field in the ?:categories (or ?:categories_descriptions) table the update routines should simply update your field. It should similarly be retrieved by the API. But if there's no reference to any of it in your templates, then the data won't be displayed.

eComLabs really thank you very much!

As I said before, when I finish interacting with multi-vendor completely, I will need to buy many add-on from you. as well, I will need to buy a license for the multi-vendor when I go online, I mean when lunch the website.

You are welcome! :)