vianetz | Software Engineer for Magento®

Magento 2 safe

We guarantee that all extensions will be available for Magento 1 and 2.

7 Days Money Back Garantuee

Within a timeframe of 7 days you are allowed to get the money back from us if you are not confident with our modules.

More Views

Attach Terms And Conditions for Magento 1

€0.00
This free module offers the possibility to attach PDF documents (e.g. Terms And Conditions) to add to Magento order confirmation emails.
* Prices excl. tax. Downloadable products, no shipping costs.

Details

Dieses Modul ermöglicht das Anhängen von PDF-Bestellbedingungen, insb. AGB oder Rückgabebelehrungen an die Bestellungsemails.

In Kombination mit unserem Modul AdvancedInvoiceLayout sind somit die Rechnungsvorgaben z.B. für Trusted Shop Zertifizierungen einzuhalten.

Installations-/Verwendungshinweise
Das Modul sucht nach PDF-Dateien im Verzeichnis media/ der Magento-Installation mit dem Namen der Bestellbedingung und hängt diese automatisiert an die Bestellungsemail an. Es existiert im Moment kein eigene Konfigurationsseite.
Beispiel:
Name der Bestellbedingung unter Verkäufe->Bestellbedingungen: AGB
Das AttachTermsAndConditions sucht nach der Datei media/AGB.pdf und hängt diese an die Bestell-Email an - sofern vorhanden.

Technical Information

Module compatible with Aschroder_SMTPPro, Firegento, Idev_OneStepCheckout, Market Ready Germany, Payone, Vianetz_AdvancedInvoiceLayout, Vianetz_AutomaticInvoice, Vianetz_TaxVatCheck
Language files in this package English - en_US, German - de_DE
Module Version 2.0.3

Technical Information

Module compatible with Aschroder_SMTPPro, Firegento, Idev_OneStepCheckout, Market Ready Germany, Payone, Vianetz_AdvancedInvoiceLayout, Vianetz_AutomaticInvoice, Vianetz_TaxVatCheck
Language files in this package English - en_US, German - de_DE
Module Version 2.0.3
There is no warranty, that the information in documents on this website and related ones are complete, correct and up-to-date in every case. The consultation of a legal practitioner is always recommended.
Completely all the features mentioned on this site are only available for the latest Magento version. Former Magento releases may have a lack of some functionalities.
If the functionality of modules from other vendors intersect with this one, unpredictable issues may arise.
Please get informed about our License Agreement and our thinking about Commercial Open Source.


Are there any more information about our Magento Extension that you would like to see here? Just contact us.

Frequently Asked Questions

Can I get a license for my development/staging domain?

These licenses are included in every production domain license. Please send us after your purchase for your production domain an email with your order number and the desired development domain. We're happy to extend your license then.

DHL Location Finder Extension: Post number is printed multiple times in address

If you are using our Advanced Invoice Layout Extension with the DHL Extension Dhl_LocationFinder it may happen that if you have added the post number in the shipping address with the variable

{{var dhl_post_number}}
you will see the following output on the PDF invoice or shipment document:
Postnumber: Postnumber: Postnumber: Postnumber: Postnumber: Postnumber: Postnumber: Postnumber: 32403197

This issue happens due to a small bug in the DHL Extension that listens to the Magento event customer_address_format and adds the "Postnumber: " prefix. But as this event can occur multiple times (as it will within the Advanced Invoice Layout extension) the prefix is also added multiple times.

As this is not the desired behaviour you can patch the method Dhl_LocationFinder_Model_Observer::addPostNumberLabel() to only add the prefix once:

public function addPostNumberLabel(Varien_Event_Observer $observer)
    {
        $address = $observer->getData('address');
        $postNumberLabel = Mage::helper('dhl_locationfinder/data')->__('Postnumber: ');
        if ($address->getData('dhl_post_number') && strpos($address->getData('dhl_post_number'), $postNumberLabel) === false) {
            $postNumberString = $postNumberLabel . $address->getData('dhl_post_number');
            $address->setData('dhl_post_number', $postNumberString);
        }
    }

Please note that this was tested with Dhl_LocationFinder extension version 1.0.3.

Error message "Mage registry key already exists" after extension installation
After installing a Magento extension you get the following error message, e.g. if you try to login the Magento admin backend:
Mage registry key <...> already exists


Solution:
Please confirm that you followed all installation steps that are mentioned in the Readme file of the module. Especially assure that the Magento cache is cleared, e.g. by emptying the var/cache/ directory in a Magento default installation and that the Magento compilation process has been triggered (if enabled).
How can I activate the PDF email attachment feature with other email extensions like Ebizmarts_Mandrill?

Important note

This issue is resolved in AdvancedInvoiceLayout Version 2.2.0. Please contact us to check if you can upgrade.

Short explanation

To realize the email attachment functionality in our AdvancedInvoiceLayout extension we had to extend the Magento core email logic to add methods for attaching documents. Unfortunately there is no way to do this without conflicts with other extensions that do the same, e.g. Ebizmarts_Mandrill or Aschroder_SMTPPro.

Solution

To solve this problem the following manual steps are required:

  • Make the AdvancedInvoiceLayout extension dependant on the other extension by creating a new file app/etc/modules/ZVianetz_AdvancedInvoiceLayout_Compatibility.xml with the following content (replace OtherVendor_OtherExtension with the extension name)
    
    
        
            
                
                    
                
            
        
     
    
  • Copy the file app/code/community/Vianetz/AdvancedInvoiceLayout/Model/Email/Template to app/code/local/Vianetz/AdvancedInvoiceLayout/Model/Email/Template and replace the beginning with
    Vianetz_AdvancedInvoiceLayout_Model_Email_Template extends Ebizmarts_Mandrill_Model_Email_Template
    
  • Flush the Magento Cache

Please find also further general discussions in this support thread.

How can I change the font family in the Magento PDF invoice?

With our AdvancedInvoiceLayout extension it is easy to change the font family in the Magento PDF invoice.
Therefore the AdvancedInvoiceLayout extensions ships with several default fonts which you can choose from:
Courier, DejaVu Sans, Helvetica, Times

Due to licensing issues it is not possible to add other font families by default but you can also easily add your own font family with the following steps:

If you want to use Internet Fonts, e.g. Google Fonts

(Note: this supported by our Advanced Invoice Layout Extension for Magento 1 from version 2.3.16 or newer or for Magento 2)
Additional fonts can easily be embedded via CSS, e.g. with Google Fonts:
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
body { font-family: Roboto !important };

If you want to use local fonts, e.g. in TTF format

Advanced Invoice Layout for Magento 1 with version 2.3.16 or newer

You have to download the load_font.php utility from GitHub to the folder lib/dompdf-advancedinvoicelayout/ and change the third line of the file to

require_once "autoload.inc.php";
Then change into the directory lib/dompdf-advancedinvoicelayout.

Advanced Invoice Layout for Magento 2

You simply have to download the load_font.php utility from GitHub to the Magento root folder.

  • Then you need to make sure that the used DomPDF library gets to know the new font by executing the following command in the Magento root directory (replace MyFont with your desired font):
    php -f load_font.php 'MyFont' /path/to/myfont
  • Finally you can use the font in your CSS with
    font-family: MyFont;
    

Advanced Invoice Layout for Magento 1 with version 2.3.15 or older
  • You need to temporarily rename the file lib/dompdf/dompdf_config.custom.inc.php to something else.
  • Then change into the directory lib/dompdf-advancedinvoicelayout.
  • Execute the above mentioned load_font.php command.
  • Afterwards inject the new font into the XML config object (see app/code/community/Vianetz/AdvancedInvoiceLayout/etc/config.xml) by extending the XML node default/advancedinvoicelayout/fonts, e.g.
    <verdana title="Verdana"/>
    
    The node title must match the generated file in step 2.

And that's it. Now you can choose the new font family in the configuration section under System > Configuration > AdvancedInvoiceLayout.


For further explanations see also the PDF Library documentation about About Fonts and Character Encoding.

How can I create different PDF invoice layouts for different Magento store views?

With our Advanced Invoice Layout Extension for Magento you can easily create store view specific layouts, texts, logos or colors. Therefore you can easily change the store view switcher on the Advanced Invoice Layout configuration page in the Magento backend.

If you want further more layout customizations to the HTML files there are 2 possibilities:

  • If you use already different Magento themes you can easily do the customizations in the appropriate theme folder (please also see our FAQ entry How to change the Magento PDF invoice layout?). I.e. you just do the customizations e.g. in app/design/frontend/theme1/default/advancedinvoicelayout and app/design/frontend/theme2/default/advancedinvoicelayout.
  • Additionally there is the possibility (e.g. if you use the same theme for both store views) to create own themes in the Advanced Invoice Layout extension.
How can I customize the Magento 1 PDF invoice layout?

With our Magento Extension Advanced Invoice Layout it is very easy to create individual layouts for Magento PDF invoices, shipments and creditmemos.

Want to see some examples? Check out some sample invoice layouts from our customers.

The extension ships with a base HTML layout that already fits for many cases. Furthermore we will release more enhanced step by step so that you can customize the PDF layout without any effort.

Your own customizations can be done with HTML/CSS. The appropriate files are in the following directories
  • app/design/frontend/base/default/template/advancedinvoicelayout/default
  • skin/frontend/base/default/advancedinvoicelayout/default/css

We recommend to do your own customizations within these files in your custom theme folder to avoid loosing changes in case that the Extension got an upgrade.
I.e. assuming that your Magento theme is in folder app/design/frontend/MYTHEME/default/ and you want to customize the invoice layout we recommend to copy the file app/design/frontend/base/default/template/advancedinvoicelayout/invoice.phtml to app/design/frontend/MYTHEME/template/default/advancedinvoicelayout/invoice.phtml.

For more experienced users we also deliver SASS files that allows an easier modification of e.g. colors in the whole document.

Please see also how to customize the payment block in the Magento PDF invoice.

Basically it is always recommended to activate the Debug Mode of the AdvancedInvoiceLayout extension for testing different layouts under System > Configuration > AdvancedInvoiceLayout. With activated Debug Mode the intermediate HTML file will be saved with each print of the PDF invoice, shipment or creditmemo into the directory var/tmp/invoice_debug.html. Therewith you can analyze and customize the HTML structure and CSS style sheets more easily.
However you are advised to disable this setting in production environments for performance reasons.

Please see also the available variables.

How can I customize the payment block in the Magento PDF invoice?
The AdvancedInvoiceLayout Extension prints a block with information about the chosen payment method onto the PDF invoice. This block is dynamically filled by the used Magento Payment Extension, e.g. PayPal, DebitPayment, Credit Card, etc. and so this is information is contained in the appropriate Extension files. For example for PayPal the payer email address is printed, for credit cards the credit card number and so on.

So if we want to customize e.g. the text/formatting that is printed on the invoice in case of "Purchase Order" payments we have to do the following steps:
  • copy file app/design/frontend/base/default/template/payment/info/purchaseorder.phtml to your theme folder i.e. app/design/frontend//default/template/payment/purchaseorder.phtml
  • customize the file to your needs

Basically it is always recommended to activate the Debug Mode of the AdvancedInvoiceLayout extension for testing different layouts under System > Configuration > AdvancedInvoiceLayout. With activated Debug Mode the intermediate HTML file will be saved with each print of the PDF invoice, shipment or creditmemo into the directory var/tmp/invoice_debug.html. Therewith you can analyze and customize the HTML structure and CSS style sheets more easily.
However you are advised to disable this setting in production environments for performance reasons.

This process can be done analoguous for other payment methods as well.

Please see also how to customize the Magento PDF layout in general.

How can I display the Amazon Order Id on the Magento PDF invoice?
If you use the Magento Extension M2EPro you can easily display the Amazon Order Id on the Magento PDF invoice with our Advanced Invoice Layout Extension with the following code:
echo Mage::helper('M2ePro/Component_Amazon')->getModel('Order')
->load($this->getOrder()->getId(), 'magento_order_id')
->getChildObject()->getAmazonOrderId();
You can find more information in our FAQ on how to customize the templates.
How can I install the vianetz Magento extensions via composer?

Of course you can also install our proprietary Magento extensions via composer.
Therefore please follow these steps:

  • Contact us to get your access credentials. You will receive the repository URL, a username and a password.
  • Add this to your composer.json file:
    "repositories": [{
        "type": "composer",
        "url": "https://packages.vianetz.com"
    }]
    
  • In your Magento installation type composer require vianetz/module-advancedinvoicelayout and enter the credentials that we provided to you.
How can I move the logo on the Magento PDF invoice to the left?

If you use our extension Advanced Invoice Layout for Magento it is very easy to move the logo on the PDF documents (invoice/shipment/creditmemo) to the left or right. Just enter the following CSS snippet into System > Configuration > Advanced Invoice Layout > Custom CSS to move the logo to the left:

#header #storeLogo { text-align: left; }
How can I print barcodes on the Magento PDF invoice?
With our Advanced Invoice Layout Extension for Magento it is very easy to print barcodes of any code on the Magento PDF invoice, shipment or creditmemo.
All you have to do is to choose a font family that supports your desired barcode format and use that in the Advanced Invoice Layout CSS file for printing the barcode. Voilà!

See also our FAQ article on how to customize the PDF invoice layout.

How can I print the telephone number on the Magento pdf invoice?

Printing the telephone number of the customer on the Magento pdf invoice, shipment or creditmemo is very easy with our Advanced Invoice Layout Extension.

All you have to do is go to System > Configuration > Customer Configuration > Address Templates and in the field Advanced Invoice Layout PDFs add the following variable:

{{var telephone}}

This field accepts HTML source code, i.e. you can add line breaks (<br>) or plain text as you like.

How can I run the unit tests for your extension?
The unit tests of our extensions are based on the EcomDev_PHPUnit module that can be found on Github.
For installation instructions please see the appropriate manual.

After installation of the EcomDev_PHPUnit extension you can run e.g. the AdvancedInvoiceLayout tests by the following command in the root folder of your Magento installation:
phpunit --group Vianetz_AdvancedInvoiceLayout


If everything is fine you should get a green output that says that all tests ran successfully.
How can I send Magento invoice/shipment emails to store owner only?
With our AutomaticInvoice extension you can send invoice emails to store owner exclusively (i.e. not to the customer). Therefore you have to set the following configurations:
  • System > Configuration > AutomaticInvoice > Invoice > Notify Customer: No
  • System > Configuration > Sales Emails > Invoice > Send Order Copy Method: Separate Email


The same applies to shipment emails as well:
  • System > Configuration > AutomaticInvoice > Shipment > Notify Customer: No
  • System> Configuration > Sales Emails > Shipment > Send Order Copy Method: Separate Email
How can I show additional text in tax-free PDF invoices in Magento?

Our Advanced Invoice Layout Extension for Magento allows you to have customer group specific texts on the PDF invoice document.
Therefore on the customer group configuration page in the Magento admin panel there is an additional text field where you can enter HTML-text that will be displayed on PDF invoices if the customer is contained in that customer group.

The automatic group assignment is a standard Magento feature which is explained in more detail in the Magento Documentation.
How can I show custom attributes on the Magento invoice?
With our Advanced Invoice Layout Extension for Magento 1 it is very easy to display custom product attributes on the Magento PDF invoice, shipment or creditmemo.

Therefore the extension has a configuration setting where you can easily select which product attributes you want to show on the invoice, shipment and creditmemo PDF:

Show custom attributes on invoice, shipment or creditmemo PDF in Magento

If you want to display custom product attributes with our Advanced Invoice Layout Extension for Magento 2 you can add custom attributes to the PDF invoice by adding the following code to the theme template file default/item/invoice.phtml:

echo $this->getProduct()->getData('your_attribute_code');

The sample applies also for the shipment and creditmemo PDF documents.

How to install the Magento 1 extension?
Please find as follows a short overview how to install our Magento extensions, using the sample of the AdvancedInvoiceLayout extension:

Preparations:

  • Do a backup of your Magento installation for safety reasons (database and files).
  • Disable Magento compilation feature (if activated): System->Tools->Compiler
  • Uninstall probably existing previous versions of the extension



Installation

  • 1Unzip the setup package and copy the contents of the src/ folder into the Magento root folder. (The folder structure is the same as in your Magento installation (e.g. app/, skin/, ..). No files will be overwritten.)
    Please assure that the files are uploaded with the same file user permissions as the Magento installation!
  • 2 Clear the Magento cache (z.B. System->Cache Management) and related caches if available (e.g. APC, Varnish, ..).
  • 3 Logout from the admin panel and then login again.


Congratulations, the installation has been successfully completed!

How to install the Magento 2 extension?
Please find as follows a short overview how to install our Magento 2 extensions, using the sample of the Advanced Invoice Layout for Magento 2 extension:

Are you looking for installing the extensions on Magento 1? Then please have a look at our related FAQ article.

Do you want to install the extension via composer? Please see our FAQ article about installing with composer.

Preparations:

  • Make sure that "composer" is installed on your system. For details see these composer installation instructions.
  • Get your Magento API access keys (required for composer authentication) , as described in the Magento documentation.
  • Do a backup of your Magento installation for safety reasons (database and files).
  • Uninstall probably existing previous versions of the extension



Installation with Composer

  • 1 Create a new folder for the extension in app/code/, e.g. app/code/Vianetz/AdvancedInvoiceLayout.
  • 2 Unzip the setup package and copy the contents into the newly created folder. The folder structure should now be app/code/Vianetz/AdvancedInvoiceLayout/Block, app/code/Vianetz/AdvancedInvoiceLayout/etc, etc.
    Please assure that the files are uploaded with the same file user permissions as the Magento installation!
  • 3 Install extension requirements via composer on the command line in your Magento root directory:
    composer require vianetz/pdf-generator:1.* vianetz/module-core:1.*
    
    Note: If you use e.g. an older PHP version on the command line than on your webserver then you can add the command line argument --ignore-platform-reqs to ignore PHP version checks.
  • 4 Enable the Extension and run the setup process by executing the following on the command line in your Magento root directory:
    bin/magento module:enable Vianetz_Core Vianetz_AdvancedInvoiceLayout
    bin/magento setup:upgrade
    
  • 5 Restart compilation (only required in Magento Production mode):
    bin/magento setup:di:compile
    
  • 6 Clear the Magento cache (e.g. System > Cache Management) and related caches if available (e.g. APC, Varnish, ..).


Congratulations, the installation has been successfully completed!

How to migrate Advanced Invoice Layout templates from Magento 1 to Magento 2?
If you use our Advanced Invoice Layout extension for Magento 1 and you want to migrate your shop to Magento 2, there are a few simple steps to make the invoice, packing slips and creditmemo PDF look nice:
  • Purchase the Advanced Invoice Layout extension for Magento 2
  • Copy all your template files from the Magento 1 extension from app/design/frontend/base/default/template/advancedinvoicelayout to the Magento 2 extension in view/base/templates/
  • Copy all the CSS files from Magento 1 from skin/frontend/base/default/advancedinvoicelayout to the Magento 2 extension in view/base/web/
  • Replace all occurrences of
    $this->__(
    with
    $this->translate(
How to translate the Magento PDF invoice?

With our AdvancedInvoiceLayout extension you are able to customize the Magento default PDF invoice layout to adapt it to your needs and improve the look'n'feel of the invoice.
Therefore you can also easily add your own translations (of course this in accordance to Magento best practices):

  • Identify the text string that you want to translate in the template files in app/design/frontend/base/default/template/advancedinvoicelayout, e.g. the string "Invoice #%s" in app/design/frontend/base/default/template/advancedinvoicelayout/default/invoice.phtml
  • Search for this text string in file app/locale/xx_XX/Vianetz_AdvancedInvoiceLayout.csv with xx_XX being the locale code, e.g. "de_DE".
  • If the text string is available just change the translation to your needs, otherwise add a new line at the end of the file with your translation like
    "Invoice #%s","Ihre Rechnung Nr. %s"
  • Flush the Magento Cache in the backend
I get a "404"-Error after the installation of the extension
Symptom: A 404 error is shown if you go to System->Configuration and choose e.g. AdvancedInvoiceLayout tab.

To solve this kind of error you need to log out of the backend and log in again. Then the tab should be successfully accessible.
I get the error message "There has been an error processing your request". What can I do?
Please take a look at the var/report directory and look for a file with the number mentioned in the error report. This file contains additional information about the problem. If you do not have a solution for this please send us the contents of the file to support@vianetz.com.
Magento shows a Blank Page
While executing some actions Magento is only showing a blank page without any content.
This behaviour is mostly caused by a Fatal PHP error. Please have a look into your PHP log files (perhaps ask your hoster) and/or see the Magento error log in the directory var/log of your Magento installation.
What can I do if Magento invoice emails are not sent anymore?
If you use our AutomaticInvoice Extension and invoice emails are not sent anymore please check the following points:
  • Please check the configuration at System > Configuration > Automatic Invoice:
    Is the Automatic Invoice Extension activated and are the checkboxes for "Generate Invoice" and "Notify Customer" triggered for the specific payment method?
  • Has the Magento invoice document been generated for the specific order and is it flagged as "invoice email sent"?
  • Which Magento Extension is used for the payment method? Perhaps it uses itself a mechanism for generating invoice document and sending the invoice email. Then perhaps it is better to exclude it from the Automatic Invoice generation.
  • Are there any error messages in the Magento and/or Automatic Invoice log files in var/log/?
What kind of variables are available in AdvancedInvoiceLayout configuration?
For salutations, footer columns and other free texts in the Magento PDF invoices, shipments and creditmemos, the following variables are available in System > Configuration > AdvancedInvoiceLayout.

Please note: Simple existence of a variable can be checked with {{depend shipping_date}}, negations can be used with {{if is_shipment}}{{else}}No Shipment{{/if}}.
Variable/ExpressionExplanation
{{var increment_id}}Invoice/Shipment/Creditmemo Increment Id
{{var customer_id}}Customer Id
{{var order.getIncrementId()}}Order Id (all other order attributes can also be accessed with the order object)
{{var increment_id}}Invoice/Shipment/Creditmemo Increment Id
{{depend is_invoice}}
Text only for invoices
{{/depend}}
"Text only for invoices" will only be shown on invoice PDFs.
{{depend is_shipment}}
Text only for shipments
{{/depend}}
"Text only for shipments" will only be shown on shipment PDFs.
{{depend is_creditmemo}}
Text only for creditmemos
{{/depend}}
"Text only for creditmemos" will only be shown on creditmemo PDFs.
{{var billing_address}}Billing Address of Order (formatting can be configured)
{{var shipping_address}}Shipping Address of Order (formatting can be configured)
{{date}}Date of invoice/shipment/creditmemo creation (formatted in your locale)
{{date+X}}Date of invoice/shipment/creditmemo creation plus specified number of days, e.g. for specifying due/delivery dates.
(Replace "X" with number of days)
{{var prefix}}Customer Prefix
{{var firstname}}Customer Firstname
{{var lastname}}Customer Lastname
{{var shipping_date}}The date of the first shipment (if any)
{{var payment_method.getTitle()}}The payment method title
{{if payment_method_purchaseorder}}
Only for invoices with payment method purchase order.
{{else}}For all other payment methods.{{/if}}
With this statement you can insert text that is dependent on the payment method, in this example purchaseorder. Just replace the text "purchaseorder" with your payment method code, e.g. "checkmo", "banktransfer", "payone", ..


If you have the extension Firegento_MageSetup installed the following additional variables are available:

Variable/ExpressionExplanation
{{var merchant_tax_number}}The configured tax number of the merchant
{{var merchant_vat_number}}The configured vat number of the merchant
{{var bank_account}}The configured bank account
{{var bank_code_number}}The configured bank code number
{{var bank_name}}The configured bank name
{{var swift}}The configured swift number
{{var iban}}The configured iban number
Which data should I submit for a support request to vianetz?

Please send us the following data to help you answer your support request.

  • used extension version (e.g. AdvancedInvoiceLayout 2.0.13)
    You can find the extension version in the configuration section e.g. in System > Configuration > AdvancedInvoiceLayout
  • domain on which you are using the extension and which produces the problem
  • Magento version

Furthermore if we should support you within our installation support, please provide us with the following details:

  • FTP/SSH access (username, password and path to Magento installation directory)
  • Magento Backend access (username, password and URL)


Please verify that all access data is working properly, especially if the Magento user has the correct group to login and view all relevant areas and the FTP user has write access to all folders of the Magento installation.
All data is kept confidentially.

Which domain name should I type in?

Please specify your exact production domain name of your Magento installation, i.e. including www. (if exists) and without leading http://.

Examples: www.vianetz.com, subdomain.example.com

You have a question that is not listed here?

We recommended this extension to combine with the following extension(s)