S
S
Sergey Miller2020-09-07 14:56:07
opencart
Sergey Miller, 2020-09-07 14:56:07

How to display similar products in opencart 3?

In opencart 3, the task was to display products from the same collection, I solved the issue like this:

in product.php I added a new data array and processed it by copying the full code responsible for displaying products in the card . The only thing I changed was the added field , which is used in the admin panel to name the collection. Well, in twig I displayed these products, but only those that have a collection name identical to the name of the collection with the currently viewed product. It was easy. But now I want to display " similar products " according to the same principle$data['products'] = array();['mpn'] (manufacturer number)



". Why is the module out of the box not suitable? The fact that "recommended products" are displayed with manually pre-installed products. And what for each product in the admin panel to add similar products when creating a new product? In my case, this is inconvenient, due to the large number of products in Displaying

these similar products on the principle of "collections" is not a question, the only thing I have not yet understood is how to display exactly similar products, for example, I am in the "chair 1" card and here I need to display products like "chair 2", "armchair 3" and so on... How can I teach opencart in the controller to understand which products are considered similar?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton R., 2020-09-07
@anton_reut

what products are considered similar
- identify signs of "similarity". For example, according to the words in the title, all products in the title of which have the word "armchair" are considered similar. You need to parse the names of products and, based on this, create arrays of similar ones.

V
VVCh, 2020-09-08
@VVCh

There are a lot of modules that have an adaptive approach to "similarity"
Name, attribute, price, etc.
But the whole disadvantage of such similarity is the load on the database to get a tuple of similar products

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question