Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 10 of 12
Export & import categories
 
Abdulkawi
Jr. Member
 
Total Posts:  15
Joined:  2010-04-08
 

Fatal error</b>: Call to a member function getName() on a non-object in <b>.../Category.php</b> on line <b>71

any reason why im getting this error?

using v1.4.0.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
muzafar
Member
 
Avatar
Total Posts:  60
Joined:  2009-03-28
Lahore
 

hi ,

im using this script for importing categories :

http://www.sonassi.com/knowledge-base/quick-script-batch-create-magento-categories/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anthony G O'Connell
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2009-09-12
Bangkok, Thailand
 

The script above works like a charm on Magento 1.4.1.1.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
herve@wsa
Member
 
Avatar
Total Posts:  48
Joined:  2008-07-22
United Kingdom
 

$category Mage::getModel(\'catalog/category\')
                ->
setStoreId($store->getId())
                ->
setPath($path)
                ->
setDescription($importData[\'description\'])
                ->
setName($importData[\'name\'])
                ->
setIsActive($importData[\'is_active\'])
                ->
setIsAnchor($importData[\'is_anchor\'])
                ->
setDisplayMode($dispMode)
                ->
setMetaTitle($importData[\'meta_title\'])
                ->
setMetaKeywords($importData[\'meta_keywords\'])
                ->
setMetaDescription($importData[\'meta_description\'])
                ->
setIncludeInMenu($importData[\'include_in_menu\'])
                ->
save();

saves all the fields apart image

 
Magento Community Magento Community
Magento Community
Magento Community
 
zuiko
Guru
 
Avatar
Total Posts:  304
Joined:  2009-02-06
Nantes France
 

I think that the script included in this thread is more versatile because you can create or modify categories with all informations and for each store view (you can translate page_title, description, meta_keywords, url_key etc… directly in the CSV file containing informations to create or modify).
But there is a bug for multistore configuration, because a category identifier is considered as unique in the categories tree and it’s not the case in a multistore configuration where the categories trees are independant from the root category of each store.
I have some difficulties to find the fix to that bug. If somebody could help…

 
Magento Community Magento Community
Magento Community
Magento Community
 
sep_12a
Jr. Member
 
Total Posts:  2
Joined:  2010-08-16
 

Thank you Santhosh very much !!!!  Your script is amazing. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
bournemouthboy
Jr. Member
 
Total Posts:  2
Joined:  2010-09-01
 

Hi

I currently use a site in Magento version 1.3.2.3

I exported all products using the export function, as suggested on this forum by using the XML option instead of CSV if you were experiencing trouble with CVS version.  The export contains lots of styling script in the “descriptions” column which I presumed was magento WYSIWYG styling, I made my change to the xml file (just some stock levels) and re imported it......  Now all the descriptions have the code visible in both the front end of the site and the back end WYSIWYG editor.

To view front end example click here: http://snowboards.alfatestweb.com/clearance-items/jumpboard-all-terrain-mens-skateboard.html

I can’t understand how this has got here and I am unable to remove it without doing this manually to 500+ products.

Can anyone help?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
dansjhall
Jr. Member
 
Total Posts:  15
Joined:  2010-08-02
 

Please HELP!!!!

I have tried every suggestion on how to get around this error but I cannot do it? Any advice??

* Starting profile execution, please wait…
* Warning: Please do not close the window during importing/exporting data

* Starting Mage_Dataflow_Model_Convert_Adapter_Io :: load
* Loaded successfully: “/home/mastersu/public_html/magento-1.4.1.1/magento/var/import/Categories.csv”.
* Starting Mage_Dataflow_Model_Convert_Parser_Csv :: parse
* Found 2 rows.
* Starting catalog/convert_adapter_category :: parse
* <br /> <b>Fatal error</b>: Call to undefined method ImpCat_Catalog_Model_Convert_Adapter_Category::getStoreById() in <b>/home/mastersu/public_html/magento-1.4.1.1/magento/app/code/local/ImpCat/Catalog/Model/Convert/Adapter/Category.php</b> on line <b>42</b><br />
* <br /> <b>Fatal error</b>: Call to undefined method ImpCat_Catalog_Model_Convert_Adapter_Category::getStoreById() in <b>/home/mastersu/public_html/magento-1.4.1.1/magento/app/code/local/ImpCat/Catalog/Model/Convert/Adapter/Category.php</b> on line <b>42</b><br />
* Processed 0% 0/2 records
* Imported 0 records
* Finished profile execution.

Thanks in advance for you help, im really going nuts tryign to figure this one out!

Danny

 
Magento Community Magento Community
Magento Community
Magento Community
 
zuiko
Guru
 
Avatar
Total Posts:  304
Joined:  2009-02-06
Nantes France
 

Finaly, the script included in this thread is well usable if you manage correctly the constraints associated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LLyaudet
Jr. Member
 
Total Posts:  2
Joined:  2010-07-30
 

If you want to have the same IDs in your csv and in Magento, and/or use names with UTF8, you can replace the saveRow function in Santhosh’s module with the following:

public function saveRow(array $importData)
    
{
    $categorie 
$importData['categories'];
        
    
//on construit le chemin
    
if ($importData['id_parent']==0{
       $path 
'1/';
       
$level 1;
    
}
    
else {
    $catpar 
Mage::getModel('catalog/category')
                ->
load($importData['id_parent']);
    
$catparPath $catpar->getPath();
    
$path $catparPath.'/'.$importData['id'];    
    
$level $catpar->getLevel();
        
$level++;
    
}
               $dispMode 
$this->_displayModes[2];
        
                
$cat Mage::getModel('catalog/category')
            ->
setPath($path)
                    ->
setName($categorie)
                    ->
setIsActive(1)
                    ->
setIsAnchor(1)
                    ->
setDisplayMode($dispMode)
            ->
setId($importData['id'])
            ->
setParentId($importData['id_parent'])
            ->
setLevel($level)
            ->
setAttributeSetId(3)
                    ->
save();

        return 
true;
    
}

Make sure that your csv file has at least three columns named “categories”, “id”, and “id_parent”, AND that no category is listed in the csv before its parent.
EDIT: I forgot to add that “categories” should only contain the name of the category, not the path with all ancestors.
 
Magento Community Magento Community
Magento Community
Magento Community
 
biltoy
Jr. Member
 
Total Posts:  5
Joined:  2008-09-22
 
Charles @ MJM - 16 June 2010 03:07 PM

Grut - 15 June 2010 05:52 AM
Hi there,

Did I mentioned about convinient “Import/Export Wizard” of Store Manager for Magento in this thread? wink

I would give it a shot if the trial let me do more than just 1 product.. that’s not enough to test my needs.

I have serial key for Store Manager for Magento. I can sell it for 30$. Good sofware, but I no longer need it. Skype me “serge2520” for details.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vidhulac
Member
 
Avatar
Total Posts:  33
Joined:  2009-01-06
Bangalore
 

Hello,

i have created a new module to import categories.... please test and let me know your reviews..

import categories Module

 
Magento Community Magento Community
Magento Community
Magento Community
 
d8bhatta
Member
 
Total Posts:  44
Joined:  2009-06-11
 

@importing category

steps:
1. create a module from module creator
2. need to make some changes into config.xml, over write the adaptor category as

<catalog>
<rewrite>
<convert_adapter_category>COMPANYNAME_ImportCategory_Model_Convert_Adapter_Category</convert_adapter_category>
</rewrite>
</catalog>

3. Create a model file called category.php in COMPANYNAME_ImportCategory_Model_Convert_Adapter
4. Paste the import code mentioned above. It is assumed that you have already created advanced profile with necessary xml.
5. Clear cache i.e. layout
6. Now your advanced profile of importing category should work

 
Magento Community Magento Community
Magento Community
Magento Community
 
naumeer
Member
 
Total Posts:  36
Joined:  2010-12-02
 

i have made a profile
through xml code but i cant find this directory in my 1.4.2.0 installed magento

Put this code in the file in app/code/local/mycomp/Catelog/Model/Convert/Adapter/Category.php

Please help im looking to import categories since 1 week unable to do it uptill now =[

 
Magento Community Magento Community
Magento Community
Magento Community
 
sepp
Sr. Member
 
Avatar
Total Posts:  120
Joined:  2008-06-14
Hamburg
 

santhosh have post an extension for it.
it works for me in 1.4.2.0 absolutely correct.

Import-Export Catergory

Super work thanks to Santhosh

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 10 of 12