Set up the Yandex Delivery module
Before the setup, register with Yandex Delivery and enable its support in the Yandex Pay console.
The delivery time and cost will be calculated in the Yandex Pay Checkout form. After that, the admin can create a transport request and monitor its status in 1C-Bitrix.
Step 1. Set up delivery in Yandex Pay Checkout
-
In the left menu, go to Store → Settings → Payment systems and select Yandex Pay.
-
Go to the Yandex Pay Checkout settings tab.
-
In the Yandex Delivery column, click Enable. The store address will be added to the delivery settings automatically, and the current user will be the contact person.
If the address isn't precise enough, you'll get a notification in the Yandex Delivery column.
-
Go to the payment system settings. To do this, double-click the line with your site name.
-
In the Delivery options box in the Delivery section, click the Yandex Delivery link.
-
Configure the depot address and working hours:
-
Click the link in the Depot address box.
-
Select the address on the map or enter it in the text box on the right. Click Save.
-
Click the link in the Depot business hours box.
- In the Business hours box, click Add and fill out the business hours. Based on that, a list of available delivery dates and time windows will be created for the user to choose from.
- In the Calendar box, select a calendar that isn't used for unloading.
- In the Opening hours box, set the holiday opening hours of the depot.
- Click Save.
-
Click Save.
-
-
Click Save.
If the settings are correct, the On status is displayed in the Yandex Pay Checkout settings tab in the Yandex Delivery column.
-
In the left menu, go to Settings → Users → User list.
-
For the user that's selected as the contact person, fill out the First name, Last name, Patronymic, Email, and Phone or Mobile phone boxes.
Step 2. Set up depots
If you use multiple depots for unloading Yandex Delivery orders, specify the address and contacts for each depot separately.
-
In the left menu, go to Store → Depot control → Depots.
-
Select the depot and click Add user property.
-
Fill out the property values:
- Address: in the Yandex Pay: depot address box.
- Business hours: in the Yandex Pay: unloading hours box.
- Contact person: in the Yandex Pay: user contacts box.
-
Click Save.
-
In the left menu, go to Store → Settings → Payment systems and select Yandex Pay.
-
Go to the payment system settings. To do this, double-click the line with your site name.
-
In the Delivery options box in the Delivery section, click the Yandex Delivery link.
-
In Select depot, click Nearest depot. For the address, depot business hours, and contacts, select the Yandex Pay: depot address, Yandex Pay: unloading hours, and Yandex Pay: user contacts boxes.
When calculating delivery options, only depots that have all the necessary products in stock will be taken into account. The depot that's nearest to the user will be selected.
To use your own depot selection method, implement the \\YandexPay\\Pay\\Trading\\Entity\\Common\\Express\\AbstractStrategy
class and register it to theonStoreExpressStrategyClassNamesBuildList
event. The module expects the Bitrix\\Main\\EventResult
object as a result of the registration event. As the parameters, it expects an associative array where the key is the method's symbol code and the value is the class name. After that, your depot selection method will be available in the Yandex Pay Checkout form settings for Yandex Delivery.
Step 3. Create a transport request
To send the order to the user, create a transport request in 1C-Bitrix. The delivery data will be sent to Yandex Delivery. You'll receive the total delivery cost, and you'll be able to confirm or cancel the request and monitor its status.
-
In the left menu, go to Store → Orders and select the orders.
-
Click Transport requests and select Send selected.
-
Click Create new request.
-
Enable the Automatically confirm request option if you want to confirm the request right after the calculation and click Next.
A separate request with the Calculating delivery cost will be calculated for every order.
-
Click the link with the request number.
-
Go to the Contents tab and check the current request status.
-
Wait for the cost to be calculated and refresh the page.
When the cost has been calculated, the request status will change to Delivery awaiting confirmation.
-
If you didn't enable the Automatically confirm request option when creating the request:
- To confirm the request, click Actions → Confirm in the top-right corner.
- To cancel the request, click Actions → Cancel in the top-right corner. View the cancellation cost and click Next to cancel the request. Cancellation is free if you haven't confirmed the request yet.
Note
If the request status is Delivery not confirmed in the time given, click Actions → Update in the top-right corner to view the current delivery cost.
Before the order is handed over, the request status is Delivery service waiting for the merchant to hand over the order. After the order is handed over to the delivery service, its status will change: Preparing to send the order to the customer → The order is on its way to the customer → Delivered. If the order is returned, the status changes to Returning the order to the merchant → Order returned to the merchant. In case of an error, the status changes to Delivery error.