Автор Тема: Не выводится артикул  (Прочитано 838 раз)

28 Январь 2016, 12:18:48
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
В /pdf/invoice.tpl есть вот такой код
                      <td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 4%">{l s='№' pdf='true'}</td>
<td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 47%">{l s='Product / Reference' pdf='true'}</td>
<td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 15%">{l s='Unit Price' pdf='true'}</td>
<td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 10%; white-space: nowrap;">{l s='Discount' pdf='true'}</td>
<td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 8%">{l s='Qty' pdf='true'}</td>
<td style="font-size: 11pt; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; width: 16%">СУММА</td>
{l s='Product / Reference' pdf='true'}
но почему-то в накладной у меня не выходит артикул. Подскажите, пожалуйста, правильно ли у меня все указано или где какой кусок кода отвечает за вывод артикула?
28 Январь 2016, 12:33:55
Ответ #1
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
вывел заголовок, но не могу понять где добавить столбик для этого...
28 Январь 2016, 12:42:24
Ответ #2
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 86688
  • Репутация: +25428/-0
  • Сообщество PrestaShop
    • Просмотр профиля
В шаблоне /pdf/invoice.product-tab.tpl определен вывод товаров.
28 Январь 2016, 12:53:27
Ответ #3
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
В шаблоне /pdf/invoice.product-tab.tpl определен вывод товаров.
Но там вроде присутствует референс
<table class="product" width="100%" cellpadding="4" cellspacing="0">

<thead>
<tr>
<th class="product header small" width="{$layout.reference.width}%">{l s='Reference' pdf='true'}</th>
<th class="product header small" width="{$layout.product.width}%">{l s='Product' pdf='true'}</th>
<th class="product header small" width="{$layout.tax_code.width}%">{l s='Tax Rate' pdf='true'}</th>

{if isset($layout.before_discount)}
<th class="product header small" width="{$layout.unit_price_tax_excl.width}%">{l s='Base price' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
{/if}

<th class="product header-right small" width="{$layout.unit_price_tax_excl.width}%">{l s='Unit Price' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
<th class="product header small" width="{$layout.quantity.width}%">{l s='Qty' pdf='true'}</th>
<th class="product header-right small" width="{$layout.total_tax_excl.width}%">{l s='Total' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
</tr>
</thead>

<tbody>

<!-- PRODUCTS -->
{foreach $order_details as $order_detail}
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
<tr class="product {$bgcolor_class}">

<td class="product center">
{$order_detail.reference}
</td>
<td class="product left">
{if $display_product_images}
<table width="100%">
<tr>
<td width="15%">
{if isset($order_detail.image) && $order_detail.image->id}
{$order_detail.image_tag}
{/if}
</td>
<td width="5%">&nbsp;</td>
<td width="80%">
{$order_detail.product_name}
</td>
</tr>
</table>
{else}
{$order_detail.product_name}
{/if}

</td>
<td class="product center">
{$order_detail.order_detail_tax_label}
</td>

{if isset($layout.before_discount)}
<td class="product center">
{if isset($order_detail.unit_price_tax_excl_before_specific_price)}
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_before_specific_price}
{else}
--
{/if}
</td>
{/if}

<td class="product right">
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax}
{if $order_detail.ecotax_tax_excl > 0}
<br>
<small>{{displayPrice currency=$order->id_currency price=$order_detail.ecotax_tax_excl}|string_format:{l s='ecotax: %s' pdf='true'}}</small>
{/if}
</td>
<td class="product center">
{$order_detail.product_quantity}
</td>
<td  class="product right">
{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl_including_ecotax}
</td>
</tr>

{foreach $order_detail.customizedDatas as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
<tr class="customization_data {$bgcolor_class}">
<td class="center"> &nbsp;</td>

<td>
{if isset($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) && count($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) > 0}
<table style="width: 100%;">
{foreach $customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_] as $customization_infos}
<tr>
<td style="width: 30%;">
{$customization_infos.name|string_format:{l s='%s:' pdf='true'}}
</td>
<td>{$customization_infos.value}</td>
</tr>
{/foreach}
</table>
{/if}

{if isset($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) && count($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) > 0}
<table style="width: 100%;">
<tr>
<td style="width: 70%;">{l s='image(s):' pdf='true'}</td>
<td>{count($customization.datas[$smarty.const._CUSTOMIZE_FILE_])}</td>
</tr>
</table>
{/if}
</td>

<td class="center">
({if $customization.quantity == 0}1{else}{$customization.quantity}{/if})
</td>

{assign var=end value=($layout._colCount-3)}
{for $var=0 to $end}
<td class="center">
--
</td>
{/for}

</tr>
<!--if !$smarty.foreach.custo_foreach.last-->
{/foreach}
{/foreach}
{/foreach}
<!-- END PRODUCTS -->

<!-- CART RULES -->

{assign var="shipping_discount_tax_incl" value="0"}
{foreach from=$cart_rules item=cart_rule name="cart_rules_loop"}
{if $smarty.foreach.cart_rules_loop.first}
<tr class="discount">
<th class="header" colspan="{$layout._colCount}">
{l s='Discounts' pdf='true'}
</th>
</tr>
{/if}
<tr class="discount">
<td class="white right" colspan="{$layout._colCount - 1}">
{$cart_rule.name}
</td>
<td class="right white">
- {displayPrice currency=$order->id_currency price=$cart_rule.value_tax_excl}
</td>
</tr>
{/foreach}

</tbody>

</table>
почему на выходе не виден артикул??
28 Январь 2016, 12:56:33
Ответ #4
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 86688
  • Репутация: +25428/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Может у вас он не определен (язык тоже нужно учитывать)?
28 Январь 2016, 13:05:07
Ответ #5
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Может у вас он не определен (язык тоже нужно учитывать)?
Вы про ovveride? Я как понимаю, за вывод артикула отвечает {$order_detail.reference} и для него нужно создать <td>, не?
28 Январь 2016, 13:10:55
Ответ #6
  • Ветеран
  • *****
  • Сообщений: 33325
  • Репутация: +26771/-0
    • Просмотр профиля
{$order_detail.product_reference}так выводить артикул.
28 Январь 2016, 13:11:45
Ответ #7
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Почем внутри я вижу артикул, а в накладной нет, а еще там же, наименование и артикул пишется в одну строку(почти?)
Слон (9*17*17 см)
Артикул: БАЕ (0118)

вот что сейчас приходит клиенту на почту:
28 Январь 2016, 13:14:43
Ответ #8
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
{$order_detail.product_reference}так выводить артикул.
После изменения нужно ли кэш очищать или сразу все поменяется?
Ваш код встроил сюда:
<table width="100%">
<tr>
<td width="15%">
{if isset($order_detail.image) && $order_detail.image->id}
{$order_detail.product_reference}
{/if}
{$order_detail.reference}
</td>
<td width="5%">&nbsp;</td>
<td width="80%">
{$order_detail.product_name}
</td>
</tr>
</table>
Потом тестовый заказ оставил, но ничего не поменялось...
У меня не создается 1колонка для артикула т.е. сразу после №:
№ | Artikul | Tovar | Price etc
1  | и тут сразу идет название товара (как на картинке)
28 Январь 2016, 13:19:39
Ответ #9
  • Ветеран
  • *****
  • Сообщений: 33325
  • Репутация: +26771/-0
    • Просмотр профиля
Нужно заменить
{$order_detail.reference}на
{$order_detail.product_reference}
28 Январь 2016, 13:25:26
Ответ #10
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Нужно заменить
{$order_detail.reference}на
{$order_detail.product_reference}
Поменял, но нет ни артикула и даже колонки нет =((
Во вложения своя модификация накладной (меняется  invoice.tpl и HTMLTemplateInvoice.php )
28 Январь 2016, 13:36:36
Ответ #11
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Может
<th class="product header small" width="{$layout.reference.width}%">{l s='Reference' pdf='true'}</th>поменять на?
<th class="product header small" width="{$layout.[b]product_reference.width[/b]}%">{l s='Reference' pdf='true'}</th>.. не помогло..
28 Январь 2016, 13:49:19
Ответ #12
  • Ветеран
  • *****
  • Сообщений: 33325
  • Репутация: +26771/-0
    • Просмотр профиля
У меня в шаблоне
<tr class="product {$bgcolor_class}">
<td class="product center">
{$order_detail.product_reference}
</td>
        <td class="product left">
Артикул показывает.
28 Январь 2016, 18:54:36
Ответ #13
  • Новичок
  • *
  • Сообщений: 37
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
У меня в шаблоне
<tr class="product {$bgcolor_class}">
<td class="product center">
{$order_detail.product_reference}
</td>
        <td class="product left">
Артикул показывает.
Смотрите, клиенту приходит письмо (типа подтверждения заказа), там прям в письме идет сам заказ и артикул отображается, а также есть во вложении PDF где нету артикула.
29 Январь 2016, 11:22:49
Ответ #14
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 86688
  • Репутация: +25428/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Письма и PDF это разные шаблоны. В них могут быть разные переменные для вывода артикула.
Если в PDF нет артикула, значит проверить объект $order_detail. Выведите его значение в лог или на экран
{$order_detail|var_dump}