A
A
Alexander2020-10-30 12:23:29
1C-Bitrix
Alexander, 2020-10-30 12:23:29

Is it possible to create a custom property for a user's cart?

Is it possible to create a custom property for the user's cart, for example, some parameter, and this parameter will be available through the method?

there is a basket that we receive

$basket = Sale\Basket::loadItemsForFUser(Sale\Fuser::getId(), 'Bitrix\Main\Context::getCurrent()->getSite()');


the cart has methods like
$basketItems = $basket->getBasketItems(); // массив объектов
$price = $basket->getPrice(); // Цена с учетом скидок
$weight = $basket->getWeight(); // Общий вес корзины


Perhaps Bitrix has a method by which you can set your property to the basket object and then get this property, is it possible to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2020-10-30
@babarun

As an option, create an HL table in which to store FUSER_ID and all the attributes that you need for the basket object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question