2

I have a magento multi-store configuration. One website, with multiple stores, on different subdomains. I'm having an issue with a single product assigned to one store view having multiple urls.

My configuration is as follows:

  • Store 1 (website, store and view)

    -- example.com

  • Store 2 (store, using above website)

    -- store2.example.com (view for store2)

  • Store 3 (store, using above website)

    -- store3.example.com (view for store3)

The issue is, I can go to three different urls for the same product:

  • example.com/test-product.html
  • store2.example.com/test-product.html
  • store3.example.com/test-product.html

"Test Product", is assigned to Catagory1 and Catagory1 is assigned to store2 view.

Why is it that I can go to each of these urls and return the same product. When I do a site search, I want the product to be found, but when clicked, go to store2.example.com/test-product.html no matter what site the user is currently on.

Simply put, I want to:

  1. Prevent the same product from having multiple urls (especially considering it should only be available in one store)

  2. Search across all store but then point the product to the store it's assigned to.

I'm using Magento 1.8.

  • Assuming these are country based (the most common), it's the simple problem of Magento not supporting multi-country single-tld (Saks, Selfridges). Sub-domain is Google friendly but not visitor friendly, sub-directories are visitor friendly not Google friendly, multi-national companies use neither. To separate products you need websites & products assigned (already posted), search is store specific but will not solve the multi-store problem, it is a fundamental issue with Magento. We use multi-country single-tld with CE/EE but it is part of an enterprise class architecture so not suitable. – user2935 Feb 27 '14 at 1:58
1

On the no duplicate URL part you can dis- and enable products on website level by going to the BE > Catalog > Manage products and then in a product the Website tab and select the website you want.

Optionally if you only want to show the product on only one website but make it searchable on all make sure the product is assigned to all websites but set the visibility of the product to search only for all shops but one.

Now having them redirect from all shops search results to just one url will require you to hack that into the search result page and quite frankly that will be quite an undertaking. I'm no SEO expert but it might be better to just use a canonical tag for this to make sure Google indexes the right domain and url.

[UPDATE] I took a quick look and it seems that the search results are filtered by store ID from the Mage_CatalogSearch_ResultController controller (line 49) so commenting that out would give you all the products from all the stores. However, you might run into issues with URL's not being displayed right or any other property that is store level dependent.

  • In BE > Catalog > Manage products > website I can only select the parent website store1 (example.com). Selecting store2 is not available as it's a child of store1 with no checkbox available to it. Any idea why? – user3482 Oct 7 '13 at 15:32
  • ah sorry, I thought you had multiple websites :) but you just have one. Then I would use the visibility to make the changes – Sander Mangel Oct 7 '13 at 15:35
  • Yeah, I changed the visibility per your recommendation and refreshed the cache - I can still go to the different urls to return the same product even though the product is only assigned to store2. – user3482 Oct 7 '13 at 15:55
  • Do you happen to have any 3th party extensions installed that might cause this? Also, try and refresh the indexes between changes just to be sure – Sander Mangel Oct 7 '13 at 16:45
  • No, this is a base magento test site with only domain/store setting changes. I have no extensions installed. I cleared indexes and caches but no change to the issue. – user3482 Oct 7 '13 at 17:01
0

A good practice is to set 1 different Root category for every stores (that you affect to a website) so you can put specific products to the specific Root categories.
Like that once you create a product you select the Root category you want so you don't have to change the store for each product but just put them in the correct category.

Root Computer Website
  |_ CPU
  |_ Monitors
  |_ Graphic Cards
Root Phone Website
  |_ LG
  |_ HTC
  |_ Samsung
Root Furniture Website
  |_ Chairs
  |_ Tables
  |_ Kitchen

[UPDATE] Like @Sander Mangel I thought you had multiple websites. You shouldn't create subdomains you will face plenty of problems in the future. Creating 1 website per subdomains is highly recommended and very easy to setup.

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.