Jump to content
tuk66

[MODULE] M4 PDF Extensions

Recommended Posts

I agree with haylau's suggestion, a customer statement feature would be very useful for me too.

 

A suggestion of mine would be to have a feature to download a catalogue page for each individual product, with a download link on the product page. I'm always surprised how many customers prefer a catalogue over a web address, and if they are only interested in one product then it is more convenient to have individual pages they can download.

 

This is already a great module, but this would make it awesome imho :)

Share this post


Link to post
Share on other sites

I agree with haylau's suggestion, a customer statement feature would be very useful for me too.

 

A suggestion of mine would be to have a feature to download a catalogue page for each individual product, with a download link on the product page. I'm always surprised how many customers prefer a catalogue over a web address, and if they are only interested in one product then it is more convenient to have individual pages they can download.

 

This is already a great module, but this would make it awesome imho :)

 

The download catalogue page is now in the latest version and is absolutely fab

 

You can see here: click the Blue PDF Data Sheet Button under the images

  • Like 1

Share this post


Link to post
Share on other sites

Ok then I take it back, the module is already awesome :)

  • Like 1

Share this post


Link to post
Share on other sites

Sounds great! ETA of new version? Can you add a 'delivery - grouped by categories, packs itemized'?

Share this post


Link to post
Share on other sites

I bought this very helpful and clever Module Extension on the developers website, because i planned to provide downloadable product-descriptions.

First I had problems with the product PDF generator in the shop front-end.

Support via e-mail responded very quickly to my questions and gave me good tips that solved my issue.

The cause was not the module, but a javascript / ajax bug in a Leo-Prestahop theme.

A great Prestashop extension! Thank you! :D

  • Like 1

Share this post


Link to post
Share on other sites

Hello,

 

I want to thank the creator of this absolutely beautiful module.

 

I apologize in advance for any mistakes, I'm French and I go through the Google translation.

 

I use the theme invoice invoice_pack_group.tpl and I made ​​the change that the author said to derendre list of products included in the package.

This works but I do not have the reference code for each product pack while after the code, it should work.


								    <span class="smaller">
										    {* {if $pack.reference != ''}{$pack.reference|escape:'htmlall':'UTF-8'}{else}---{/if}: *}
										    {$pack.name|escape:'htmlall':'UTF-8'}
								    </span>

 

 

 

Do you have an idea to do this?

 

thank you,

eReMs

Share this post


Link to post
Share on other sites

Thank you for all the compliments. I appreciate that.

 

haylau: a customer statement? Why not? Required to add orders data for customers.

 

mtporter: 'delivery - grouped by categories, packs itemized'? Yes, it would be good. I will prepare it.

 

eR3Ms: just remove {* and *} in {* {if $pack.reference != ''}{$pack.reference|escape:'htmlall':'UTF-8'}{else}---{/if}: *} and then first try with the Debug mode enabled.

 

 

There will be a new version with an online template editor tomorrow.

Share this post


Link to post
Share on other sites

The new version of the module is immediately available at www.presta-addons.com. All upgrades are FREE for life.

CHANGELOG

v1.9.0 (2013-08-28)
- Added online code editor for testing templates based on Ace
- Added subdirectory "Hidden templates" to hide unused templates.
- Templates can be copied, renamed, edited, hide and can be displayed the file name in administration
- The list of templates is expandable
- New templates "Orders with Tax" and "Orders with Tax, non-zero" for Orders (lists)
- Improved Debug template (greater readability, smaller memory footprint)
- Added "Footer text" data for invoices (PrestaShop v1.5)
- New Smarty modifier modulo_10_recursive to calculate the check digit (eg for Swiss Post)
- All invoice and delivery slip templates now repeat table header on other pages

 

 

 

There are more than 10 pages in this thread so I created a new one at http://www.prestashop.com/forums/topic/270613-module-m4-pdf-extensions-with-online-editor/
Edited by tuk66 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

I sent PM for new version !

 

Added online code editor for testing templates based on Ace

 

So we can use an online editor to edit the template ?

Edited by Totti (see edit history)

Share this post


Link to post
Share on other sites

Exactly. It is a code editor, not WYSIWYG one, but quite helpful.

Share this post


Link to post
Share on other sites

I would like to know your opinions on the latest version of the module - especially working with templates in administration and the template editor. Please send me PM with your experiences and ideas.

Share this post


Link to post
Share on other sites

Hi Tuk,

 

We have just installed your module and we are getting errors on the customers part,

 

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 560
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 560
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 560
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 560
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562

 

also in orders with details

 

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

 

And in orders

 

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 562
in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

 

i wonder if you could throw some light on to why we are getting them and if there is a fix.

 

Thanks

Russell

Share this post


Link to post
Share on other sites

Great module. Had an issue in the beginning but developer was fairly quick to help. Thanks again.

 

Two questions:

 

1. Is there any way to use State Abbreviations for the invoices and delivery slips?

 

2. My setup (Chrome) is opening and then closing a new tab before downloading each PDF. It's not the biggest deal in the world, but it does bug me. Is this how it is for everyone and/or is there a way to prevent it and have the PDF just download without opening a new tab everytime?

Edited by skeemr (see edit history)

Share this post


Link to post
Share on other sites

Hi Tuk.

 

We need help.

 

We purchased the module, but can not install it. When we install the module, the following error:

 

The following module (s) has not been installed correctly:

- M4pdf:

Unable to install with manual control: The render method in the group and in control PDF manual.

 

Please I need help. We have problems with invoices and we need to resolve.

 

Thank you very much.

Edited by KeCompro (see edit history)

Share this post


Link to post
Share on other sites

Hi Tuk.

 

We need help.

 

We purchased the module, but can not install it. When we install the module, the following error:

 

The following module (s) has not been installed correctly:

- M4pdf:

Unable to install with manual control: The render method in the group and in control PDF manual.

 

Please I need help. We have problems with invoices and we need to resolve.

 

Thank you very much.

 

You may be better asking support directly from their website, messages on here don;t always get through

Share this post


Link to post
Share on other sites

Hi Tuk.

 

We need help.

 

We purchased the module, but can not install it. When we install the module, the following error:

 

The following module (s) has not been installed correctly:

- M4pdf:

Unable to install with manual control: The render method in the group and in control PDF manual.

 

Please I need help. We have problems with invoices and we need to resolve.

 

Thank you very much.

 

Already solved. Another PDF module was installed.

Share this post


Link to post
Share on other sites

Hi Tuk,

 

We have just installed your module and we are getting errors on the customers part,

 

Warning: Parameter id_lang in function displayDate() is deprecated in /home/purelyap/public_html/fpview.com/modules/m4pdf/M4Object.php on line 560

in /home/purelyap/public_html/fpview.com/classes/Tools.php on line 1953

.......

 

i wonder if you could throw some light on to why we are getting them and if there is a fix.

 

Thanks

Russell

Sorry for the delay. I don't get messages about new post in this topic.

 

This issue will be fixed in the next version of the module. Now you can just disable PHP warnings in the php.ini file.

Share this post


Link to post
Share on other sites

Great module. Had an issue in the beginning but developer was fairly quick to help. Thanks again.

 

Two questions:

 

1. Is there any way to use State Abbreviations for the invoices and delivery slips?

 

2. My setup (Chrome) is opening and then closing a new tab before downloading each PDF. It's not the biggest deal in the world, but it does bug me. Is this how it is for everyone and/or is there a way to prevent it and have the PDF just download without opening a new tab everytime?

1.

The module uses built-in address formats from PrestaShop v1.4. Add State.iso_code to the format for all countries you want at the Localization > Countries page.

 

2.

Every browser acts a bit different. It is no so easy to replace PrestaShop's invoices and other PDF documents on all places and versions and I think there is no easy option to set different behavior at the moment.

Share this post


Link to post
Share on other sites

hi i have a question 

when i sell in europe i have this message withe the invoice original prestashop"Exempt of VAT according section 259B of the General Tax Code."

 

But if i use youre module i don't can to see this message, is a probleme when I sell out of my country

Share this post


Link to post
Share on other sites

Put this code to your template to display that message:

{if Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery'}
    {assign var="vat_number" value=$order[orders].address_delivery.vat_number}
    {assign var="id_country" value=$order[orders].address_delivery.id_country}
{elseif Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_invoice'}
    {assign var="vat_number" value=$order[orders].address_invoice.vat_number}
    {assign var="id_country" value=$order[orders].address_invoice.id_country}
{else}
    {assign var="vat_number" value="`0`"}
    {assign var="id_country" value="`0`"}
{/if}
{if Configuration::get('VATNUMBER_MANAGEMENT') && !empty($vat_number) && $id_country != Configuration::get('VATNUMBER_COUNTRY')}
    {l s='Exempt of VAT according section 259B of the General Tax Code.' mod='m4pdf'}
{/if}

It works only in PrestaShop v1.5.

Share this post


Link to post
Share on other sites

Hello Vladimir !

 

I was just trying to bulk generate a bunch of invoices from my BO (about 800) and I ended up with a 500 error, have you got a trick to solve that one ?

 

Thanks a lot,

Martin.

Share this post


Link to post
Share on other sites

You need a lot of memory to create 800 PDF invoices at once. Try 400, than 200, 100, 50 invoices to know where the memory limit is.

Share this post


Link to post
Share on other sites

Hello,

 

I'm trying to adapt the template "m4_invoice_order_message.tpl".
I'd like to put the product brand (manufacturer) with the product but it does not work.

Do you have a solution?

Again, super Module :)

Thanks

Share this post


Link to post
Share on other sites

Try

{$product[products].manufacturer['name']}

Share this post


Link to post
Share on other sites

Hi,

 

I'm thinking about buying your module  :)

I'd like to know if it's possible to build a template like this one:

 

http://it.tinypic.com/r/dz6o91/8

 

with regards to what is in the black box.

In the invoice template, I need to build the exact format that you can see inside the black box.

I don't need PS to automatically fill its content based on the customer order.

 

Thanks,

Valeria

Share this post


Link to post
Share on other sites

 

Try

{$product[products].manufacturer['name']}

 

Hello,

I tried but it does not display the brand, the field remains empty :/

Share this post


Link to post
Share on other sites

Hi,

 

I'm thinking about buying your module  :)

I'd like to know if it's possible to build a template like this one:

 

http://it.tinypic.com/r/dz6o91/8

 

with regards to what is in the black box.

In the invoice template, I need to build the exact format that you can see inside the black box.

I don't need PS to automatically fill its content based on the customer order.

 

Thanks,

Valeria

 

Hi Tuk66,

 

would you please reply to my post?

 

Thanks.

Share this post


Link to post
Share on other sites

 

Try

{$product[products].manufacturer['name']}

Sorry, I got it wrong. This code works for catalogs, not invoices.

 

Here is the right answer (tested in PrestaShop v1.5.6.0):

{Manufacturer::getNameById($order[orders].order_detail[detail].product['id_manufacturer'])}

Share this post


Link to post
Share on other sites

Hi,

 

I'm thinking about buying your module  :)

I'd like to know if it's possible to build a template like this one:

 

http://it.tinypic.com/r/dz6o91/8

 

with regards to what is in the black box.

In the invoice template, I need to build the exact format that you can see inside the black box.

I don't need PS to automatically fill its content based on the customer order.

 

Thanks,

Valeria

Sorry for the delay. I was out of office.

 

It is perfectly possible to create such an invoice layout. You can do it yourself (HTML and CSS with some Smarty knowledge needed) or I would do it fast.

  • Like 1

Share this post


Link to post
Share on other sites

Sorry for the delay. I was out of office.

 

It is perfectly possible to create such an invoice layout. You can do it yourself (HTML and CSS with some Smarty knowledge needed) or I would do it fast.

 

Thank you for your reply!

I don't think I have enough knowledge to do this job :)

Would you please send me a quotation in pvt?

Thanks very much.

Valeria

Share this post


Link to post
Share on other sites

 

Sorry, I got it wrong. This code works for catalogs, not invoices.

 

Here is the right answer (tested in PrestaShop v1.5.6.0):

{Manufacturer::getNameById($order[orders].order_detail[detail].product['id_manufacturer'])}

It's work perfectly. Thank you so much :)

Share this post


Link to post
Share on other sites

It's work perfectly. Thank you so much :)

... And to expand the question a bit

How can we also input some more manufacturer's details i.e. the short description (where we enter for example manufacturer's support info, and this needs to be presented in the invoice?)

Short description can be tied with a manufacturer_id only through db's ps_manufacturer_lang , can't find it through a product...

Share this post


Link to post
Share on other sites

Hi Tuk66,

modul m4 pdf Site logo does not show (
presta current version

 

can you please help

 

unzsyriw.jpg

Share this post


Link to post
Share on other sites

At backoffice -> preferences ->themes , Under appearance you had selected/uploaded an "invoice logo", hadn't you?

Share this post


Link to post
Share on other sites

Search for all logo* files in /img folder. What is there?

 

Can you see "Invoice logo" image under Preferences > Themes > Appearance?

Share this post


Link to post
Share on other sites

 

 

Can you see "Invoice logo" image under Preferences > Themes > Appearance?

 

yes

Share this post


Link to post
Share on other sites

There are more than one option to display the logo (image in general).

 

a) invoice.tpl example

    <img src="{if $conf.logo_invoice}{$conf.logo_invoice}{else}{$conf.logo}{/if}" />

All invoice templates assume that either "Invoice logo" or "Header logo" is set. Be sure that multistore doesn't affect your settings. To test the real $conf values use the Debug template.

 

B) plain image

Put your logo to the /modules/m4pdf/tpl folder and use this code to display:

    <img src="{$conf.base_dir_ssl}modules/m4pdf/tpl/logo.jpg" style="width: 50mm">

  • Like 1

Share this post


Link to post
Share on other sites

Hey there,

 

How can I find the smarty variables to use when I am using the online editor?

 

Also, I added one font (Georgia.ttf) and another font (Fell.ttf). Georgia works, but Fell doesn't.. anything I should be looking out for?

 

Cheers!

Share this post


Link to post
Share on other sites

Smarty variables

Use the Debug template to get all variables available.

 

New fonts

Add TTF file(s) definition to $this->fontdata array in the /modules/m4pdf/mpdf/config_fonts.php file.

Share this post


Link to post
Share on other sites

Hey tuk,

 

Thanks for the quick response. :) I see the debug template now..however I can't get anything to work..

 

For example I try:

 

{$order.invoice_date} 

 

But nothing shows up..

 

(on a side note, in order to get the lite version of the address would I just put {$order.order_lang.date_format_lite} instead?)

 

Thanks in advance!

Share this post


Link to post
Share on other sites

Look, for example, at m4_invoice.tpl. You can associate data from the debug template with variables used in another templates.

 

Invoice date is displayed by:

{dateFormatLanguage date=$order[orders].invoice_date full=0}

Share this post


Link to post
Share on other sites

Hey tuk,

 

Thanks for the help! So far so good, except for I can't get the product name to show up. I am trying to follow your structure.

 

This is my body code.

<body>
<div class="header">
<h1 class="logo">anewall</h1></br>
{section name=orders loop=$order}
<h2 class="date">{if $order[orders].invoice_date != '0000-00-00 00:00:00'}{dateFormatLanguage date=$order[orders].invoice_date full=0}{else} {/if}</h2>
</div>
<div class="addresses">
<div class="deliveryaddress">
   <div class="deliveryaddressinner">
   <h1 class="addresstitle">Delivery Address</h1>
   {$order[orders].address_delivery.firstname|escape:'htmlall':'UTF-mlall':'UTF-8'} {$order[orders].address_delivery.lastname|escape:'htmlall':'UTF-8'}<br />
   {$order[orders].address_delivery.address1|escape:'htmlall':'UTF-8'}<br />
   {if $order[orders].address_delivery.address2}{$order[orders].address_delivery.address2|escape:'htmlall':'UTF-8'}<br />{/if}
   {$order[orders].address_delivery.city|escape:'htmlall':'UTF-8'}, {$order[orders].address_delivery.state.name|escape:'htmlall':'UTF-8'}<br />
   {$order[orders].address_delivery.country.name|escape:'htmlall':'UTF-8'}<br />
     {$order[orders].address_delivery.postcode|escape:'htmlall':'UTF-8'}
</div></div>
 
<div class="billingaddress">
<div class="deliveryaddressinner">
   <h1 class="addresstitle">Billing Address</h1>
   {$order[orders].address_invoice.firstname|escape:'htmlall':'UTF-8'} {$order[orders].address_delivery.lastname|escape:'htmlall':'UTF-8'}<br />
   {$order[orders].address_invoice.address1|escape:'htmlall':'UTF-8'}<br />
    {if $order[orders].address_invoice.address2}{$order[orders].address_invoice.address2|escape:'htmlall':'UTF-8'}<br />{/if}
   {$order[orders].address_invoice.city|escape:'htmlall':'UTF-8'}, {$order[orders].address_delivery.state.name|escape:'htmlall':'UTF-8'}<br />
   {$order[orders].address_invoice.country.name|escape:'htmlall':'UTF-8'}<br />
     {$order[orders].address_invoice.postcode|escape:'htmlall':'UTF-8'}
   </div>
</div>
 
 
</div>
 
 
 
{section name=detail loop=$order[orders].order_detail}
<div class="tables">
 
<table class="tg">
  <tr>
    <th class="tg-031e">Product</th>
    <th class="tg-031e">Unit Price</th>
    <th class="tg-031e">Quantity</th>
    <th class="tg-031e">Total (Tax Excl.)</th>
  </tr>
  <tr>
    <td class="tg-031e">{$order[orders].order_detail[detail].product_name|escape:'htmlall':'UTF-8'}</td>
    <td class="tg-031e">testprice</td>
    <td class="tg-031e">testqty</td>
    <td class="tg-031e">testtotal</td>
  </tr>
  <tr>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
  </tr>
  <tr>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
    <td class="tg-031e"></td>
  </tr>
</table>
</div>
 
 
 
 
 
{/section}
{/section} 
 
 
 
<body>

This is where I fail:

<td class="tg-031e">{$order[orders].order_detail[detail].product_name|escape:'htmlall':'UTF-8'}</td>

Nothing shows up. :(

Edited by roflmyeggo (see edit history)

Share this post


Link to post
Share on other sites

Change

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

to

{$order[orders].address_delivery.firstname|escape:'htmlall':'UTF-8'}
  • Like 1

Share this post


Link to post
Share on other sites

Hola!

Mi versión prestashop es la 1.4.7. y hace unos meses compré vuestro módulo. Por defecto, esta versión prestashop no añade la factura en los pedidos, por lo que he añadido el siguiente código en el archivo /classes/Mail.php en la función Send ()

if (strpos($template, 'payment')){
$id_factura = $templateVars['{id_order}'];
$orden = new Order($id_factura);
$factura['content'] = PDF::invoice($orden, 'S');
$factura['name'] = $id_factura.'.pdf';
$factura['mime'] = 'application/pdf';
$message->attach(new Swift_Message_Attachment($factura['content'], $factura['name'], $factura['mime']));
}

El problema es que la factura que genera es con los datos en inglés, y quiero que utilice los datos en español, con la plantilla personalizada que utilizo en el módulo M4 PDF Extensions.

¿Podéis decirme como configurarlo para que la factura que se adjunta en el email sea en español?

Gracias y saludos!

 

Share this post


Link to post
Share on other sites

Normally, the language is selected by cookie or other language settings. I don't know your code circumstances, but try to set

 

ID of Spanish to $_GET['m4_id_lang'] or $_GET['m4_id_lang'] variables before calling PDF::invoice().

 

 

Normalmente, el idioma se selecciona por galletas o otros ajustes. No sé sus circunstancias de código, pero trato de establecer

 

ID de los españoles a $_GET['m4_id_lang'] o $_GET['m4_id_lang'] las variables antes de llamar PDF::invoice().

Share this post


Link to post
Share on other sites

Don´t worry, I fixed the problem. Solution: to create my own template in spanish

Thank you!

Share this post


Link to post
Share on other sites

 

Change

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

to

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

 

Hey tuk,

 

Thanks for the response. Unfortunately that did not fix the problem for me. :( Do I need to be creating under "order details" template and not "order details" in order to use what I was trying to use before?

 

Thanks,

 

Carl

Share this post


Link to post
Share on other sites

Look at the "order+detail" line of templates - m4_invoice.tpl, m4_invoice_2.tpl, m4_invoice_3.tpl, m4_invoice_4.tpl and more.

 

There is the section block for orders:

    {section name=orders loop=$order}

    ...

    {/section}

 

with some address parts inside:

    ...$order[orders].address_delivery...

 

Just don't forget to use the edited template in module administration first with the "Debug mode" enabled to clear cache.

Share this post


Link to post
Share on other sites

Thanks for all your help Vladimir. You were both quick and professional in helping me out with any problems I had (in both PM and on this forum). The module worked just as expected and was easy to use. We now have automated custom PDFs for our orders on our live site, saving us time and money. :)

 

Finally got the fonts working using these definitions:

 

"fell" => array(
        'R' => "Fell.ttf",
    ),

 

        .logo {
            font-size:40px;
            font-family: fell;
            width:50%;
            float:left;
            text-align:left;
        }

 

Thanks again for your help and work. :) Recommended highly!

Share this post


Link to post
Share on other sites

Hi,

 

I am having trouble with the installation. 

On Prestashop 1.5.6.2

 

The following module(s) were not installed properly:

  • - m4pdf : 
    Unable to install override: directory (/removed/   /override/classes/pdf 1.5.6.2) not writable

I already changed permissions to 777. That did not help.

 

Any suggestion?

 

Best,

Vova

 

 

[sOLVED]

 

Have to create the folder myself 'pdf-1.5.6.2'

Edited by reznikvova (see edit history)

Share this post


Link to post
Share on other sites

Hello!

How do I update the m4 pdf extension when I bought it through addons.prestashop.com?

Support for addons, asked me to contact the developer of the module.

I guess we should not buy the module a second time to update it?

Share this post


Link to post
Share on other sites

I bought your module but when I click config, it shows [PrestaShop] Fatal error in module M4Object:

Call to undefined function get_called_class()

Share this post


Link to post
Share on other sites

get_called_class() is a PHP function, first released in PHP 5.3.0 on 30 June 2009. My first suggestion is to upgrade PHP.

 

If it is not possible, you can change code in the /modules/m4pdf/M4Object.php file from

$staticCalledPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_called_class()).'_'.md5($string2);
$staticCalledParentPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_parent_class(get_called_class())).'_'.md5($string2);

to

if (function_exists('get_called_class')) {
    $staticCalledPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_called_class()).'_'.md5($string2);
    $staticCalledParentPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_parent_class(get_called_class())).'_'.md5($string2);
}

but some text in module administration won't be translated (a small issue only, nothing significant).

Share this post


Link to post
Share on other sites

get_called_class() is a PHP function, first released in PHP 5.3.0 on 30 June 2009. My first suggestion is to upgrade PHP.

 

If it is not possible, you can change code in the /modules/m4pdf/M4Object.php file from

$staticCalledPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_called_class()).'_'.md5($string2);
$staticCalledParentPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_parent_class(get_called_class())).'_'.md5($string2);

to

if (function_exists('get_called_class')) {
    $staticCalledPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_called_class()).'_'.md5($string2);
    $staticCalledParentPrestaKey = '<{'.M4PDF::MODULE_NAME.'}prestashop>'.strtolower(get_parent_class(get_called_class())).'_'.md5($string2);
}

but some text in module administration won't be translated (a small issue only, nothing significant).

All good now! thanks

Share this post


Link to post
Share on other sites

I used the invoice with Chinese template and installed the Sun-ExtA.ttf, its working fine for invoice, but hw about delivery slip? I didnt see any chinese templates available....

Share this post


Link to post
Share on other sites

Besides, how to hide the order number in the invoice? How can I edit the template?

Share this post


Link to post
Share on other sites

Besides, how to hide the order number in the invoice? How can I edit the template?

 

I tried to open the online editor but all those codes give me no luck, I just want the order number to be hidden. thanks

Share this post


Link to post
Share on other sites
I used the invoice with Chinese template and installed the Sun-ExtA.ttf, its working fine for invoice, but hw about delivery slip? I didnt see any chinese templates available....

You just need to set the right font in your Chinese templates:

    font-family: sun-exta;

 

Besides, how to hide the order number in the invoice? How can I edit the template?

Search for id_order and remove or comment out the Smarty element { ... } or whole HTML element <div> ... </div>

 

I tried to open the online editor but all those codes give me no luck, I just want the order number to be hidden. thanks

See the previous answer

Share this post


Link to post
Share on other sites

Hello,
because in my panel still do not see the updated version to 1.6 ps ?

Share this post


Link to post
Share on other sites

I really don't understand Addons upgrades. The latest version, 2.0.1, is available to download from April 8th.

Share this post


Link to post
Share on other sites

Hello,

because in my panel still do not see the updated version to 1.6 ps ?

 

 

I really don't understand Addons upgrades. The latest version, 2.0.1, is available to download from April 8th.

 

Exact same problem for me, Addons states that version 2.0.1 is there like so :

 

 

But on my panel there's no such thing :

 

http://imgbox.com/YYN7xyfP

 

I guess addons.prestashop.com have a glitch in their Presta ! :D

  • Like 1

Share this post


Link to post
Share on other sites

Hi, 

 

the german translation has a little error for "Invoice To". It means "Rechnungsadresse" and not "Rechnungsnummer" (Invoice number). And can you please write "Mwst" like this: "MwSt."

 

THX

Share this post


Link to post
Share on other sites

Fixed, thank you. It will be a part of v2.0.2.

Share this post


Link to post
Share on other sites

Another Question: How can I change the footer at the invoice?

Share this post


Link to post
Share on other sites

The footer is enclosed between
 

<!--mpdf
    <htmlpagefooter ....>
...
    </htmlpagefooter>
mpdf-->

tags. If you want to create richer layout, use rather table as divs don't work well in the footer (and header as well).

Share this post


Link to post
Share on other sites

Is there a way to create creditslip with M4PDF that include reduction ?

Share this post


Link to post
Share on other sites

I think so. Order discount data are already available for credit slips. Send me (PM) your test order and credit slip together with PrestaShop version and I will try it.

Share this post


Link to post
Share on other sites

Hello,

I PrestaShop 1.5.6.2 with 1.9.5 version M4PDF.

I can not download the update via my account PrestaAddons. I only have version 1.5 available module for PrestaShop 1.1 to 1.4.
How is this possible? Yet I still had my versions M4PDF on addons.

Another thing for my bills, I use the theme "Message from invoices with the customer." Gold on Prestashop 1.5.6.2, clients messages no longer appear on the invoice.
I also like to have the ability to display notes the customer invoice but I can not find the variable. In the invoice file prestashop, I found this variable: {$ order_invoice-> notes | nl2br} but impossible to adapt.

Thank you for your help.

Sincerely, REMS

Share this post


Link to post
Share on other sites

I am afraid there is no free upgrade to v2 of the module bought on Addons. Many customers don't like this upgrade policy. I debated the update issue on the forum - http://www.prestashop.com/forums/topic/325238-upgrade-module-at-addons/?do=findComment&comment=1646104.

 

HOW TO show messages in invoice is at http://www.prestashop.com/forums/topic/270613-module-m4-pdf-extensions-with-online-editor/page-6?do=findComment&comment=1677379

Share this post


Link to post
Share on other sites

its possible generate pdf file with order? but on Order List.

Share this post


Link to post
Share on other sites

Yes and no. You can print a PDF for all orders, not just invoices, from module administration, but there is no option to do the same from Orders.

 

It will be improved later.

Edited by tuk66 (see edit history)

Share this post


Link to post
Share on other sites

Hey guys,

I’ve encountered some problems during the credit note document creation.

 

I used the html code (attached under) but seems not to print the DNI number as the invoice document.

 

{if $orderslip[orderslips].order.customer.dni}<br />{l s='Tax ID number:' mod='m4pdf'} {$orderslip[orderslips].order.customer.dni|escape:'htmlall':'UTF-8'}{/if}

{if $orderslip[orderslips].order.address_invoice.vat_number}<br />{l s='Tax ID number:' mod='m4pdf'}{$orderslip[orderslips].order.address_invoice.vat_number|escape:'htmlall':'UTF-8'}{/if}
Anyone can help? thank you Edited by atomozero (see edit history)

Share this post


Link to post
Share on other sites

Hi,

I'm trying to get hold of the latest update to the module, but it won't update through the back-office. I tried downloading it from addons, but it will only let me download version 1.6.6.

 

Can you email it to me if I give my address by PM?

 

Thanks a lot

Share this post


Link to post
Share on other sites

Hey Vladimir,

 

still using your module, still awesomeness! But since i upgraded to the newest version weird stuff is happening (I am using multi store).

 

1. The translations on the AdminOrder page are not coming through... while i selected customers language and it is still generating my own language (I have searched through all the translation possibilities also in the module itself no luck:(

2. Allot of the times i go to modules page and i find that prestashop thinks it is not installed and i get the option to install it... After a few refreshes the configure button comes back up as if nothing happened. Also, within the module itself below there a configuration box for translations and stuff. There is also a checkbox for activating the module for a shop. But this unchecks itself.

 

Help?

 

Thanks once again!

 

JV

 

edit: i'm on 1.6.0.5

Edited by JaivyDaam (see edit history)

Share this post


Link to post
Share on other sites

Please tell us how to get the latest update... the current version I have isn't working properly (1.9.6).

 

Thanks

Share this post


Link to post
Share on other sites

Hi Vladimir,

 

I'm having calculations error when mass-generating invoices, but it's fine when I'm just generating one. (On a fresh install) Have you got any clue about what's happening ?

 

By the way, a warning shows up when I try to configure the module :

 

  • The shop domain set in "SEO & URLs" or "Multi-store" have to match domain used in your browser

 

And PDF generation only works from one domain (I'm using multistore) so I assume it must be related.

 

Thanks a lot for your module and your help,

 

Martin 

Share this post


Link to post
Share on other sites

Hi Vladimir,

 

I purchase you module and have 2 questions for you  :D

 

01 )

 

I try to add a new column with Total VAT exclude for each product. but without succeed.

 

I notice my  Total with VAT include is :

<td class="align-right">{displayPrice price=$total_price_wt_rounded currency=$order[orders].id_currency}</td>

I used the code under :

<td class="align-right">{displayPrice price=$total_pricewithoutTax currency=$order[orders].id_currency}</td>

Can you help with that ?

 

 

2 ) I use the template invoice with more column and i notice the Basic price is not correct

 

For example : My product cost 100 € (basic price)  - 20 % = 80 € (reduce price )

 

In my invoice , i have : 80 € (reduce price) + 20% = 95 € (basic price )

 

You see what i mean ? :o

 

     {if $order[orders].order_detail[detail].reduction_percent > 0}
                    {assign var="base_price" value="`$order[orders].order_detail[detail].product_price*$order[orders].order_detail[detail].reduction_percent*0.01+$order[orders].order_detail[detail].product_price`"}
                    <td class="align-right">{displayPrice price=$base_price currency=$order[orders].id_currency}</td>
                {elseif $order[orders].order_detail[detail].reduction_amount > 0}
                    {assign var="base_price" value="`$order[orders].order_detail[detail].product_price+$order[orders].order_detail[detail].reduction_amount`"}
                    <td class="align-right">{displayPrice price=$base_price currency=$order[orders].id_currency}</td>
                {else}
                    <td class="align-right">{displayPrice price=$price_rounded currency=$order[orders].id_currency}</td>
                {/if}

Can you help me on this ? :blush:

Edited by CoolerKing (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

When we can generate order pdf on orders list? No invoice, no delivery list.

Share this post


Link to post
Share on other sites

The orders list? There is the Orders section in module administration. Use the Orders template.

Share this post


Link to post
Share on other sites

It is not possible right now but a similar solution is planned.

Share this post


Link to post
Share on other sites

Ok, please make this feature faster because its very important to your many customers :)

Share this post


Link to post
Share on other sites

Coucou Tuk,


 


j'utilise le modèle de facture m4_invoice_4.tpl (en version du module 2.0.6) et je remarque le prix de base n'est pas correcte


En utilisant une règle de prix catalogue par groupe sous presta 1.6.0.6


 


Par exemple: Mon produit coûte 100 € (prix public) - 20% = 80 € (prix réduit)


 


Dans ma facture , avec le module m4pdf, j'ai: 80 € (prix réduit) + 20% = 95 € (prix public)


le prix de base (ou prix public) n'est donc pas bon et je voudrai l "original_product_price " qui lui est bon et qui apparaît sur le le m4_debug.tpl


 


Tu as la solution ?


Merci d'avance


Share this post


Link to post
Share on other sites

Pouvez-vous m'envoyer quelques exemples PDF (des factures et de sortie de débogage) à PM ou e-mail?

 

Can you send me some PDF examples (invoice and debug output) at PM or email?

Share this post


Link to post
Share on other sites

Hi There,

 

I've just purchased M4 and am hoping that you can help me with an installation problem im having.

I admit I'm a newb when it comes to Prestashop but I'm having issues installing the module on Prestashop 1.5.6.2

 

I copy the mpdf folder to my root modules folder but when I do I can no longer access my modules tab in the back office. Instead I recieve the error -

 

mPDF Error - cannot find TTF TrueType font file - /home/ezipetsc/public_html/modules/mpdf/ttfonts/DejaVuSerifCondensed.ttf

 

Obviously its looking for DejaVuSerifCondensed.ttf but the folder is empty. Why?

 

If you can help I'd really appreciate it.

 

Thanks.

 

Karl.

Share this post


Link to post
Share on other sites