This commit is contained in:
2025-08-05 21:53:39 +03:00
parent 50bf9061be
commit ef137729ac
22 changed files with 221 additions and 87 deletions

View File

@@ -15,6 +15,7 @@
* @property User $user
* @property ModelCustomerCustomerGroup $model_customer_customer_group
* @property ModelLocalisationOrderStatus $model_localisation_order_status
* @property DB $db
*/
class ControllerExtensionModuleTgshop extends Controller
{

View File

@@ -161,7 +161,7 @@
/>
<script>
$('#{{ settingKey }}-btn').click(function () {
const telegramToken = $('#module_tgshop_bot_token').val(); // fetch from input
const telegramToken = $('#module_tgshop_bot_token').val().trim(); // fetch from input
if (! telegramToken) {
alert('Сначала введите Telegram Bot Token!');
return;
@@ -251,19 +251,19 @@
</div>
<script>
$('#{{ settingKey }}-btn-test').click(function () {
const telegramToken = $('#module_tgshop_bot_token').val(); // fetch from input
const telegramToken = $('#module_tgshop_bot_token').val().trim();
if (! telegramToken) {
alert('Сначала введите Telegram Bot Token!');
return;
}
const chatId = $('#module_tgshop_chat_id').val(); // fetch from input
const chatId = $('#module_tgshop_chat_id').val().trim();
if (! chatId) {
alert('Сначала введите Chat ID!');
return;
}
const template = $('#{{ settingKey }}').val();
const template = $('#{{ settingKey }}').val().trim();
if (! template) {
alert('Сначала задайте шаблон!');
return;
@@ -272,7 +272,7 @@
fetch('/index.php?route=extension/tgshop/handle&api_action=testTgMessage', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: telegramToken,