A
A
Alexander2021-07-06 10:25:39
1C-Bitrix
Alexander, 2021-07-06 10:25:39

How to write the name of the city in the properties of the order?

There is an order.
Getting data from a form

$name = $arrVALUES['NAME'];
$phone = $arrVALUES['PHONE'];
$email = $arrVALUES['EMAIL'];
$location = $arrVALUES['LOCATION'];


I'm writing down

$order->setField('COMMENTS', 'ГОРОД ЗАКАЗА:  - ' $location);

Here writes down
And when you do it gives a city error$order->setField('LOCATION', $location);

[Bitrix\Main\ArgumentOutOfRangeException] The value of an argument 'name=LOCATION' is outside the allowable range of values (100)
/data/vhosts/artw/lapsi.ru/www/bitrix/modules/sale/lib/internals/entity.php:196
#0: Bitrix\Sale\Internals\Entity->setField(string, string) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/sale/lib/orderbase.php:488
#1: Bitrix\Sale\OrderBase->setField(string, string) /data/vhosts/artw/lapsi.ru/www/local/php_interface/init.php:739
#2: FormSendController::preorderSaver(string, array, array) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/classes/general/module.php:475
#3: ExecuteModuleEventEx(array, array) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/form/classes/general/form_callformresult.php:427
#4: CAllFormResult::Add(string, array) /data/vhosts/artw/lapsi.ru/www/bitrix/components/bitrix/form.result.new/component.php:202
#5: include(string) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/classes/general/component.php:594
#6: CBitrixComponent->__includeComponent() /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/classes/general/component.php:653
#7: CBitrixComponent->includeComponent(string, array, boolean) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/classes/general/main.php:1038
#8: CAllMain->IncludeComponent(string, string, array, boolean) /data/vhosts/artw/lapsi.ru/www/local/templates/lapsi/footer.php:132
#9: include_once(string) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/include/epilog_before.php:93
#10: require(string) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/include/epilog.php:2
#11: require_once(string) /data/vhosts/artw/lapsi.ru/www/bitrix/footer.php:4
#12: require(string) /data/vhosts/artw/lapsi.ru/www/local/templates/catalog.php:519
#13: include(string) /data/vhosts/artw/lapsi.ru/www/catalog/index.php:2
#14: include_once(string) /data/vhosts/artw/lapsi.ru/www/bitrix/modules/main/include/urlrewrite.php:159
#15: include_once(string) /data/vhosts/artw/lapsi.ru/www/bitrix/urlrewrite.php:


in this example $location = Novosibirsk or Moscow or something similar.

Perhaps you need to pass some code or something like that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-07-06
@rpsv

There is no location field, there are DELIVERY_LOCATION and TAX_LOCATION fields.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question