S
S
Sergey2017-02-08 08:10:18
PHP
Sergey, 2017-02-08 08:10:18

How to apply a shopping cart rule (linked to a group) for a guest?

How it is possible for "guest" to apply the rule of work with a basket with a certain group?
That is, the size of the discount depends on the city, belonging to the city is stored in user groups (each city has its own group).
It works for registered users, but not for "guests". As I understand it, this is due to the fact that group membership is stored in the session and not in the database.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Burlaka, 2017-02-08
@AlexeyGfi

Do you mean simultaneously not authorized and not registered?
Then at least you need to define the city.
Then I have two theoretical scenarios.
1.
Play on the dev.1c-bitrix.ru/api_help/main/reference/cuser/set...
function, which binds a registered user to a group without an entry in the database (that is, for the duration of the session). But we need an authorized user - this (registration and authorization) can be organized through the API by linking his city in the appropriate user group. Generate a login for him according to some rule and put a checkbox in the card, saying that this is a "blank" that will need to be refilled when the order is actually placed
2. Having a city and knowing what discount is responsible for users "from there", generate a one-time coupon and apply it hidden. I remember once doing such a feint, but a very long time ago. But did =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question