Y
Y
Yuriy2018-06-21 15:47:55
1C-Bitrix
Yuriy, 2018-06-21 15:47:55

Bitrix own price for the item in the cart CUSTOM_PRICE?

A piece of code for creating a product update in the cart:

...

if ($basketId) {
                $item = $basket->getItemById($basketId);
            } else {
                $item = $basket->createItem('catalog', $productId);

            }
$item->setFields(
                [
                    'QUANTITY'     => $arItem[OrderItemTable::FIELD_QUANTITY],
                    'NAME'         => $arItem["PRODUCT_NAME"],
                    'CURRENCY'     => \Bitrix\Currency\CurrencyManager::getBaseCurrency(),
                    'LID'          => 's1',
                    'PRODUCT_XML_ID' => $arItem[OrderItemTable::FIELD_PRODUCT_XML_ID],
                    'PRICE'        => $arItem[OrderItemTable::FIELD_PRICE],
                    'CUSTOM_PRICE' => 'Y',
                ]
            );
            
$item->save();

...

$basket->save();
$rs = $rsOrder->save();

5b2b9e14cd3b0155456970.png
Items in the cart are created, the price is correct, the quantity is the same. But the total amount of the order is 0r ... The
following helps, I change the price in any direction, say when creating the price was 6r, I change it to 10r ..
And after that the Final price is correct.
Why is this happening?
5b2b9e6e1b2f4399144266.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2018-06-22
@gromdron

1) Check the inventory control settings and for some reason I don't see the provider class when creating the product. Are you transferring it? Check the current data here - https://dev.1c-bitrix.ru/community/blogs/vws/about...
2) And in the paymentCollection after changing the price everything is fine?

V
Vladimir Kai, 2018-06-21
@gold_dezmor

What version of the sale module do you have?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question