I have problems with URLs and search in multistore environment. This is seo thing too, I think, but it would be nice to know how this is meant to be in Magento and can I repair this somehow.
First, question about how things SHOULD go in Magento:
I make a quick search in store x in my multistore environment, . Let’s play that my search term would get hits from all stores I have.
What kind of results should I have?
-products from store x where I made search?
-products from all stores?
My situation right now is that I have products from all stores as search results. It would be good, but there’s problem. URLs are pointing to that store where I make the search. This is seo problem. It’s like products are moving from store to another!
In Magento Demo Store it seems that search returns only products from the store you make the search. It’s ok since the URLs are pointing to that store only. Though it would be nicer if I could have products from all stores and URLs pointing to right store.
My main question is:
- Is my store configuration right because it seems that all my products are in every store? I tested it by using getStoreIds() function from app/code/core/Mage/Catalog/Model/Product.php to product and I got all store ids. I guess it should not be like that?
I’m really stuck because I don’t know how this should work.
just a quick unverified answer, but maybe it will help.
Afaik the search is within all stores within the current website.
Attached is a very small extension that forces products to have a category path.
If none is set, the first assigned category is used. maybe that helps you, I’m not sure if it will.
If it doesn’t, you might be able to use it as a basis to set the current store, too.
As I said, I didn’t take the time to reproduce your problem.
I tested your extension, and I noticed that urls are messy when I make search (like this: store/catalog/product/view/id/1349/s/someproduct/category/4/). Also recentyly added have those urls too. Recently viewed doesn’t have category at all in it’s url. Do I have some misconfigurations, any ideas? I would like to hear should this extension put category to every product url?
I’m not sure if my first post was clear enough, but I’m looking some solution that could find in which store the product really is and make urls pointing to that store. I just don’t know which would be good way to do this since now it seems that all products in a website are in all stores. With root category assigned to some store sites look ok, products will show in right stores. But in search, something is causing bad urls like bookstore/leather-shoe.html though it should point to shoestore/leather-shoe.html. I guess this is meant to be like that (?), but it’s senseless if so.
This extension does not solve my problem, but could be for help still, thanks for sharing!