J
J
JohnDaniels2015-10-07 21:34:03
PHP
JohnDaniels, 2015-10-07 21:34:03

How to add a product to the cart for a specific user in Bitrix?

there is an ID and product data and a user ID. You need to programmatically add the product to his cart.
I use CSaleBasket::Add(), in the field "FUSER_ID" I specify the ID of the required user. the code is working, the product is added incomprehensibly where. on the page Shop -> Customers -> Baskets the following picture:
7ca7813eb46c4c00a6a30b45d234617e.png
if you log in on behalf of the desired user - the basket is empty.
chyadnt?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Novikov, 2015-10-07
@JohnDaniels

Perhaps you are specifying the wrong parameters. Please note that, for example, the id of the goods in the basket and the id of the goods in the catalog are different things. Perhaps the user id will be different, check through the admin panel.
If we are talking about a one-time addition - just log in as this user through the admin panel and manually add goods to the basket for him. If we are talking about scripts, then read the documentation for the functions used again and make sure that all parameters are correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question