Menu

1 / 3

How we built a product filter for OpenCart 3 and 4 without touching the core

DEV Community: php·Sergey Polyakov·4 days ago
#gAw6aXdJ
#devto#dev#opencart#filter#category
Reading 0:00
15s threshold

We build online stores on OpenCart. Every store needs a product filter, and over the years we kept running into the same three problems with them. Category pages got slower as the catalog grew. Search engines found thousands of filter URLs that were near-duplicates of the category. And sooner or later, an update of OpenCart or the theme broke something, because the filter patched core files.

So we wrote our own and run it on our clients' stores. It is called PS Filter, it works on OpenCart 3.0.x and 4.x, and we have released it under the MIT license.

This post covers the decisions that mattered most and the MySQL and OpenCart pitfalls we hit along the way.

1. No core edits, only events

The module does not change OpenCart files and does not use OCMOD.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.