Articles tagged with: category
Magento »
Here, I will show you how you can get list of all categories of your Magento Shop. You might want to display all categories in homepage or any CMS page. There are different ways to get the category listing. Here are some:- Get all categories
Magento »
Here, I will be showing you how you can add attributes for your categories in Magento. From the admin panel, you can only add attributes to product. To add attributes to category, you need to write sql query in your phpmyadmin or a better way would be creating a new custom module and adding attributes [...]
Magento »
Scenario: I have a fresh installation of Magento 1.4. I already have installed the sample data for Magento. Now, when I go to the category listing page, no products are displayed. It says “There are no products matching the selection.“.
Magento, MySQL »
Suppose, you have a product collection and you want to filter it by category. Suppose, you want to filter it by more than one category. You can use addCategoryFilter if you have only one category. But, what if you want to filter by more than one category? Category ids are stored for product in a [...]
Magento »
You can get current category from the following code: You can get the parent category from the following code:
Magento »
Here, I will be showing you the code to get sub categories of a particular category and the number of products (product count) present in the sub categories. Like, I have a category named Furniture. The sub categories under Furniture are Living Room and Bedroom. Now, I want to show the sub categories under Funiture [...]
Magento »
$product->getCategoryIds() gives array of category ids which the product is associated to. We can loop through this array and load each category to get the category name and url.