I have subcategory. I want move copy of it to another category. I do following

    $copy = clone $category;
    $copy->setId(null) // Remove the ID.

This works, but new category have same name for each store. I have 5 stores with different languages. So category I want to copy have different name for each store.

Any ideas how to copy categories with different names for each store?


Since I've accepted answer I've occurred issue - names weren't save correct for all stores. So I suggest use just

$copy = Mage::getModel('catalog/category');


$copy = clone $category;

1 Answer 1


Try this, you have to assign the value different category name based on different store Id's

$allStores = Mage::app()->getStores();
$parentCategory = Mage::getModel('catalog/category')->load(5);
$parentCategoryId = $parentCategory->getId();
$category = Mage::getModel('catalog/category')->load(8); // The ID of the category you want to copy.
$copy = clone $category;
foreach ($allStores as $_eachStoreId => $val) 
        $storecategory = Mage::getModel('catalog/category')->setStoreId($_eachStoreId)->load(8);// The ID of the category you want to copy.
  • i have updated the code... Jan 29, 2016 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.