N
N
Nikita2022-03-04 16:05:37
opencart
Nikita, 2022-03-04 16:05:37

How to display in a category only those products that have a discount for a certain group of customers?

Hello! Some items have a wholesale price. For this, a group of buyers "Wholesalers" was created, and the price for this group is affixed to the promotions of some goods.
In the frontend, in the category, I want to check the "Show only products with a wholesale price" checkbox. By clicking on which, only those products should be displayed that have a promotional price filled for the "Wholesales" buyer group. How can I do it?
The checkbox, as I understand it, needs to be made as a link with a get-parameter, for example, site.ru/posuda?opt=yes
And in the /catalog/model/catalog/product.php model, in the getProducts() function, add a condition for selecting if any get parameter, i.e.:

if (isset($_GET['opt'])) {
  $sql .= // выбрать только те товары, у которых есть акционная цена для группы покупателей "Оптовики"
}

It is very difficult for me to understand such complex SQL queries, maybe someone has already done something like this?
PS: I have ocStore 2.3.0.2.3

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question