# Drupal 8, 9 (commerce)

### Инструкция по настройке и установке модуля.

{% hint style="info" %}
Модуль поддерживает работу с 8 и 9 версией Drupal (commerce)
{% endhint %}

1\. Скачайте  [архив](https://github.com/unitpay/drupal/archive/main.zip) с модулем.

2\. Установите модуль. Для этого перейдите в Extend -> Install new module. Выбираете архив с модулем и далее "Сохранить".

![](/files/-MOax6uViREeY5BtpJvb)

3\. Перейдите в Commerce -> Configuration -> Payment gateway. PAYMENT GATEWAY: "Unitpay" Нажмите "Edit".В поле DOMAIN вставьте значение unitpay.ru, в поля PUBLIC KEY и SECRET KEY скопируйте публичный и секретный ключ из личного кабинета Unitpay.

![](/files/-MOaxzDsKs5dv4RG83oS)

4\. Включите модуль и сохраните.

![](/files/-MOayDJQhQdZmNxzqxGV)

5\. В личном кабинете Unitpay добавьте адрес обработчика в формате **http\://<имя вашего сайта>/commerce-unitpay/callback**

<div align="left"><img src="/files/-MOaz1kGx_bgWIOimwQp" alt=""></div>

6\. НДС устанавливается внутри настроек модуля Commerce -> Configuration -> Payment gateway

<div align="left"><img src="/files/-MOb-1RtPRjSEDF0Hgs4" alt=""></div>

7\. Валюта задается в двух местах. Commerce -> Configuration -> Currencies

![](/files/-MOb-dxsz70S3R1R60Td)

8\. И далее, чтобы появилась возможность менять в товарах, нужно добавить в "Product types". Commerce -> Configuration -> Product types -> Edit Default -> Manage fields

![](/files/-MOb02bwVRPtpnsbwbjr)

![](/files/-MOb0GOxjd84N11UN3M0)

![](/files/-MOb0UIICNTh39Xrhjq6)

![](/files/-MOb0X3KnzvZCz6QMfpC)

9\. Аналогично требуется проделать для "variation types". Commerce -> Configuration -> Product variation types -> Edit Default -> Manage fields

{% hint style="info" %}
В модуле поддерживаются промокоды, доставку необходимо устанавливать через дополнительный внешний модуль.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.unitpay.ru/modules/cms-modules/drupal-8-9-commerce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
