K
K
kamisarlapsha2018-09-21 15:22:35
Layout
kamisarlapsha, 2018-09-21 15:22:35

How to implement category icons in product card in opencart 2.3?

Hey! There are product categories: sedan, sports car, crossover, etc. Each category has its own icon. So it is necessary, depending on the category, to display this small icon in the product card, or several of these icons. And how can I display the inscription novelty or promotion? Below I will throw off an example in which everything is indicated by arrows. Thanks in advance!
5ba4e28ad21ce363365010.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zoozag, 2018-09-21
@kamisarlapsha

1. In the controller for each product, you get an array of its categories
2. In the template, loop through the product categories and display icons for existing categories
3. For new products, there are 2 date parameters in the product parameters that you can build on:
date_available - date of arrival
date_added - date creations
Check any of them that it is no more than X days earlier than today for
4. With promotions: If there is a special, calculate the discount amount and display it in the right place

M
Maxim Timofeev, 2018-09-21
@webinar

1. I think these icons should depend on the characteristics of the product. not its category.
2. Rip categories or characteristics in a cycle and put down icons. What is the difficulty?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question