Автор Тема: Шаблоны писем клиентам  (Прочитано 2117 раз)

15 Декабрь 2015, 23:16:21
Ответ #15
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
1. зашел \classes\PaymentModule.php
2. изменил PaymentModule.php (загрузил в приложение)
3. Сохранил.
4. Сбросил кэш
5. Сделал заказ
6. На почту клиенту пришло уведомление с http://joxi.ru/v29lyjxIGGxO9m.
Что я не верно сделал?
16 Декабрь 2015, 12:19:00
Ответ #16
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 105673
  • Репутация: +39553/-0
    • Просмотр профиля
    • Webstudio UwK
У вас в шаблоне писем переменная номера заказа
{id_order}В модулях оплаты разные шаблоны писем. В вашем случае это шаблон
/mails/ru/preparation.html
/mails/ru/preparation.txt
Можно сдеалать так:
1. Изменить во всех шаблонах переменные номера заказа на
{order_name}2. Или в файле PaymentModule.php изменить
'{id_order}' =>  sprintf("#%06d", (int)($order->id)),
'{order_name}' =>  sprintf("#%06d", (int)($order->id))
Cоздание интернет сайтов Webstudio UwK
31 Август 2016, 14:32:36
Ответ #17
  • Ветеран
  • *****
  • Сообщений: 527
  • Репутация: +1/-0
  • Сообщество PrestaShop
    • Просмотр профиля
In PrestaShop 1.6 (tested and confirmed working in v1.6.0.14) you can accomplish this by the following method.

Copy the file /classes/PaymentModule.php to /override/classes/PaymentModule.php.
Edit the file /override/classes/PaymentModule.php as follows.
At lines 337-341 is a code block that should read like this:

if (!result)
{
  PrestaShopLogger::addLog('PaymentModule::validateOrder - Order cannot be created',
    3, null, 'Cart', (int)$id_cart, true);
  throw new PrestaShopException('Can\'t save Order');
}
Immediately after that code block, insert the following two lines of code:

$order->reference = str_pad($order->id, 9, '0', STR_PAD_LEFT);
$order->update();
Delete the file /cache/class_index.php so that Prestashop automatically re-creates this file taking into account the new override file.
Any existing records in your PrestaShop database can be updated to use a numerical reference manually using a tool such as phpMyAdmin.
I would imagine the steps would be very similar if not identical to these for PrestaShop v1.5 but at this time I have not tested this solution with PrestaShop v1.5. If someone finds this solution works on v1.5 perhaps they could confirm this in the comments. Thank you.