Производитель продукции в блоке товаров на странице заказа
Всем доброго времени суток, уже давненько мы не писали новых новостей на сайте. Сегодня я хочу рассказать Вам как добавить производителя на страницу заказа в блок товаров.

Все правки что мы будем вносить, являются простыми. Также мы не будем изменять ядро системы. Нам нужно будет просто изменить файлы, расположенные в admin/themes/default.
Добавляем новое поле в таблицу товаров
Здесь ничего сложного html/smarty задача. Открываем файл adminXXXX/themes/default/template/controllers/orders/helpers/view/view.tpl где adminXXXX название Вашей директории админ панели. В нем находим таблицу с полями определения, это примерно 886 строка (PrestaShop 1.6).
В данный файл мы добавляем просто новое поле, код ниже:
Таким образом мы получаем следующий код, новую строку я выделил {*код*}:
Вот и все. После обновления страницы Вы там должны увидеть новое поле с именем производителя. Если ничего не изменилось проверьте очистили ли Вы кэш.

Все правки что мы будем вносить, являются простыми. Также мы не будем изменять ядро системы. Нам нужно будет просто изменить файлы, расположенные в admin/themes/default.
Добавляем новое поле в таблицу товаров
Здесь ничего сложного html/smarty задача. Открываем файл adminXXXX/themes/default/template/controllers/orders/helpers/view/view.tpl где adminXXXX название Вашей директории админ панели. В нем находим таблицу с полями определения, это примерно 886 строка (PrestaShop 1.6).
<table class="table" id="orderProducts">
<thead>
<tr>
<th></th>
<th><span class="title_box ">{l s='Product'}</span></th>
<th>
<span class="title_box ">{l s='Unit Price'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th class="text-center"><span class="title_box ">{l s='Qty'}</span></th>
{if $display_warehouse}<th><span class="title_box ">{l s='Warehouse'}</span></th>{/if}
{if ($order->hasBeenPaid())}<th class="text-center"><span class="title_box ">{l s='Refunded'}</span></th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}
<th class="text-center"><span class="title_box ">{l s='Returned'}</span></th>
{/if}
{if $stock_management}<th class="text-center"><span class="title_box ">{l s='Available quantity'}</span></th>{/if}
<th>
<span class="title_box ">{l s='Total'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th style="display: none;" class="add_product_fields"></th>
<th style="display: none;" class="edit_product_fields"></th>
<th style="display: none;" class="standard_refund_fields">
<i class="icon-minus-sign"></i>
{if ($order->hasBeenDelivered() || $order->hasBeenShipped())}
{l s='Return'}
{elseif ($order->hasBeenPaid())}
{l s='Refund'}
{else}
{l s='Cancel'}
{/if}
</th>
<th style="display:none" class="partial_refund_fields">
<span class="title_box ">{l s='Partial refund'}</span>
</th>
{if !$order->hasBeenDelivered()}
<th></th>
{/if}
</tr>
</thead>
<tbody>
{foreach from=$products item=product key=k}
{* Include customized datas partial *}
{include file='controllers/orders/_customized_data.tpl'}
{* Include product line partial *}
{include file='controllers/orders/_product_line.tpl'}
{/foreach}
{if $can_edit}
{include file='controllers/orders/_new_product.tpl'}
{/if}
</tbody>
</table>
В данный файл мы добавляем просто новое поле, код ниже:
<th><span class="title_box">{l s='Manufacturer'}</span></th>
Таким образом мы получаем следующий код, новую строку я выделил {*код*}:
<table class="table" id="orderProducts">
<thead>
<tr>
<th></th>
<th><span class="title_box ">{l s='Product'}</span></th>
{*<th><span class="title_box">{l s='Manufacturer'}</span></th>*}
<th>
<span class="title_box ">{l s='Unit Price'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th class="text-center"><span class="title_box ">{l s='Qty'}</span></th>
{if $display_warehouse}<th><span class="title_box ">{l s='Warehouse'}</span></th>{/if}
{if ($order->hasBeenPaid())}<th class="text-center"><span class="title_box ">{l s='Refunded'}</span></th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}
<th class="text-center"><span class="title_box ">{l s='Returned'}</span></th>
{/if}
{if $stock_management}<th class="text-center"><span class="title_box ">{l s='Available quantity'}</span></th>{/if}
<th>
<span class="title_box ">{l s='Total'}</span>
<small class="text-muted">{$smarty.capture.TaxMethod}</small>
</th>
<th style="display: none;" class="add_product_fields"></th>
<th style="display: none;" class="edit_product_fields"></th>
<th style="display: none;" class="standard_refund_fields">
<i class="icon-minus-sign"></i>
{if ($order->hasBeenDelivered() || $order->hasBeenShipped())}
{l s='Return'}
{elseif ($order->hasBeenPaid())}
{l s='Refund'}
{else}
{l s='Cancel'}
{/if}
</th>
<th style="display:none" class="partial_refund_fields">
<span class="title_box ">{l s='Partial refund'}</span>
</th>
{if !$order->hasBeenDelivered()}
<th></th>
{/if}
</tr>
</thead>
<tbody>
{foreach from=$products item=product key=k}
{* Include customized datas partial *}
{include file='controllers/orders/_customized_data.tpl'}
{* Include product line partial *}
{include file='controllers/orders/_product_line.tpl'}
{/foreach}
{if $can_edit}
{include file='controllers/orders/_new_product.tpl'}
{/if}
</tbody>
</table>
Вот и все. После обновления страницы Вы там должны увидеть новое поле с именем производителя. Если ничего не изменилось проверьте очистили ли Вы кэш.
2 комментария