M
M
MMnka2021-11-11 09:28:44
1C-Bitrix
MMnka, 2021-11-11 09:28:44

How to remove goods from the order in 1s Bitrix?

Can you please tell me if there is such an opportunity in 1s Bitrix to remove the product from the contents of the order? I need to make a button that will remove the product from the content of the order.
618cb80ab41b4139273922.jpeg
As I understand it, you need to use this code

$basket = Sale\Basket::loadItemsForFUser($fuser, SITE_ID);

$basketItem = $basket->getItemById($basketItemId);
$result = $basketItem->delete();
if ($result->isSuccess())
{
    $basket->save();
}

But it still throws an error

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