1

I have 1 default store view in danish and 2 additional store views in english, one of which I have just created. This new english store view is (obviously) using my names, descriptions and urls for the categories from the default danish store view.

However, I would like to change all categories in this store view to use the information from the same categories in my existing english store view.

So - how can I make one store view's categories use information from another store view instead of the default?

1

Unfortunately you can't. Copying data only works with direct parents.

One option would be to place the English store view under a separate store under Manage Stores and assign it the same category tree as the other English store view.

However, this only works if you're already using different category trees for different stores with the translations on the global level.

[EDIT] Another option would be to do it via an import. Either use FastSimpleImport (https://github.com/avstudnitz/AvS_FastSimpleImport) that supports category data imports or write a basic script.

Mage::app()->setCurrentStore($storeIdFromWhereToCopy);
$collection = Mage::getResourceModel('catalog/category_collection')
  ->addFieldToSelect(array('name', 'description', etc...));

$category = Mage::getModel('catalog/category')->setStoreId($storeIdToCopyTo);
foreach ($collection as $item) {
   $category->setName($item->getName());
   $category->setDescription($item->getDescription());
   [...etc...]
   $category->save();
}

Before you run scripts and imports like this always remember to make a backup

7
  • The two mentioned stores are on different websites. I guess that rules out this possibility? – user2806026 Sep 15 '15 at 9:26
  • nope, root category is set on store level so as long as you use a store per storeview you can just set any root category you want – Sander Mangel Sep 15 '15 at 9:29
  • Okay. I'm not sure I completely understand your suggestion though. I am using the same categories for all stores, just with different translations. – user2806026 Sep 15 '15 at 9:30
  • Ah, in that case my suggestion wouldn't fly. It requires that you use a different category tree and set the translations on global level – Sander Mangel Sep 15 '15 at 9:33
  • Okay. So basically I have to do it manually? I can't neither use an export/import or an iterative script? – user2806026 Sep 15 '15 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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