G
G
Georgy Kotov2021-07-27 17:09:23
1C-Bitrix
Georgy Kotov, 2021-07-27 17:09:23

How to create a product status in an order in Bitrix CMS?

Good afternoon.
The search fails with different wording of this question.
I understand that Bitrix is ​​beautiful and well documented.
However, let's imagine the situation.
There is an online store (Bitrix CMS), a call center and a warehouse.
The order was placed by the client, the call center contacted and confirmed the order by setting a certain status ("Assembly"), which caused a status change event, starting the transfer to the warehouse.
But at the warehouse during assembly, one of the items in the order turned out to be defective, which is what the warehouse itself reports to the Bitrix CMS (we omit the protocols and implementation), how to link the status to the position in the order so that the call center manager can see which goods in the order are defective?

How to display the status of a specific item in an order? Maybe there is a boxed solution?

UPD:
So far, the only idea is to set the status as a property of the product in the order basket.
I would also like to add a condition for the participation of goods in the calculation of prices, discounts and other characteristics ...

function updateStatus($basketItemId, $statusID) {
        global $APPLICATION;
 
        $arFields = [
            'PROPS' => [
                [
                    "NAME" => "Статус продукта",
                    "CODE" => "STATUS",
                    "VALUE" => $statusID,
                    "SORT" => "1"
                ]
            ]
        ];

        $updateResult = CSaleBasket::Update(
            $basketItemId,
            $arFields
        );

        if(!$updateResult){
            var_dump($APPLICATION->LAST_ERROR);  
            return false;
        }

        return true;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-07-28
@kikher

In the admin panel /bitrix/admin/sale_status.php?lang=ru add your status of the desired type and that's it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question