Tag Archives: categories

How to get the newest products of magento current category

If you ever need listing the newest products of magento current category (or even of a category given by it’s Id, see the code comments) <?php $totalPerPage = ($this->show_total) ? $this->show_total : 9; $visibility = array( Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG );   … Continue reading

Posted in Categories, Products | Tagged , , | 2 Comments

Magento query filter by category and attribute

We know how to show up the products of a category in a cms page. But what if we wanna filter them by an attribute? Here is an example where $category_id is a given category ID, $currentPage the number of … Continue reading

Posted in Categories, Queries | Tagged , , , , | 3 Comments

Add featured category products to cms home page

If you have a category with products( like the featured products) you canĀ  include them in a cms page calling the template blockĀ  the following way: {{block type=”catalog/product_list” template=”catalog/product/list.phtml” category_id=”5″ column_count=”4″ }} You have to change category_id 5 for your … Continue reading

Posted in Categories, Cms | Tagged , , | Leave a comment

Magento get category subcategories

One thing we will meet for sure in magento is the category. One of the task we will need to do is the listing of child categories, the subcategories. In the following example will be listed the subcategories of a … Continue reading

Posted in Categories | Tagged , , , | Leave a comment

Magento category bestseller

The first subject I tackle is the bestseller. I will extend the exemple provided by inchoo net for the magento product bestseller. First download the code. Modify the following lines from bestseller.phtml $_productCollection = Mage::getResourceModel(’reports/product_collection’) ->addAttributeToSelect(’*') ->addOrderedQty() ->addAttributeToFilter(’visibility’, $visibility) ->setOrder(’ordered_qty’, … Continue reading

Posted in bestseller | Tagged , , , , , | 6 Comments