M
M
MUTOgen4eg2016-10-28 14:22:15
1C-Bitrix
MUTOgen4eg, 2016-10-28 14:22:15

How to programmatically create an order with a discount in Bitrix?

Implemented a separate page with a form for mass ordering. Accordingly, the input into the form must be somehow processed and saved in the order.
I took the principle from here dev.1c-bitrix.ru/support/forum/messages/forum6/top... In general, everything suits and works, but the problems started when it was necessary to add a discount to a certain group of users.
I created 10% discounts in the admin panel for a separate role according to my price type.
I go and test for this role.
The problem is that when saving an order, Add2BasketByProductID is now getting errors "Error saving the results of applying discounts and cart rules". The order is created, but the curve. In the admin panel, it is marked as problematic. Discounts are either applied to all products, then not, then to some random one, moreover, I always order the same thing.
How can this problem be solved?

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