Get in touch
  • OpenCart
  • Sales and conversion
  • v1.0.0

Catalog Sort Rules for OpenCart — your own product order for every category, brand and tag

A module for OpenCart 4, 3 and 2.3 that sets the default product order separately for every category, brand page and tag page: newest first in one category, cheapest first in another, bestsellers on a brand page, or a hand-made drag-and-drop order with pinned "top" products at the start. The rule applies until the shopper picks a sorting himself — his choice always wins. No core edits, no OCMOD.

Download Free
Pro · lifetime licence The more sites, the less each one costs
Compatibility
OpenCart 4.0.2 – 4.1.x (tested on 4.1.0.3 and 4.0.2.3, including DB_DRIVER=pdo) · OpenCart 3.0.x (tested on 3.0.5.0) · OpenCart 2.3.0.2 (PHP 7.0) · works with CatCode Smart Filter and Smart Search · SEO URLs · multi-store · MariaDB 10.11
Version
v1.0.0 (OpenCart 4)
v1.0.0 (OpenCart 3.x)
v1.0.0 (OpenCart 2.3)
Licence
one site, lifetime
Trial
7 days, no card, one per site
Updated
15 October 2026
Or all 173 Pro modules with All Access — 4 990 ₴ / year

What Free has,
and what Pro adds

The free version works with no time limit. Pro adds the rest of the features in the table.

Feature Free Pro
Your own default product order for every category ✔ ✔
A category rule can cover its subcategories too; one rule for all categories ✔ ✔
Orders: store default, newest, price ↑ and ↓, name A–Z and Z–A, rating, stock, model ✔ ✔
"In stock first": products with zero stock go to the end of the list ✔ ✔
The shopper's choice in "Sort By" always beats the rule ✔ ✔
Menu item Catalog → "Sort rules", an "Open on the store" button next to every rule ✔ ✔
No core edits, no OCMOD, works with SEO URLs and on several storefronts ✔ ✔
Admin in English, Ukrainian and Russian, builds for OpenCart 4.x, 3.x and 2.3 ✔ ✔
Rules for brand pages, "all brands" and tag pages — ✔
Pinned "top" products at the start of the list, up to 50 per rule — ✔
Hand-made order with drag and drop and arrows, up to 2000 products — ✔
Bestsellers over N days first — ✔
Products on sale (special price) first — ✔
Pinned products stay on top even when the shopper sorts (option) — ✔

What it looks like

OpenCart 4.1 storefront: the Desktops category with a module rule, the pinned product first
The Desktops category in an OpenCart 4.1 demo store, “Sort By” shows “Default”. The rule: the pinned Apple Cinema 30″ first, then cheapest first, products out of stock at the end. If the shopper picks another sorting, he gets exactly that.
List of sort rules in the OpenCart admin: all categories, a category, a brand, a tag
Catalog → “Sort rules” (OpenCart 4.1, Pro): the new rule form and four rules — for all categories, for the Desktops category, for the Apple brand and for the “sale” tag. Each has an “Open on the store” button.
Category rule page: order, in stock first, on sale first, subcategories, pinned products
The Desktops category rule: “Price: low to high”, “In stock first”, “On sale first” and “Also for subcategories” are on, the pinned product was found by searching its name.

The trial starts when you ask

A fresh install is the free version, nothing switches on by itself. The “Try Pro for 7 days” button → e-mail → the key right in the window and by e-mail.

One key — one site

Moving the store? Unbind the licence on the old domain and activate it on the new one yourself. For studios — keys for 5 or 25 sites, or unlimited.

Technical requirements

  • OpenCart 4.0.2 – 4.1.x (tested on 4.1.0.3 and 4.0.2.3, with the mysqli and pdo database drivers), 3.0.x (tested on 3.0.5.0) or 2.3.0.2.
  • PHP — whatever your OpenCart version needs: the 2.3 build was tested on PHP 7.0, the others on PHP 8.1–8.3. The cURL extension is needed for the Pro licence.
  • Database: tested on MariaDB 10.11.
  • Theme: any theme that shows categories, brands and tags with the standard OpenCart pages (product/category, product/manufacturer, product/search with a tag).

Version history

v1.0.0 Current 15 October 2026

For OpenCart 4.x, 3.x and 2.3: product order rules for categories (with subcategories) and for all categories, standard orders, “in stock first”.

Frequently bought with Catalog Sort Rules for OpenCart

4 modules in one order — 40% cheaper than separately

“Store starter” bundle Catalog Sort Rules Nova Poshta Premium LiqPay Telegram notifications and Viber/SMS for customers Need more — all 173 modules in All Access for 4 990 ₴.
3 590 ₴ lifetime instead of 5 960 UAH bought separately
Buy the bundle →

Full module description

Catalog Sort Rules for OpenCart is a module for stores where one product order for the whole catalogue is not enough. In standard OpenCart the “Default” order is the same for every page: the “Sort Order” field on the product form. But you want it to differ: newest first in “Smartphones”, cheapest first in “Accessories”, bestsellers on a brand page, and a hand-made order with “top” products at the start in a category with a seasonal offer.

The module sets the default order separately for each category, brand page and tag page. The rule applies until the shopper picks a sorting himself: as soon as he picks “Price” or “Name”, the list is sorted exactly as he asked. The module does not touch the OpenCart core, templates or OCMOD patches.

It works together with our Smart Filter and Smart Search for OpenCart — tested on one store with all three modules.

Running WooCommerce? There is a separate Catalog Sort Rules for WooCommerce plugin with the same approach: its own sorting for every category, brand and tag, pinned products and a manual order.

What the shopper sees

The shopper opens a category and sees the products in the order you set for it: pinned first, then by the rule, out-of-stock products at the end. Nothing new appears on the page: no scripts, no extra requests, and “Sort By” still shows “Default”. As soon as the shopper picks another sorting, he gets exactly that — the module does not force its order on someone who has already decided how to browse.

What the admin gets

The menu item Catalog → “Sort rules” with the list of rules, and a “Settings” page.

  • New rule: page type (category, all categories, brand, all brands, tag), the page itself and the order. One rule per place: the module will not create a second rule for the same category, it opens the existing one.
  • Rule list: what is set, on or off, with “Edit”, “Open on the store”, “Turn off” and “Delete” buttons. Pro rules without a licence are marked “Pro — paused”.

Rule page

  • Order — store default, newest, price ↑ and ↓, name A–Z and Z–A, rating, stock, model; Pro also has bestsellers and a hand-made order.
  • “In stock first” and “On sale first” (Pro) — added on top of any order.
  • “Also for subcategories” — subcategories without a rule of their own use this one.
  • Pinned products (Pro): search by name, model, SKU or ID, up to 50 per rule, your own order with arrows. A pinned product is shown only on pages it already belongs to.

Pro: hand-made order

For the “Hand-made order” the module lists all products of the page (up to 2000): drag them with the mouse or use the arrows to put them in the order you need, then save. Products added to the category later go after this list in the store default order.

Settings

  • Turn the module on or off: when it is off, every page keeps the store default order, and the rules are kept.
  • “Pinned on top when the shopper sorts” (Pro) — off by default.
  • Bestsellers: how many days of sales to count (90 by default), and a “Recalculate now” button.

How it works, step by step

  1. The shopper opens a category, brand or tag page. The module finds the rule that applies to it: its own, a parent category rule with “Also for subcategories”, or “All categories” / “All brands”.
  2. If the shopper has already picked a sorting, the module does nothing (except pinned products with the Pro option).
  3. An order that is a standard OpenCart sorting (price, name, newest…) is handed to OpenCart itself — so specials, customer group discounts and taxes are calculated by the core as always.
  4. Pinned products, “in stock”, “on sale”, bestsellers and the hand-made order are added in front of the standard sorting in the product list query — only for the list of the page itself, not for the “Featured” or “Latest” blocks.
  5. Bestsellers are counted from orders with a processing or complete status over N days and refresh on their own every 12 hours when a bestsellers rule exists.

Under the hood

  • No core edits. No OCMOD patches; two events around getProducts() of the OpenCart product model. One class library is identical in all three builds, and the code is PHP 7.0 compatible.
  • Standard sorting stays standard. If the rule matches a standard sorting, the module only passes it as the default choice. Its own keys (pinned, hand-made order, bestsellers) are added to the start of the outer ORDER BY for one query only.
  • The OpenCart 4 cache is switched off for that one query, so the rule order does not get into the product list cache and does not “stick” after the rule is deleted.
  • If a theme or a module has set its own order in the list query, the module leaves it alone.
  • Own tables oc_cc_catsort_rule, oc_cc_catsort_item (pinned products and the hand-made order), oc_cc_catsort_stat (sales for bestsellers). Core tables are not changed.
  • The licence lives in a separate settings group: “Save” does not touch it.

How to install

  1. OpenCart 4: Extensions → Installer → upload cc_catsort.ocmod.zip (do not rename the archive) and press “Install”. OpenCart 3: Extensions → Installer → cc_catsort-oc3.ocmod.zip. OpenCart 2.3: upload the contents of the upload/ folder from cc_catsort-oc2.ocmod.zip to the store root (FTP or the hosting file manager) — the 2.3 Installer does not copy files without a configured FTP.
  2. Extensions → Extensions → Modules → CatCode Catalog Sort Rules → “Install”.
  3. Catalog → “Sort rules”: choose the page and the order, press “Create rule”.
  4. Press “Open on the store” next to the rule and check the order.
  5. For Pro: paste the licence key from the e-mail you get after payment, or press “Try Pro for 7 days” on the “Licence” tab.

Questions
about the module

Didn't find the answer? Message us on Telegram and we'll reply within a business day.

@catcode_support Setup, compatibility, activation
What does a shopper see if he picks "Price (Low > High)" himself?

Exactly what he picked: OpenCart sorts the list as usual, and the module rule does not apply at that moment. The rule works while "Sort By" shows "Default". Only pinned products can be kept on top while the shopper sorts — with a separate Pro option.

How does a category rule cover subcategories?

A category page takes its own rule. If there is none, it takes the rule of the nearest parent category that has "Also for subcategories" on. If there is none either, it takes the "All categories" rule. A brand page takes its own rule or "All brands".

Does the module work with a product filter?

Tested with our Smart Filter: when the shopper picks a filter value, only the matching products stay, in the rule order, and a pinned product shows up only if it passes the filter itself. Filters by other developers that build the product list with their own query, bypassing the OpenCart model, will not pick up the rule.

What about the search page?

The module does not touch text search: there the order comes from relevance (for example, our Smart Search). A tag rule works on the tag page — the link from a tag on the product page.

Does the module change OpenCart files or prices?

No. No core edits and no OCMOD: the module only changes the order of the product list on the page through OpenCart events. Prices, specials and customer groups are calculated by the core as before, and the "Featured" or "Latest" blocks on the same page do not change.

Do I have to renew the licence every year?

No. For OpenCart it is a single payment and a lifetime licence, one for all three builds: 4.x, 3.x and 2.3. The Pro trial starts only when you press the button. Without Pro, brand and tag rules are paused (kept), and a hand-made order or bestsellers in a category rule fall back to the store default order.

What is left after the module is removed?

Uninstalling removes the events, and the storefront goes back to the standard order at once. The rule tables stay so that a reinstall or an update can see them. To remove everything, drop the tables oc_cc_catsort_rule, oc_cc_catsort_item and oc_cc_catsort_stat.

Not quite what you are looking for?

We build custom modules for WordPress, WooCommerce, OpenCart and Shopify. Tell us about the task and we'll prepare an estimate.

Order a custom module