V
V
vimbatu2021-10-01 14:11:10
1C-Bitrix
vimbatu, 2021-10-01 14:11:10

How to set location on checkout page via Bitrix API?

Good afternoon.

There is a completely custom checkout page, it works without connecting the standard order_ajax.js

On the page, you need to implement the functionality for choosing the location of the buyer, on the basis of which restrictions on delivery services, payment systems are triggered and the final $arResult component is formed.

Can someone tell me where this variable is stored and what method sets it?
Such functionality is implemented in some location modules - set the selected location on the checkout page.

Now such a module is installed - twofingers.location, not bad by the way, successfully transfers the selected location to the page, as a result we get a list of deliveries and payment systems with a location restriction.

On the checkout page itself, there is a sale.location.selector.search component, from which I get the id and name of the location. The data from there is passed to the session via ajax with a page refresh. Where and how do I need to pass the code of the location selected in the component so that after reloading the page, the arResult of the component contains a list of payments and deliveries based on the selected location?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vimbatu, 2021-10-01
@vimbatu

Understood, if anyone needs it:
Bind to the OnSaleComponentOrderOneStepOrderProps event
Change $arResult['DELIVERY_LOCATION'] to the ID of the selected location
Change $arResult['DELIVERY_LOCATION_BCODE'] to the CODE of the selected location

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question