Шаблоны писем клиентам

Автор kalashret, 15 декабря 2015, 01:14:56

« назад - далее »

kalashret

#15
1. зашел \classes\PaymentModule.php
2. изменил PaymentModule.php (загрузил в приложение)
3. Сохранил.
4. Сбросил кэш
5. Сделал заказ
6. На почту клиенту пришло уведомление с http://joxi.ru/v29lyjxIGGxO9m.
Что я не верно сделал?

Виталий

У вас в шаблоне писем переменная номера заказа
{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

kdvbpspr

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.