P
P
photosho2019-09-25 15:45:47
1C-Bitrix
photosho, 2019-09-25 15:45:47

How to make a coupon automatically applied to the cart?

The site has a field for entering a coupon, in the header - it is necessary that the coupon entered there be applied automatically to all orders of the visitor (even if this is not an authorized user). How to properly implement this in Bitrix?
When applying a coupon, I send an Ajax request to the server to check if it exists. If it returns true, then I store the coupon in Cookies. How to be further? In cart component template to check Cookies and apply coupon or is there a better solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Baruchyan, 2019-09-25
@Snatch87

Alternatively, you can try to use the event, adding items to the cart and check for the presence of a coupon in the handler: if there is, apply it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question