Browsing articles tagged with "category Archives - Page 2 of 2 - Kalpesh Mehta"
Jul 19, 2013

Magento products not showing in categories

If your Magento products are not showing up in frontend category pages, that can be because one or more of the below points are not done correctly.

The products must have following set correctly to appear in the category pages in frontend. You can check all the below things in Manage Products screen of any individual product.
Status must be Enabled (under General tab)
Visiblility should be Catalog OR Catalog, Search (under General tab)
– Stock Qty (quantity) should be greater than Qty for Item’s Status to Become Out of Stock (under Inventory tab)
Stock Availability must be IN STOCK
Category should be assigned (under Categories tab)
Website must be assigned (under Websites tab)

Clear the cache, re-index the indexes related to product (Product prices, Product flat data and Category products) and everything should work as expected.

This post is written to address the following issue:
magento products not displaying in categories
magento products not showing in categories
magento items not showing in categories
magento products not showing up in categories
magento products not showing under categories
magento products not displaying on category page
magento product images not showing in category
magento configurable product not showing in category
magento new product not showing in category

If you are unable to see Product Images in frontend category pages, check this blog post to resolve it:

May 10, 2013

Magento add attribute to category

Adding category attribute in Magento is same as we add for product and customer. Here in this post I will create a custom module which will add your new custom category attribute in Magento. So let’s start with the module:

1.) As usual, create an XML file in app/etc/modules/ directory, I will name it Namespace_Module.xml
Paste below code in it changing the Namespace and Module as you want.

< ?xml version="1.0"?>

2.) Second step would be to create a file config.xml in app/code/local/Namespace/Module/etc/ directory. Create all the directories required get there. Paste the below code in it making sure you have changed Namespace and Module with your naming.

< ?xml version="1.0"?>

I have only included setup class and connections as those are the only things we will need to execute our script which will insert the custom attribute to category in our Magento project.
Continue reading »

Oct 18, 2012

Magento Get most popular products in a category

Magento get most popular products in any specified category using below code, you can show them in the sidebar of product detail page to let your visitors know the popularity of the products for that category.

$category = Mage::getModel('catalog/category')->load($categoryId); 
$products = Mage::getResourceModel('reports/product_collection') 
    ->addOrderedQty() //total number of quantities ordered
    ->addAttributeToSelect('*') //get all attributes
    ->setOrder('ordered_qty', 'desc') //most ordered quantity products first

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!




Magento top 50 contributors

Magento top 50 contributors