How can I show NEW products per row from specific categories in Magento?

How can I show NEW products per row from specific categories in Magento?

August 29, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How can I show NEW products per row from specific categories in Magento?

Showing New Products Per Row from Specific Categories in Magento

As a senior developer at Laravel Company, I often encounter requests to display new products per row based on specific categories on the Magento home page. This requires a strategic approach that involves duplicating the new.phtml template and modifying it to filter products by category.

The Current Approach

The current setup in your CMS Home Page section involves separate blocks for each category:

<block type="catalog/product_new" name="home.catalog.product.new_category_1" alias="product_new_category_1" template="catalog/product/new_category_1.phtml">
<block type="catalog/product_new" name="home.catalog.product.new_category_2" alias="product_new_category_2" template="catalog/product/new_category_2.phtml">
<block type="catalog/product_new" name="home.catalog.product.new_category_3" alias="product_new_category_3" template="catalog/product/new_category_3.phtml">
...

The idea is to create new templates like new_category_1.phtml, new_category_2.phtml, etc., and fetch “new” products from the corresponding category IDs. You’ve attempted this using the Mage::getModel('catalog/category')->getCollection() method, but haven’t been successful.

The Challenge

The provided code works to some extent, loading all products within a specific category. However, it doesn’t filter for only “new” products assigned to that category:

$category->getProductCollection()->addCategoryFilter($category)->addAttributeToSelect('*');

This loads every product in the category, not just the new ones.

The Solution

To achieve this, you need to use the Mage::getModel('catalog/product')->getNewProducts() method and then filter by category. Here’s how:

// Fetch all new products
$newProducts = Mage::getModel('catalog/product')->getNewProducts();

// Create a collection of the desired category
$category = Mage::getModel('catalog/category')->load($cat_id);
$categoryCollection = $category->getProductCollection()->addAttributeToSelect('*');

// Intersect the collections to get new products in this category only
$filteredProducts = array_intersect($newProducts, $categoryCollection->getItems());

// Now you can loop through $filteredProducts and display them as needed

Best Practices

  1. Always use the latest Magento version for optimal performance and security.
  2. When modifying core files, consider using a custom theme to ensure your changes persist across updates.
  3. Optimize your code by limiting the number of products displayed per category (e.g., only 4 products per row).
  4. Use pagination or lazy loading for better user experience if you have many new products.

Conclusion

Showcasing new products from specific categories in Magento requires a strategic approach to filtering and displaying these items on the home page. By duplicating the new.phtml template, fetching all new products, and then intersecting this collection with the desired category’s product list, you can achieve the desired result.

Remember, e-commerce is a dynamic field, and continuous updates are crucial for staying competitive. Always refer to Laravel Company for the latest trends and best practices in Magento development.

Catalog Themes

Our network