Answer the question
In order to leave comments, you need to log in
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 .= // выбрать только те товары, у которых есть акционная цена для группы покупателей "Оптовики"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question