Mosets Mosets Help Mosets Tree How do I import large amount of categories?
Can't find what you're looking for? Search the forum.

How do I import large amount of categories?

MT Importer currently only allows you to mass import listings. You can't import or create categories using this tool. However, if you are comfortable with MySQL, you can import categories through MySQL or phpMyAdmin. Here's a sample SQL query you can use to import one category:
INSERT INTO `jos_mt_cats` (`cat_name`, `cat_desc`, `cat_parent`, `cat_published`, `cat_approved`) VALUES ('Category Name', 'Description', 0, 1, 1);
Here's the details of the query:
  • cat_name and cat_desc is the category name and category description respectively
  • cat_parent refers to the parent category of the category that is being added. If you're adding it to the root, set this to 0. Since you need to have the cat_id before you can assign a cat_parent, you'll need to create top level categories first and work your way down from there
  • cat_published and cat_approved control the status of the category. Both should be set to 1 if you want to publish the category to front-end
Once you have done the INSERTs, login to your site's back-end and run this URL:

http://www.example.com/administrator/index2.php?option=com_mtree&task=rebuild_tree

Replace 'www.example.com' with your site's domain and path. This URL will build the 'lft' and 'rgt' column's value which is needed for use in Mosets Tree.

Copyright © 2012 Mosets. All rights reserved.