Answer the question
In order to leave comments, you need to log in
Product properties (material and size, both properties of the Enum type) are not displayed in the orders of the Bitirx administrative panel. How to make it appear?
In the Bitrix administrative panel in orders, if you go to a specific order next to the goods, I know that their properties can be displayed. I need to display the properties Material and Size (both are Enum lists).
Here is the place on the screenshot:
I add the goods to the cart via the API (that is, the component is not used), the Id of the TP or the goods to be added to the cart and the amount of the added goods or trade offer are transferred to a separate PHP file.
I add to the cart with the line: Add2BasketByProductID($PRODUCT_ID,$QUANTITY,array());
When placing an order, I simply pass the cart object to the order object, in short something like this:
$order = Order::create($siteId, $USER->isAuthorized() ? $USER->GetID() : $userIdTpm);
...setting $order for all types of payer and other things...
$basket = \Bitrix\Sale\Basket::loadItemsForFUser(\Bitrix\Sale\Fuser::getId(CSaleBasket::GetBasketUserID()), \Bitrix\ Main\Context::getCurrent()->getSite());
$order->setBasket($basket);
How can I make sure that the necessary properties are displayed in the orders in the admin panel? The product on which the value of the material property was tested and the size are exactly specified (or rather, its sales offer).
This is how the offer properties look like:
From the assumptions, when adding products to the basket by the Add2BasketByProductID function, you need to pass an array with the offer properties as the third parameter. If so, how exactly to do it for my case?
I also found the "Value is added to the cart" checkbox in the infoblock types in the trade offers on the properties tab if you click the change opposite the property, but it did not help to display the properties in the admin panel in orders, the checkmark is on the screen.
Answer the question
In order to leave comments, you need to log in
At the top "change order", scroll to the composition of the order (as on your first screen), and there is a surprise in the form of a context menu joxi.ru/DmB3na7TJXeRQ2, set up the columns as you need))
In order for these properties to be displayed there, you need to add them (properties) to the basket. The checkbox "The value is added to the cart" only affects when using the standard template (or a template based on it).
You use the deprecated Add2BasketByProductID function to add a product to the cart
/**
* @deprecated deprecated since catalog 17.5.9
* @see \Bitrix\Catalog\Product\Basket::add
*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question