diff --git a/module/oc_telegram_shop/upload/admin/controller/extension/module/tgshop.php b/module/oc_telegram_shop/upload/admin/controller/extension/module/tgshop.php index d7b3e68..00f88bc 100755 --- a/module/oc_telegram_shop/upload/admin/controller/extension/module/tgshop.php +++ b/module/oc_telegram_shop/upload/admin/controller/extension/module/tgshop.php @@ -1,5 +1,20 @@ response->setOutput($this->load->view('extension/module/tgshop_init', $data)); } + public function handle(): void + { + $app = ApplicationFactory::create([ + 'base_url' => HTTPS_SERVER, + 'public_url' => HTTPS_CATALOG, + 'telegram' => [ + 'bot_token' => $this->config->get('module_tgshop_bot_token'), + 'chat_id' => $this->config->get('module_tgshop_chat_id'), + 'owner_notification_template' => $this->config->get('module_tgshop_owner_notification_template'), + 'customer_notification_template' => $this->config->get('module_tgshop_customer_notification_template'), + ], + 'logs' => [ + 'path' => DIR_LOGS, + ], + ]); + + + $app->bind(OcRegistryDecorator::class, fn () => new OcRegistryDecorator($this->registry)); + + $app + ->withLogger(fn () => new OpenCartLogAdapter($this->log, 'TeleCartAdmin')) + ->bootAndHandleRequest(); + } + protected function validate(): bool { if (! $this->user->hasPermission('modify', 'extension/module/tgshop')) { diff --git a/module/oc_telegram_shop/upload/admin/view/template/extension/module/tgshop.twig b/module/oc_telegram_shop/upload/admin/view/template/extension/module/tgshop.twig index 894e118..5e2cca0 100755 --- a/module/oc_telegram_shop/upload/admin/view/template/extension/module/tgshop.twig +++ b/module/oc_telegram_shop/upload/admin/view/template/extension/module/tgshop.twig @@ -146,73 +146,71 @@ {# ChatID #} {% elseif item['type'] == 'chatid' %} -
Как получить Chat ID
-Как получить Chat ID
+