Opencart extensions free download · 4 min read · Updated

Featured Categories for OpenCart 4: A “Shop by Category” Block With Images on Any Layout (Free Extension)

A free OpenCart 4 extension that shows the categories you choose as image cards on any layout, multi-instance like the core Featured module, responsive and store-aware. The OpenCart 4 version of our OpenCart 3 Featured Categories module.

Opencart 4 featured categories module

OpenCart 4 has a Featured module for products, but nothing similar for categories. Yet a “Shop by category” row of images is one of the most useful blocks on a home page: it gets shoppers into the right part of the catalog in one tap, especially on phones, where the menu is hidden behind a button.

This free extension adds that block. Pick the categories, and they show as cards with the category image and name on any layout. It’s the OpenCart 4 version of our OpenCart 3 Featured Categories module, rebuilt for OpenCart 4.1.

Download Featured Categories for OpenCart 4 (free, tested on OpenCart 4.1.0.4)

Shop by category block on an OpenCart 4 home page with four category cards: Desktops, Laptops and Notebooks, Cameras, and Phones and PDAs
Four categories as image cards on the home page.

What it does

  • Cards for the categories you choose, in the order you add them, with the category image and name linking to the category page.
  • As many blocks as you like. Like OpenCart’s Featured module, it’s multi-instance: “Shop by category” on the home page, “Popular” in a column, a different set on information pages.
  • Responsive. Two cards per row on phones, three on tablets, and 2, 3, 4 or 6 per row on desktops, your choice.
  • Store-aware. Disabled categories and categories not assigned to the current store are skipped, so you can’t link shoppers to a page that doesn’t exist.
  • Images at the size you set, resized and cached by OpenCart like product images, with explicit width and height so the page doesn’t jump while loading.

Install it

  1. Download featuredcategory.ocmod.zip.
  2. Go to Extensions → Installer, upload it, and click the green +.
  3. Go to Extensions → Extensions → Modules and install Featured Categories with the green +.
  4. Click the blue + next to it to create your first block (see below).
  5. Add the block to a layout in Design → Layouts, for example Content Top of the Home layout.
OpenCart 4 Extensions Modules list showing Featured Categories with a blue add button and one module instance named Shop by category, and Testimonials with an instance named What our customers say
Each block you create appears under the extension, with its own edit and delete buttons.

Create a block

Featured Categories module settings in OpenCart 4: module name Shop by category, four chosen categories, limit 4, cards per row 4, image width and height 300, status on
The settings for one block.
SettingWhat it does
Module nameThe heading above the cards (“Shop by category”). Also the name you see in Design → Layouts.
CategoriesStart typing a name and pick it from the list, as in the Featured module. Remove one with the red button. They show in the order you add them.
LimitThe most cards to show, even if you chose more categories.
Cards per row (desktop)2, 3, 4 or 6. Phones always get two per row and tablets three.
Image width and heightThe size OpenCart resizes each category image to. Square images (300 × 300) suit most themes.

Give every featured category an image in Catalog → Categories → (category) → Image. Categories without one get OpenCart’s placeholder, which looks unfinished next to real photos. A product photo that represents the category works well.

Shop by category block on a phone with four category cards, two per row
On a 390 px phone: two cards per row.

How it’s built

The extension follows the same pattern as OpenCart 4’s own Featured module. The admin saves each block’s settings with model_setting_module->addModule('featuredcategory.featuredcategory', $data), and OpenCart passes those settings to the storefront controller when the layout includes the block:

foreach ((array)$setting['category'] as $category_id) {
    if (count($data['categories']) >= $limit) {
        break;
    }

    // getCategory() only returns enabled categories assigned to this store.
    $category_info = $this->model_catalog_category->getCategory((int)$category_id);

    if (!$category_info) {
        continue;
    }

    // ... resize the image and build the link
}

The cards use Bootstrap 5’s row-cols grid and card component, which OpenCart 4’s default theme already loads. If your theme restyles cards, the block picks that up too.

Changes from the OpenCart 3 version

  • Rebuilt for OpenCart 4’s extension folders, namespaces and AJAX save.
  • Category search uses OpenCart 4’s autocomplete, and the list shows the full path (Components > Monitors), so similar names aren’t confused.
  • New “cards per row” setting, and a responsive grid in place of the fixed Bootstrap 3 columns.
  • Disabled and other-store categories are skipped instead of showing a broken card.

Testing

TestResult
Save without a name or categories“Module name must be between 3 and 64 characters!” and “Choose at least one category!”
Category search for “Desk”, “Lapt”, “Cam”, “Phon”Each found and added in order
Block in Content Top of the Home layoutFour cards with images and names, linking to the category pages
Phone (390 px)Two cards per row

Troubleshooting

ProblemCause and fix
The block doesn’t showCheck the block’s Status, that it’s in the layout for that page (Design → Layouts), and that at least one of its categories is enabled in this store.
Grey placeholder imagesThose categories have no image. Add one in Catalog → Categories.
A category is missingIt’s disabled, not assigned to the current store, or beyond the Limit.
Rupak Nepali
Written byRupak Nepali

Rupak Nepali is a web developer, manage Webocreation website and the author of six books:
Getting Started with OpenCart Module Development (Packt, 2013),
OpenCart Theme and Module Development (Packt, 2015),
OpenCart 4: Dev Guide for Themes & Extensions (2024),
OpenCart 4: User Manual (2025),
Cloudflare for the Enterprise Website (2026) and
The Technical Web Guide for Marketers (2026).
Rupak has built OpenCart stores and extensions since 2010, has published more than 600 tutorials on Webocreation, and shares free OpenCart extensions on GitHub.
Find Rupak on
GitHub | Amazon | LinkedIn | X | YouTube.

Leave a Reply

Your email address will not be published. Required fields are marked *