magento set subcategory as rootcategory - magento

I have 1 magento installation with 2 websites. i want to set a subcategory from website 1 as rootcategory of website 2.
and i don't know the id of the category, because this is local and has to work on production with other categories. So i can't set the id of the wanted category in code.
it must be adjustable in the backend.
in system->manage stores-> select a store
here you can set the rootcategory but there are no subcategories available.
is the only solution to build a module to select the id of the category?

copy
app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php
to
app/code/local/Mage/Catalog/Model/Resource/Category/Collection.php
update around line 414
$this->addLevelFilter(1);
to
$this->addLevelFilter(2);
What this will do is when you go into System -> Manage Stores and click on the Store Name.
It lets you set the Root Category. This dropdown will now not only display the root categories but also the level 2 categories. It's perfectly fine to use a subcategory as the root category in a certain store.
This is really beneficial if you're running a corporate site and then a bunch of branded sub-sites but you don't want to manage a million different duplicate categories.

I understand what it is you're trying to do but not why. Are you trying to display specific categories for each Store View? You don't have to worry about Root Category to solve this.
I'll assume you're using a newer version of Magento Community Edition 1.5+.
Leave the category for both Store Views set to the same Root Category
(default is Default Category)
Go to Catalog > Manage Categories.
For each website you will need to enable/disable each subcategory to
build a custom catalog from the Root Category.
Above the category listings you can switch which Store View you need to customize. Leave this set as "All Store Views" and customize which subcategories you want or don't want for Website 1.
To do this just click on the specific category > General Information tab and set the Is Active to Yes or No. Disabled categories will grey out.
Once completed switch to the Store View of the other website "Website 2" and select a category that will be different than the default.
Now, to the right of the various fields you will see a checkbox (checked by default) labeled Use Default Value.
Uncheck the Use Default Value checkbox beside the Is Active field and toggle it to yes/no.
Save Category.
Now when you view each store you will see that the catalog is different.
Does this solve your issue?

Related

How to display category in category tree as disable in magento

We are developing a module in magento to display categories to customers on front. These categories will be shown in tree structure as same as displayed in product edit form in admin panel.
So, to implement this, we have followed the same logic as followed on product edit form in admin panel and able to display all categories in same way as displaying in product edit form.
Now, we want to disable few categories in this tree structure on the basis of category ids which will be select by admin in admin panel. So that customer could not check/uncheck these categories but see in disabled mode.
We have tried many logics and then searched a lot to know, how can be disable categories in category tree on the basis of category ids but nothing found?
Can anyone help us to how can be resolve this problem?
Waiting for solution

Issue with Magento Categories

I am having issues arranging the categories in magento. The system has more than 3000 categories. There are 4 level categories which means: Parent>Level1>Level2>Level3>Level4.
All the products are sitting in level4 categories and level1,2 and 3 are just empty.
What I am trying to do is under level2 display its sub categories using a static block and then under level 3 display the categories from level 4.
2nd issue is I dont want to show all the categories in the main menu bar as loading 3000 categories will kill the server.
I want to do something similar to this: http://www.staples.ca/ENG/Catalog/cat_super.asp?catids=%2C&name=CA_SU_Office+Supplies
Here is the link for the site: bindersnink(dot)ca
From what I can see in the Staples link you added, they only show top level categories on their main menu nav bar. You can do this in your Magento store by simply changing a configuration value. Just login to your backend, go to System > Configuration and click on the Catalog > Catalog section in the left panel. On that page you will see a section called Category Top Navigation. Change the Maximal Depth to 1. This way only your top level categories will show up in the menu.
Just note that if you want all products in child categories to display on the top level category page, you will need to go to the edit category page, go to the Display Settings tab, and make sure that Is Anchor is set to yes.

Magento category page displays no products

When I view a category page (ie. url.com/category.html) the page shows the category title, description but no products. Doesn't seem to be loading them since I get this message "There are no products matching the selection."
The products are enabled, visible in catalog & search, have quantity and are in stock and product categories are listed under a root category called "Default Category". I have a featured products listed on the home page by category ID which display fine and individual product detail pages display as they should as well.
I have tried refreshing cache/indexes and searching Google all to no avail. I thought it may be an issue caused by a customization I made to the theme but switching to the default theme made no change so it would seem I must be missing something in the product or category configurations.
Possibly related? – searching always returns no results even if by product name
I am using magento ver 1.5.1
Please check following settings are done for your product
The products must be Visible in Catalog.
The products must be Enabled.
Product must have a stock Quantity.
The product must be set to In Stock.
If the product is set not to track stock, it still need to have a stock Quantity and be set to In Stock.
The product must be assigned to the target Category.
If using multi-website mode (or if you imported the products through Data Flow), the products must be assigned to the target Website.
You must refresh your “var/Cache” & rebuild all indexes from admin > system > index management
Hope this helps you.
Next time if you have same problem you can try two things:
1 - Reindex catalog and products
2 - Check user permissions
If you move your database from one server to another or you restore the database you might want to check the customer_group table. More specifically you should check the "NOT LOGGED IN" records and its ID, it should be "0" if it is not the products won't be visible for that group of users which is pretty much all users on most Magento shops.
How many attributes do you have? Too many attributes marked as "Visible on product listing page" can break the indexes. Are there records in the catalog_product_flat_* table(s)?
OK after I looked up the records and replaced my theme's list.phtml file with the default one (for about the 100th time) products started displaying. Not sure what changed but as long as they continue to display I'm happy.

Different product image per category in Magento

I have a large store with many products showing in multiple categories.
Inside each of these categories the product has a different use, so I would like to show a different image.
I would use a bundle / grouped product however the default simple product has custom options.
Any PHP or set up suggestions would be appreciated.
A clean implementation would be to add a new attribute to the media/gallery functionality (akin to label/sort-order).
Then you would add a drop-down category selector to the grid view on the "Manage Product > Edit Product > Images" tab.
Then from there, you could extend the standard collection for category/search to select your image with corresponding category ID (instead of the default selected thumbnail).
But you certainly are not going to find a 1-liner to pull this off (cleanly).

Magento: Different products in the different store views under the same store?

I have multi website, multi stored Magento shop, and I have a need to make some products available in one store_view, but not available in the other, where both store_views are part of the same store and website.
All my products are configurable with simple products attached to them. Only way I could think of solving this is registering a new product attribute through which I control where each product goes. That works great for the catalog and lists of products, but I have huge problems with single product view and choosing the configurable product options.
I can't seem to find where in Magento core those option are generated, so I could override that and strict some options for each store view. Basically, I need to know where is this
generated. My last resort would be managing this through AJAX, but there is already a lot of AJAX code and calls in that page that it would be confusing.
Any help or tip would be very appreciated.
I am pretty sure that the way above is not working because the attribute enable/disable product has impact at website level and not store or store view!
So if you do like tomakun says the product will be disabled at the whole website and not just for the store view you choose first!
I have the same problem that I want to assign different products all to one website but to different stores.
So far I just found the solution above to change the visibility at store view level.
But I think this not the optimal solution. It should be possible to disable a product on store level!
This feature is already available by default in Magento.
For bulk enabling/disabling products for a particular store view, do the following:
Go to your Catalog > Products
Select a store view above the product list.
You are now viewing all products included in THIS store view.
Once you have the correct store view selected, select the products you want to Enable or Disable using the checkbox on the left.
Now, using the Actions dropdown menu on top right of the product list, choose 'Change Status', select 'Disabled' or 'Enabled' and hit the Submit button.
Doing this will Enable or Disable the selected products from the selected store view (step 2). This is good for bulk actions but you can also do the same for all products one by one:
Open your product, select the relevant store view on top left of the page. Then in the General Tab, you have status: Enabled or Disabled. Choose the option that you want to apply for the current store view and hit Save.
That's it!

Resources