Update app.py
Browse files
app.py
CHANGED
|
@@ -714,40 +714,40 @@ def catalog():
|
|
| 714 |
return;
|
| 715 |
}
|
| 716 |
let total = 0;
|
| 717 |
-
let orderText = "🛍️ *Новый Заказ от Soola Cosmetics*
|
| 718 |
-
orderText += "
|
| 719 |
orderText += "*Детали заказа:*%0A";
|
| 720 |
-
orderText += "
|
| 721 |
cart.forEach((item, index) => {
|
| 722 |
const itemTotal = item.price * item.quantity;
|
| 723 |
total += itemTotal;
|
| 724 |
const colorText = item.color !== 'N/A' ? ` (${item.color})` : '';
|
| 725 |
-
orderText += `${index + 1}. *${item.name}*${colorText}
|
| 726 |
-
orderText += ` Кол-во: ${item.quantity}
|
| 727 |
-
orderText += ` Цена: ${item.price.toFixed(2)} ${currencyCode}
|
| 728 |
-
orderText += ` *Сумма: ${itemTotal.toFixed(2)} ${currencyCode}
|
| 729 |
});
|
| 730 |
-
orderText += "
|
| 731 |
-
orderText += `*ИТОГО: ${total.toFixed(2)} ${currencyCode}
|
| 732 |
-
orderText += "
|
| 733 |
|
| 734 |
if (userInfo && userInfo.login) {
|
| 735 |
-
orderText += "*Данные
|
| 736 |
-
orderText += `Имя: ${userInfo.first_name || ''} ${userInfo.last_name || ''}
|
| 737 |
-
orderText += `Логин: ${userInfo.login}
|
| 738 |
if (userInfo.phone) {
|
| 739 |
orderText += `Телефон: ${userInfo.phone}%0A`;
|
| 740 |
}
|
| 741 |
-
orderText += `Страна: ${userInfo.country || 'Не указана'}
|
| 742 |
-
orderText += `Город: ${userInfo.city || 'Не указан'}
|
| 743 |
} else {
|
| 744 |
-
orderText += "*Клиент не
|
| 745 |
}
|
| 746 |
-
orderText += "
|
| 747 |
|
| 748 |
const now = new Date();
|
| 749 |
const dateTimeString = now.toLocaleString('ru-RU', { dateStyle: 'short', timeStyle: 'short' });
|
| 750 |
-
orderText += `Дата заказа: ${dateTimeString}
|
| 751 |
orderText += `_Сформировано автоматически_`;
|
| 752 |
|
| 753 |
const whatsappNumber = "996997703090";
|
|
|
|
| 714 |
return;
|
| 715 |
}
|
| 716 |
let total = 0;
|
| 717 |
+
let orderText = "🛍️ *Новый Заказ от Soola Cosmetics* 🛍️";
|
| 718 |
+
orderText += "----------------------------------------";
|
| 719 |
orderText += "*Детали заказа:*%0A";
|
| 720 |
+
orderText += "---------------------------------------- ";
|
| 721 |
cart.forEach((item, index) => {
|
| 722 |
const itemTotal = item.price * item.quantity;
|
| 723 |
total += itemTotal;
|
| 724 |
const colorText = item.color !== 'N/A' ? ` (${item.color})` : '';
|
| 725 |
+
orderText += `${index + 1}. *${item.name}*${colorText} `;
|
| 726 |
+
orderText += ` Кол-во: ${item.quantity} `;
|
| 727 |
+
orderText += ` Цена: ${item.price.toFixed(2)} ${currencyCode} `;
|
| 728 |
+
orderText += ` *Сумма: ${itemTotal.toFixed(2)} ${currencyCode} `;
|
| 729 |
});
|
| 730 |
+
orderText += "----------------------------------------";
|
| 731 |
+
orderText += `*ИТОГО: ${total.toFixed(2)} ${currencyCode} `;
|
| 732 |
+
orderText += "---------------------------------------- ";
|
| 733 |
|
| 734 |
if (userInfo && userInfo.login) {
|
| 735 |
+
orderText += "*Данные клиента: ";
|
| 736 |
+
orderText += `Имя: ${userInfo.first_name || ''} ${userInfo.last_name || ''} `;
|
| 737 |
+
orderText += `Логин: ${userInfo.login} `;
|
| 738 |
if (userInfo.phone) {
|
| 739 |
orderText += `Телефон: ${userInfo.phone}%0A`;
|
| 740 |
}
|
| 741 |
+
orderText += `Страна: ${userInfo.country || 'Не указана'} `;
|
| 742 |
+
orderText += `Город: ${userInfo.city || 'Не указан'} `;
|
| 743 |
} else {
|
| 744 |
+
orderText += "*Клиент не авторизован ";
|
| 745 |
}
|
| 746 |
+
orderText += "---------------------------------------- ";
|
| 747 |
|
| 748 |
const now = new Date();
|
| 749 |
const dateTimeString = now.toLocaleString('ru-RU', { dateStyle: 'short', timeStyle: 'short' });
|
| 750 |
+
orderText += `Дата заказа: ${dateTimeString} `;
|
| 751 |
orderText += `_Сформировано автоматически_`;
|
| 752 |
|
| 753 |
const whatsappNumber = "996997703090";
|