Jump to content

How to detail pack components on an invoice or delivery slip


Recommended Posts

Hi,

 

I'm setting up my prestashop online boutique (I use the 1.5.4 version of it) and I have trouble with packs.

When a customer orders a pack, I need to appear on the final order, on the invoice and on my delivery slips, the exact list of products that are in this pack, along with the reference, name and quantity of each product.

 

I suppose something has to be added to the invoice.tpl file (for the invoices), but have no idea whatsoever about what to add or how to proceed.

Could you please help me?

 

Thanks

Julien

Link to comment
Share on other sites

  • 2 years later...

Hi, 

 

I've bought M4 PDF and am very impressed with the functionality! Great product, especially the PDF "print whole catalog"!

 

Just one issue: I need to show the warehouse location for each item (regular and in packs).

 

I've found an invoice PDF template which details the pack item names and the delivery slip showing the location of regular items but am unable to combine the two to show locations of pack items. Can anyone help?

 

Most grateful for any help as I can't completely switch to prestashop until the warehouse gets locations per product!

 

Thanks,

Barry

Link to comment
Share on other sites

Hi Barry,

 

Thank you for using the M4 PDF Extensions module.

 

There is not enough data to get the warehouse location of pack items in all cases. Even so, if you only use one warehouse or pack items are stored in the same warehouse as the pack itself, you can use this snippet:

{foreach from=$order[orders].order_detail[detail].pack item=pack}
<tr>
    <td class="zero" style="border: none; width: 4mm;"> </td>
    <td class="zero" style="border: none; padding: 0 3mm 0.3mm 0;">
        <span class="smaller">{l s='Qty' mod='m4pdf'} {$pack.pack_quantity}</span>
    </td>
    <td class="zero" style="border: none; padding: 0 3mm 0.3mm 0;">
        <span class="smaller">
            {* {if $pack.reference != ''}{$pack.reference|escape:'htmlall':'UTF-8'}{else}---{/if}: *}
            {$pack.name|escape:'htmlall':'UTF-8'}
        </span>
    </td>
    <!-- this part is new -->
    <td class="zero" style="border: none; padding: 0 3mm 0.3mm 0;">
        <span class="smaller">
        {assign var="location" value=WarehouseProductLocation::getProductLocation($pack.id_product, $pack.id_product_attribute, $order[orders].order_detail[detail].id_warehouse)}
        {if !empty($location)}{$location|escape:'htmlall':'UTF-8'}{/if}
        </span>
    </td>
</tr>
{/foreach}

in the Invoices - packs itemized template (m4_invoice_pack.tpl).

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...