# MegaPost\_Command\_Controller

Все ajax запросы идут через командер MegaPost\_Command\_Controller

* **getCity** - Список городов
* **setCity** - Сохранение выбранного города в сессии
* **cartOneStep** - Показ корзины/пересчет корзины
* **deliveryOneStep** - Показ списка доставок
* **paymentSystemOneStep** - Показ списка оплат
* **deliveryCalculate/deliveryPVZCalculate** - Калькулятор доставки на странице товара и показ карты на отдельной странице

Если вы хотите изменить/заменить его, то в [настрйоках JS](https://support.morozovpimnev.ru/megapost/pages/mXnQ4DBffGA3IvxheBNV#nastroiki-v-js-megapost-scriptxxxx.js) в параметре `callback` указываете свой путь и в `bootstrap.php` размещаете свой обработчик **route**

{% code lineNumbers="true" fullWidth="true" %}

```php
Core_Router::add('megapost/callback', '/megapost/mycallback/')
    ->controller('MegaPost_Command_MyController');
```

{% endcode %}

Создайте файл `/modules/megapost/command/mycontroller.php` с class `MegaPost_Command_MyController` и внесите нужные изменения


---

# 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://support.morozovpimnev.ru/megapost/megapost_command_controller.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.
