cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to assign different categories to the same product, by Store View?

Is it possible to assign different categories to the same product, by Store View?

Hi, everyone.

 

I have a little problem, and I hope you can help me. Suppose I have a Site that has two Websites: Website1 and Website2. Respectively each has its StoreView1 and StoreView2:

 
--Website1
----StoreView1
--Website2
----StoreView2

And I haven the next Category structure:

 

--Default Category
----Shoes
----Outlet
------Shoes

 

So, if a Product is Shoes, It should be assigned to Category Shoes. In additional, if the product is Outlet, It should be assigned to Outlet > Shoes. But, a product can be Outlet in StoreView1 but not in StoreView2. So, I need that the product in StoreView1 to be assigned to Shoes and Outlet > Shoes, but in StoreView2 to be assigned only to Shoes.

But, when I try it:

 

$product = Mage::getModel('catalog/product')->setStoreId(<id of StoreView1>)->load(<Product Id>);
$product->setCategoryIds(array(<Shoes id>, <Outlet > Shoes Id>)->save();

$product = Mage::getModel('catalog/product')->setStoreId(<id of StoreView2>)->load(<Product Id>);
$product->setCategoryIds(array(<Shoes id>)->save();

 

The product always take the last categories I assigned. In other words, it assigns the categories to all stores equally, instead of assigning per store. I tried in Admin, changing product categories, positioned on the scope of the store view, but also the change is reflected in the other store view too. Are product categories always global? Is there no way to assign them for Store View?

 

Thanks for the help.

1 REPLY 1

Re: Is it possible to assign different categories to the same product, by Store View?

category-product links are global, however, category is in store view scope you can create 2 shoes and 2 outlet for store 1 &2, disable one set of categories in store view 1 and the other set in store view2, then assign different products to different categories