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

  1. In the left menu, go to StoreSettingsPayment systems and select Yandex Pay.

  2. Go to the Yandex Pay Checkout settings tab.

  3. 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.

    image

    If the address isn't precise enough, you'll get a notification in the Yandex Delivery column.

    image

  4. Go to the payment system settings. To do this, double-click the line with your site name.

  5. In the Delivery options box in the Delivery section, click the Yandex Delivery link.

    image

  6. Configure the depot address and working hours:

    1. Click the link in the Depot address box.

    2. Select the address on the map or enter it in the text box on the right. Click Save.

    3. Click the link in the Depot business hours box.

      1. 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.
      2. In the Calendar box, select a calendar that isn't used for unloading.
      3. In the Opening hours box, set the holiday opening hours of the depot.
      4. Click Save.
    4. Click Save.

  7. Click Save.

    If the settings are correct, the On status is displayed in the Yandex Pay Checkout settings tab in the Yandex Delivery column.

  8. In the left menu, go to SettingsUsersUser list.

  9. 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.

  1. In the left menu, go to StoreDepot controlDepots.

  2. Select the depot and click Add user property.

  3. Fill out the property values:

    1. Address: in the Yandex Pay: depot address box.
    2. Business hours: in the Yandex Pay: unloading hours box.
    3. Contact person: in the Yandex Pay: user contacts box.
  4. Click Save.

  5. In the left menu, go to StoreSettingsPayment systems and select Yandex Pay.

  6. Go to the payment system settings. To do this, double-click the line with your site name.

  7. In the Delivery options box in the Delivery section, click the Yandex Delivery link.

  8. 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.

  1. In the left menu, go to StoreOrders and select the orders.

  2. Click Transport requests and select Send selected.

    image

  3. Click Create new request.

  4. 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.

  5. Click the link with the request number.

  6. Go to the Contents tab and check the current request status.

  7. 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.

  8. If you didn't enable the Automatically confirm request option when creating the request:

    1. To confirm the request, click ActionsConfirm in the top-right corner.
    2. To cancel the request, click ActionsCancel 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 ActionsUpdate 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 customerThe order is on its way to the customerDelivered. If the order is returned, the status changes to Returning the order to the merchantOrder returned to the merchant. In case of an error, the status changes to Delivery error.