К содержанию

Minishop2 повторная отправка письма клиенту

Здравствуйте коллеги.

Никак не могу разобраться с таким вопросом по minishop2

— клиент делает заказ с доставкой.

— Менеджер через админку меняет тип доставки (например с доставки до терминала за которую настроена дополнительная плата на бесплатную).

Как повторно отправить письмо клиенту что изменился статус/тип доставки?
Илья
Илья
07 июня 2017, 13:28
modx.pro
1 997
Реклама

Комментарии: 11

Александр
Александр Проверенный
07 июня 2017, 17:23
При изменении статуса — письмо должно само отправляться.
Этот параметр задается в настройке статуса.
Письмо покупателю
При изменении доставки — статус остается, соответственно письмо покупателю не уходит.
События на обновление полей нет. Остается только вариант сделать отдельный статус «изменен» (например) и при изменении доставки — менять статус. (смена статуса спровоцирует отправку письма клиенту)
    Илья
    Илья Старожил
    13 июня 2017, 12:26
    Здравствуйте,
    ещё вопрос — как в письмо включить изменённые данные?
    использую такой код для письма клиенту
    {extends 'tpl.msEmail'}
    
    {block 'title'}
        {'ms2_email_subject_change_user' | lexicon : $order}
    {/block}
    
    {block 'products'}
        {parent}
        {if $payment_link?}
            <p style="margin-left:20px;{$style.p}">
                {'ms2_payment_link' | lexicon : ['link' => $payment_link]}
            </p>
        {/if}
    {/block}
    Но повторно приходит старая инфа (до изменений)

    Как правильно оформит чанк?
      Александр
      Александр Проверенный
      14 июня 2017, 09:39
      надо смотреть, что в расширяемых блоках
      {extends 'tpl.msEmail'}
        Илья
        Илья Старожил
        14 июня 2017, 09:45
        в чанке к доставке относится следующий код
        [[!If? &subject=`[[+delivery.name]]` &operator=`notempty` &then=`Способ доставки: <strong> [[+delivery.name]]</strong>`]]
        [[!If? &subject=`[[+delivery.description]]` &operator=`notempty` &then=`([[+delivery.description]]`]]
        т.е по сути он и должен подставлять последнюю инфу из карточки по доставке…
          Илья
          Илья Старожил
          14 июня 2017, 09:49
          Если нужно могу полный код привести.
            Александр
            Александр Проверенный
            14 июня 2017, 12:57
            {$_pls['delivery.name']? "Способ доставки: <strong> $_pls['delivery.name']</strong>":''}
            {$_pls['delivery.description']? "Способ доставки: <strong> $_pls['delivery.description']</strong>":''}
              Илья
              Илья Старожил
              16 июня 2017, 15:11
              у меня всё совсем развалилось, пока не понимаю fenom…
              вот полный код, могли бы поправить и заодно подсказать где можно почитать про fenom?
              {var $style = [
              'logo' => 'display:block;margin: auto;',
              'a' => 'color:#348eda;',
              'p' => 'font-family: Arial;color: #666666;font-size: 12px;',
              'h' => 'font-family:Arial;color: #111111;font-weight: 200;line-height: 1.2em;margin: 40px 20px;',
              'h1' => 'font-size: 36px;',
              'h2' => 'font-size: 28px;',
              'h3' => 'font-size: 22px;',
              'th' => 'font-family: Arial;text-align: left;color: #111111;',
              'td' => 'font-family: Arial;text-align: left;color: #111111;',
              ]}
              
              {var $site_url = ('site_url' | option) | preg_replace : '#/$#' : ''}
              {var $assets_url = 'assets_url' | option}
              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                  <title>{'site_name' | option}</title>
              </head>
              <body style="margin:0;padding:0;background:#f6f6f6;">
              <div style="height:100%;padding-top:20px;background:#f6f6f6;">
                  {block 'logo'}
                      <a href="{$site_url}">
                          <img style="{$style.logo}"
                               src="{$site_url}/theme/img/logo.png"
                               alt="{$site_url}"
                          />
                      </a>
                  {/block}
                  
                  <!-- body -->
                  <table class="body-wrap" style="padding:0 20px 20px 20px;width: 100%;background:#f6f6f6;margin-top:10px;">
                      <tr>
                          <td></td>
                          <td class="container" style="border:1px solid #f0f0f0;background:#ffffff;width:800px;margin:auto;">
                              <div class="content">
                                  <table style="width:100%;">
                                      <tr>
                                          <td>
              
                                              {block 'products'}
                                                  <table style="width:90%;margin:auto;">
                                                      <thead>
                                                      <tr>
                                                          <th>Фото</th>
                                                          <th style="{$style.th}">{'ms2_cart_title' | lexicon}</th>
                                                          <th style="{$style.th}">{'ms2_cart_count' | lexicon}</th>
                                                          <th style="{$style.th}">{'ms2_cart_weight' | lexicon}</th>
                                                          <th style="{$style.th}">{'ms2_cart_cost' | lexicon}</th>
                                                      </tr>
                                                      </thead>
                                                      {foreach $products as $product}
                                                          <tr>
                                                              <td style="{$style.th}">
                                                                  {if $product.thumb?}
                                                                      <img src="{$site_url}{$product.thumb}"
                                                                           alt="{$product.pagetitle}"
                                                                           title="{$product.pagetitle}"
                                                                           width="120" height="90"/>
                                                                  {else}
                                                                      <img src="{$site_url}{$assets_url}components/minishop2/img/web/ms2_small@2x.png"
                                                                           alt="{$product.pagetitle}"
                                                                           title="{$product.pagetitle}"
                                                                           width="120" height="90"/>
                                                                  {/if}
                                                              </td>
                                                              <td style="{$style.th}">
                                                                  {if $product.id?}
                                                                      <a href="{$product.id | url : ['scheme' => 'full']}"
                                                                         style="{$style.a}">
                                                                          {$product.name}
                                                                      </a>
                                                                  {else}
                                                                      {$product.name}
                                                                  {/if}
                                                                  {if $product.options?}
                                                                      <div class="small">
                                                                          {$product.options | join : '; '}
                                                                      </div>
                                                                  {/if}
                                                              </td>
                                                              <td style="{$style.th}">{$product.count} {'ms2_frontend_count_unit' | lexicon}</td>
                                                              <td style="{$style.th}">{$product.weight} {'ms2_frontend_weight_unit' | lexicon}</td>
                                                              <td style="{$style.th}">{$product.price} {'ms2_frontend_currency' | lexicon}</td>
                                                          </tr>
                                                      {/foreach}
                                                      <tfoot>
                                                      <tr>
                                                          <th colspan="2"></th>
                                                          <th style="{$style.th}">
                                                              {$total.cart_count} {'ms2_frontend_count_unit' | lexicon}
                                                          </th>
                                                          <th style="{$style.th}">
                                                              {$total.cart_weight} {'ms2_frontend_weight_unit' | lexicon}
                                                          </th>
                                                          <th style="{$style.th}">
                                                              {$total.cart_cost} {'ms2_frontend_currency' | lexicon}
                                                          </th>
                                                      </tr>
                                                      </tfoot>
                                                  </table> 
              
              [[!If? &subject=`[[+address.comment]]` &operator=`notempty` &then=`Комментарий: <strong> [[+address.comment]]</strong>`]]
              
              [[!If? &subject=`[[+delivery.name]]` &operator=`notempty` &then=`Способ доставки: <strong> [[+delivery.name]]</strong>`]]
              [[!If? &subject=`[[+delivery.description]]` &operator=`notempty` &then=`([[+delivery.description]]`]]
              [[!If? &subject=`[[+payment.name]]` &operator=`notempty` &then=`
              Способ оплаты: <strong> [[+payment.name]]</strong> 
              `]]
               
                                                  <h3 style="{$style.h}{$style.h3}">
                                                      {'ms2_frontend_order_cost' | lexicon}:
                                                      {if $total.delivery_cost}
                                                          {$total.cart_cost} {'ms2_frontend_currency' | lexicon} + {$total.delivery_cost}
                                                          {'ms2_frontend_currency' | lexicon} =
                                                      {/if}
                                                      <strong>{$total.cost}</strong> {'ms2_frontend_currency' | lexicon}
                                                  </h3>
                                              {/block}
                                              
              Контактные данные
              [[!If? &subject=`[[+address.receiver]]` &operator=`notempty` &then=`Имя: <strong> [[+address.receiver]]</strong> 
              `]]
              [[!If? &subject=`[[+address.phone]]` &operator=`notempty` &then=`Телефон: <strong> [[+address.phone]]</strong> 
              `]]
              [[!If? &subject=`[[+user.email]]` &operator=`notempty` &then=`E-mail: <strong> [[+user.email]]</strong> 
              `]]
              
              Адрес доставки
              [[!If? &subject=`[[+address.city]]` &operator=`notempty` &then=`Город: <strong> [[+address.city]]</strong> 
              `]]
              [[!If? &subject=`[[+address.street]]` &operator=`notempty` &then=`Улица: <strong> [[+address.street]]</strong> 
              `]]
              [[!If? &subject=`[[+address.building]]` &operator=`notempty` &then=`Дом: <strong> [[+address.building]]</strong> 
              `]]
              [[!If? &subject=`[[+address.room]]` &operator=`notempty` &then=`Квартира/офис: <strong> [[+address.room]]</strong> 
              `]]
              [[!If? &subject=`[[+address.properties.extfld_data]]` &operator=`notempty` &then=`Дата доставки: <strong> [[+address.properties.extfld_data]]</strong> 
              `]]
                                          </td>
                                      </tr>
                                  </table>
                                 
              
                              </div>
                              <!-- /content -->
                          </td>
                          <td>	</td>
                      </tr>
                      <tr>
                        <td></td>
                        <td>
                    
                          <p style="text-align:center"><em>Магазин Натуральнофф</em></p>
                        </td>
                        <td></td>
                      </tr>
                  </table>
                  
                  <!-- /body -->
                  <!-- footer -->
                  <table style="clear:both !important;width: 100%;">
                      <tr>
                          <td></td>
                          <td class="container">
                              <!-- content -->
                              <div class="content">
                                  <table style="width:100%;text-align: center;">
                                      <tr>
                                          <td align="center">
                                            
                                              <p style="{$style.p}">
                                                  {block 'footer'}
                                                  <a href="{$site_url}" style="color: #999999;">
                                                      {'site_name' | option}
                                                  </a>
                                                  , 125130 Россия, Москва, ул. Зои и Александра Космодемьянских ул., 30/32 к1
                                                  {/block}
                                              </p>
                                          </td>
                                      </tr>
                                  </table>
                              </div>
                              <!-- /content -->
                          </td>
                          <td></td>
                      </tr>
                  </table>
                  <!-- /footer -->
              </div>
              </body>
              </html>
                Илья
                Илья Старожил
                16 июня 2017, 15:13
                просто подставив тот код который Вы дали вместо строк
                [[!If? &subject=`[[+delivery.name]]` &operator=`notempty` &then=`Способ доставки: <strong> [[+delivery.name]]</strong>`]]
                [[!If? &subject=`[[+delivery.description]]` &operator=`notempty` &then=`([[+delivery.description]]`]]
                вот то что получил в письме
                {extends 'tpl.msEmail'} {block 'title'} {'ms2_email_subject_change_user' | lexicon : $order} {/block} {block 'products'} {parent} {if $payment_link?}
                {'ms2_payment_link' | lexicon : ['link' => $payment_link]}
                
                {/if} {/block}
                Илья
                Илья Старожил
                26 июня 2017, 18:06
                Здравствуйте, всё ещё очень нужна помощь.
                  Александр
                  Александр Проверенный
                  27 июня 2017, 10:01
                  обновитесь до последней версии minishop2
                  Fixed default path to loading services in the loadCustomClasses() method.
                  Update the cost of an orders after product addition.
                  Improved processing of products options.
                  Removed call of ms2Gallery::syncFiles() from msProductData::updateProductImage().
                  [mgr] Add contexts list into filters at the orders page.
                  [mgr] Fixed possible error on get orders statuses list.
                  [mgr] Fix «xcheckbox» in a Product options.
                  [mgr] Add «expand,collapse,check,uncheck» actions to the categories and options trees.
        Илья
        Илья Старожил
        07 июня 2017, 17:28
        Спасибо, была уже такая мысль, думал может есть другой способ. Пока попробую так.
          Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
          11