Jump to content
tuk66

[MODULE] M4 PDF Extensions

Recommended Posts

For others:

 

.barcode { padding: 1.5mm; margin: 0; vertical-align: top; color: #000000; }
.barcodecell { text-align: center; vertical-align: middle; padding: 0; }
...
<td class="barcodecell"><barcode code="Your message here" size="0.8" type="QR" error="M" class="barcode" /></td>

Share this post


Link to post
Share on other sites

(Y)

 

How to display product features in delivery slip with barcode templates?

 

I try this, but not working

{section name=features loop=$product[products].product_feature}
					<tr>
						<td style="padding-right: 8mm"><strong>{$product[products].product_feature[features].name|escape:'htmlall':'UTF-8'}:</strong></td>
						<td>{$product[products].product_feature[features].value|escape:'htmlall':'UTF-8'}</td>
					</tr>
				{/section}
Edited by ukwyspa (see edit history)

Share this post


Link to post
Share on other sites
hi 

 

I'm using invoice v2, but does not show me the notes that I add to the order. as I make notes to show ??

Share this post


Link to post
Share on other sites

I've tried these codes but does not work. what I need is to show the notes that are added from backoffice to Order

Share this post


Link to post
Share on other sites

I think one of these snippets should show the notes. Did you enable debug mode (to clear cache) or edit the template in the online editor? Are there the notes in the Debug template output?

Share this post


Link to post
Share on other sites
I've enabled the debug mode and I modified the template to add fixed text or modify the appearance and all ok. but I can not display the notes I enter the order. 

 

the first code shows me the user who created the order. 

second nothing 

third nothing 

fourth nothing

Share this post


Link to post
Share on other sites

Can you send me the Debug template output at PM? I'll look at your data.

Share this post


Link to post
Share on other sites

After M4 PDF installation we lost access to all CATALOG pages (Front of WEB shop). Access to Main page, all CMS pages, individual product pages - working OK.

Can the reason be that your module (when downloading) was registered to ours domain as WWW.OURDOMAIN.COM but we installed module to temporary dev. site that have domain in form: http://555.444.333.222 ?

Edited by hkmod25 (see edit history)

Share this post


Link to post
Share on other sites

It can be. The module uses AJAX and depends on correct domain set in the shop as well as browser.

Share this post


Link to post
Share on other sites

It can be. The module uses AJAX and depends on correct domain set in the shop as well as browser.

No, it was not the case. Problem was in the wrong "curly brackets" after one file overwritting under installation process. If you need more info about this please let me know.

Share this post


Link to post
Share on other sites

 

I've enabled the debug mode and I modified the template to add fixed text or modify the appearance and all ok. but I can not display the notes I enter the order. 
 
the first code shows me the user who created the order. 
second nothing 
third nothing 
fourth nothing

 

You can probably use this code (working fine for me). I use this code right under "Payment Method" line:

{if $order[orders].customer.note}

            <tr>

                <td><strong>{l s='Note:' mod='m4pdf'}</strong></td>

                <td>{$order[orders].customer.note}</td>

            </tr>

        {/if}

Share this post


Link to post
Share on other sites

Please take a look  on: m4_invoice_4.tpl file.

Line 309 shows this code: {elseif $order[orders].order_detail[detail].reduction_amount > 0}

 

It is correct?

Share this post


Link to post
Share on other sites

Yes, it is correct.

 

Related note: There will be a new template "Invoices with discount" (m4_invoice_discount.tpl) in the new version of the module. This template shows discounts in greater detail.

Share this post


Link to post
Share on other sites

Yes, you can. Actually, the "Invoices with images" template does it right now - only first 3 columns are in different order - easy to change.

Edited by tuk66 (see edit history)

Share this post


Link to post
Share on other sites

I can't find the field for reference in the online editor for invoice with details, 

 

I want to replace the reference field by the barcode field.....

Share this post


Link to post
Share on other sites

If you mean the product reference, change

 

$order[orders].order_detail[detail].product_reference

 

to

 

$order[orders].order_detail[detail].product_ean13

Share this post


Link to post
Share on other sites

If you mean the product reference, change

 

$order[orders].order_detail[detail].product_reference

 

to

 

$order[orders].order_detail[detail].product_ean13

Thanks!!

Edited by ccw0103 (see edit history)

Share this post


Link to post
Share on other sites

Hi There,

 

I'm running Prestashop 1.5.6

 

You're module has been a great help.

But I have a strange issue. Since installing M4 none of my 'Order Stats' work. Orders show up on the order tab but nothing on either the dashboard or any othe Stat page.

Is this something you've seen before?

 

Thanks for your help.

 

Karl.

Share this post


Link to post
Share on other sites

No, haven't seen. I think it shouldn't be related. The module does an output only. It overrides 3 classes - PDF, CategoryController and CmsController. I have seen wrong installation due to a bug in some versions of PrestaShop, but these classes don't affect the dashboard (at least I hope).

Share this post


Link to post
Share on other sites

I had a feeling you would say that!

 

Thanks for replying anyway.

 

Not sure how to resolve this one.

Share this post


Link to post
Share on other sites

hello, 

I want to insert the e-mail customer in m4_invoice_image.tpl

i tried this.

- {$order[orders].email|escape:'htmlall':'UTF-8'}

and this

- {$customer[customer].email|escape:'htmlall':'UTF-8'}

but is wrong, please help

Share this post


Link to post
Share on other sites

There is no order reference in invoices. Just the order number:

{$order[orders].id_order|string_format:"%06d"}

or the invoice number

{$order[orders].shop.invoice_prefix}{$order[orders].invoice_number|string_format:"%06d"}
  • Like 1

Share this post


Link to post
Share on other sites

the name of 1 my product is this ( AB-M001 )  and have 3 combination ( 1XCOLOR , 1XTG S, 1XTG M ) 

this in product name:

{$order[orders].order_detail[detail].product_name|escape:'htmlall':'UTF-8'} 

 

but for example i choose th combination 1XCOLOR in the invoice show this AB-M001 - 1XCOLOR

how do it for show only AB-M001 ?? 

Share this post


Link to post
Share on other sites

AB-M001 - 1XCOLOR is stored product + attribute name - see ps_order_detail table, product_name field.

 

Try

 

{$order[orders].order_detail[detail].product.name|escape:'htmlall':'UTF-8'}

 

but you should know that the product name can change in time, while the stored name in the order is unchangeable.

  • Like 1

Share this post


Link to post
Share on other sites

perfect this is correct :)  {$order[orders].order_detail[detail].product.name|escape:'htmlall':'UTF-8'}

Share this post


Link to post
Share on other sites

ciao,

c'è la possibilità di mettere in ordine alfabetico i prodotti quando viene creata la fattura ? per esempio nella m4_invoice_image ??

Grazie 
------------------------------

hello,
 
there is the possibility to put in alphabetical order the products when you create the invoice? for example in m4_invoice_image ??
 
Thank You

Share this post


Link to post
Share on other sites

Yes, it is. The key is to use

 

{foreach ...@sortby:"product_name" ...}

 

cycle instead of {section}.

 

 

Examples are at these templates:

 

m4_invoice_product_features.tpl

m4_invoice_pack_group.tpl

m4_invoice_cz1.tpl

Share this post


Link to post
Share on other sites

hello , thanks for your reply.

i write this 
{foreach from=$order[orders].order_detail|@sortby:"product_name" item=order_detail}

and after this 
 

    {foreachelse}
            <tr>
                <td colspan=5>{l s='no order details' mod='m4pdf'}</td>
            </tr>
        {/foreach}


but when i create the invoice , there are no product.

 

post-721668-0-09728200-1424853126_thumb.jpg

post-721668-0-64976000-1424853470_thumb.jpg

post-721668-0-71081900-1424853473_thumb.jpg

Edited by giuliopowa (see edit history)

Share this post


Link to post
Share on other sites

Hi,

 

I able to make some changes on the Delivery slips template (with your help). But now I have another question. I want to print labels from the BO orderscreen. Is this possible?
So I'm in an order and set the status to send. Print a delivery slip and than I want to print an address label. How do I do this?

 

Thanks.

Share this post


Link to post
Share on other sites

At the moment, you can print the invoice and delivery slip from the Orders page. If you want to print both the delivery slip and the address label, I would join these templates to one. So you will print two pages at once.

 

I will add some custom buttons on this page to print user-defined templates. Unfortunately, it will take some time.

Share this post


Link to post
Share on other sites

Is this module working for multistore? M4pdf is already working in store A but in store B want the same invoices but with another address.
I made a copy of the invoicetemplate from store A and made this copy default in store B.

But now A and B have the template of B.

Share this post


Link to post
Share on other sites

What version of the module are you using? Multistore support was improved during the last few releases. So you can print store name, address, ... this way

$order[orders].shop.shop_name
$order[orders].shop.shop_addr1

It means bulk invoices for all stores at once have the right logo, shop name, address, city and so on. See any of latest invoice template.

Share this post


Link to post
Share on other sites

Hi,

 

Suddenly the customers message is not printed anymore on our packingslips.

 

Is there something changed in the variables??

 

We now have this:

 

<!-- start order message block -->
    {if $order[orders].message.message}
   <br /><br /> <div class="clear">{l s='Customer\'s message:' mod='m4pdf'}</div>
<div class="clear" style="border: 4px solid #a1a1a1;
    padding: 10px 10px; 
    background: #fff;
    width: 100%;
    border-radius: 10px;">{$order[orders].message.message|escape:'htmlall':'UTF-8'}</div>
{/if}
<!-- end order message block -->

Share this post


Link to post
Share on other sites

Can you print the same order using the Debug template (HTML is enough)? You should see the message there.

Share this post


Link to post
Share on other sites

Nope...  i tried the original invoice tpl that came with the module, with customer message template too...

 

The message doesn't show up on neither. Not in debug template and not in test template.

 

Dunno what happened here, it worked before.

 

We noticed it first until a customer told us she had wrote an order comment with details about the address. (gate code etc.)  we missed that since it doesn't print it anymore on the packing-list.

Share this post


Link to post
Share on other sites

Please send me an email. I will check it.

Share this post


Link to post
Share on other sites

Bonjour,

 

J'ai fait l'acquisition de ce module récemment et j'en suis pleinement satisfait quant à sa capacité à générer des factures personnalisées.

 

Cependant, j'ai un problème lors de la génération de factures en masse.

 

Si je génère entre 1 et 100 factures, je n'ai pas de problèmes mais au delà une erreur intervient et ne génère pas les factures.

 

La génération de factures en masse (parfois plus de 300 ne posait pas problème avant)

 

Merci par avance,

Share this post


Link to post
Share on other sites

We have customers that use many addresses with different names to those addresses

 

For example

 

I create an account with the name of "John Smith". I then add an invoice address with the name "David Brown" and a delivery address with the name "Anne Jones"

 

Now, I create an order and use the invoice address and the delivery address - all looks good EXCEPT the account holders name is not on the invoice at all

 

So how could I add the original account holders name "John Smith" onto the invoice?

Share this post


Link to post
Share on other sites

We have customers that use many addresses with different names to those addresses

 

For example

 

I create an account with the name of "John Smith". I then add an invoice address with the name "David Brown" and a delivery address with the name "Anne Jones"

 

Now, I create an order and use the invoice address and the delivery address - all looks good EXCEPT the account holders name is not on the invoice at all

 

So how could I add the original account holders name "John Smith" onto the invoice?

 

It's OK, i found it

{$order[orders].customer.lastname|escape:'htmlall':'UTF-8'}
{if !empty($order[orders].customer.lastname)} - {/if}

Unfortunately it will not do what I hoped because prestashop will not allow numbers in a name field (I was hoping to add a customer trade account number to their last name)

Share this post


Link to post
Share on other sites

This module is not compatible with new function of PS ?

 

Immagine.png

Share this post


Link to post
Share on other sites

Tuk66:

 

By using the M4 PDF Extension module, can the invoice or the custom built pdf show the product name in any of the languages of the front- of back office and not only the value stored at product_name field in the order_detail table?

 

Thanks in advance

 

Jorge

Share this post


Link to post
Share on other sites

Yes, try this snippet:

{* Set language ID from Localization > Languages instead of 1 *}
{assign var="product_name_lang" value=Product::getProductName($order[orders].order_detail[detail].product_id, $order[orders].order_detail[detail].product_attribute_id, 1)}
{$product_name_lang|escape:'htmlall':'UTF-8'}
  • Like 1

Share this post


Link to post
Share on other sites

Hi

Can someone point me in the right direction please

 

I need to sort the products into order based on price

 

Working with the file: m4_products.tpl

 

I think it is something here: {section name=products loop=$product}

 

But no idea what.

Share this post


Link to post
Share on other sites

Start with a template using {foreach} loop. For example m4_catalog_sorted_category.tpl.

 

Then try to use:

{foreach from=$product|@sortby:"price" item=products name=cycle}

About sortby modifier:

    /**
     * Modifier: sortby - allows arrays of named arrays to be sorted by given field
     * ------------------------------------------------------------------
     * Smarty Plugin - Array Sort
     * Sorts an array by supplied fields
     * by cablehead, messju and pscs on Smarty Forums
     * http://www.smarty.net/forums/viewtopic.php?t=1079
     * orig by dholmes at jccc d0t net - from http://au.php.net/function.uasort
     *
     * Example:
     * {foreach from=$array|@sortby:field1 item=fielda}
     * {foreach from=$array|@sortby:"field1,#field2,-field3,-#field4" item=fielda}
     * {foreach from=$array|@sortby:"default_category.name" item=fielda}
     *  '#' means sort numerically
     *  '-' means to sort descending instead of ascending
     *  '.' means sub-array identificator
     */
  • Like 1

Share this post


Link to post
Share on other sites

Just starting to play with the catalog pages. Can someone confirm this for me please

 

post-246958-0-98604600-1453550790_thumb.jpg

 

I have this button on the category pages. If the category has products all works well and it shows the full list of products available.

 

However, if the category has subcategories should it pick up all the products from all the subcategories?post-246958-0-71927500-1453550910_thumb.jpg

 

When I click this on categories with only subcategories it is empty

 

So, can I get it to show all the products in all the subcategories?

 

 

Share this post


Link to post
Share on other sites

I think subcategories are only supported the module administration (Catalog), not on the category page.

Share this post


Link to post
Share on other sites

I think subcategories are only supported the module administration (Catalog), not on the category page.

OK, thanks. At least I can stop trying to make it work :) I will change the button text to something appropriate

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More