Show Sale product on category view page Magento

Show Sale product on category view page Magento

September 5, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Show Sale product on category view page Magento

Displaying Sale Products on Category View Page in Magento

As an experienced e-commerce developer, I often hear this question from merchants who want to showcase their current sale offerings prominently within the category pages of their Magento store.

Let’s dive into how you can achieve this efficiently using native Magento functionality and some custom code snippets.

Step 1: Enabling the Catalog Price Rules

Before anything else, ensure that your special price rules are set up correctly. Go to Marketing > Promotions in your admin panel, then click on Catalog Price Rules. Here you can create or manage special prices for specific products or groups of products.

Step 2: Using Magento’s Layered Navigation

Magento provides a built-in layered navigation feature that allows customers to filter products by price range. To enable this:

  1. Go to Stores > Configuration > Catalog.
  2. Under the Catalog section, click on Layered Navigation.
  3. Set Enable Price Range Filter to Yes.

Now when your customers visit a category page, they’ll see a price slider that allows them to filter products by their special prices.

Step 3: Customizing the Category View with PHP

Sometimes you may need more control over which sale items are displayed. For this, we can use custom PHP code to query for products with special prices within the specified category or its sub-categories.

Here’s a simple example of how you might do this:

<?php
$category = Mage::getModel('catalog/category')->load(123); // Replace 123 with your category ID

$saleProducts = array();
foreach($category->getProductCollection() as $product) {
    if ($product->getData('special_price') != "0.0000") {
        $saleProducts[] = $product;
    }
}

This code loads the specified category and then loops through its product collection to find products with a non-zero special price.

Step 4: Displaying Sale Products on the Category View Page

To actually display these sale products on your category view page, you can add the following code within the appropriate category template file (usually template/catalog/category/view.phtml):

<?php foreach($saleProducts as $product): ?>
    <div class="category-product">
        <?php // Display product image, name, price, etc. ?>
    </div>
<?php endforeach; ?>

Conclusion

Displaying sale products on your category view pages is a powerful way to engage customers and drive conversions.

By combining Magento’s built-in layered navigation with some custom PHP code for targeted selection of sale items, you can create an optimized shopping experience that highlights your special offers effectively.

Remember that proper template overriding practices are essential to ensure that your changes remain intact even after Magento updates. Always refer to the official Magento documentation and consider using a development environment before implementing these changes on your live site.

If you’re looking for professional assistance with customizing your Magento store or optimizing your e-commerce performance, don’t hesitate to reach out to our team at Laravel Company. We specialize in delivering high-quality solutions tailored to your specific business needs.

Catalog Database Admin Configuration

Our network