19
global_pdf version BoostMyShop octobre 21, 2020

global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

global_pdf

version

BoostMyShop

octobre 21, 2020

Page 2: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable
Page 3: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable
Page 4: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

Contentsglobal_pdf 1

1. Overview 1

2. Installation 1

Installation 1

Basic test 1

How to disable the extension ? 3

3. Configuration 3

General 4

Date 5

4. How to use 5

1. Improved Invoice PDF 5

2. Improved packing slip PDF 5

3. Improved credit memo PDF 5

4. Print product sheet 5

5. Print the cart item 5

6. Build PDF catalog 5

5. Customization template 6

1. Create a new theme 6

2. Templates 6

3. Syntax rules 6

4. Template Items 6

5. Edit template 7

Add an image into a PDF 8

Manage a new page 8

6. Add a variable 8

6. Usable code 9

1. General 9

2. Product 9

3. invoice 10

4. Credit memo 11

5. Cart 12

6. Order 12

7. Order - Invoice - Credit memo 13

8. Purchase order 13

7. FAQ 14

Remove print button on order + shipment + invoice admin page ? 14

How to display product qty on frontend PDF product ? 15

How to remove the Frontend “Print” button ? 15

Change the total incl tax into excl tax in the invoice PDF ? 15

Fatal error: Call to a member function getResource() on a non-object 15

Page 5: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

Fatal error: Call to a member function getElementsByTagName() on a non-object 15

Available date parameters 15

Page 6: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable
Page 7: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

global_pdf

1. OverviewGlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones:

• Fully customizable invoices, packing slip, credit memo

• Automatically generate PDF from product sheet : Global PDF supports simple, configurable and bundleproducts with custom options

• New PDF to allow customer to print its cart

• New PDF to print order

• Product PDF catalog generator : select products from a category or from scratch and create a PDF catalog

All PDF are fully customizable using human readable XML templates.

2. Installation

Warning

Before uploading files, enable Magento caches (System - Cache Management), this will prevent Magento to tryto install extension before all files are uploaded.

If you have any : APC cache, Memcache, Rediscache, please disabled them.

Also, if Magento’s compilation (System - Tools - Compilation) is enabled, please disabled it.

InstallationYou just need to upload the extension file structure to your server on the same file structure provided by Magento.

Note

All code files will be available into app/code/community/MDN

Once all files are uploaded, please follow these steps to make sure it is well installed:

• Refresh caches (System - Cache Management).

• Refresh indexes (System - Index Management).

• Logout and login yourself from Magento’s back office.

If you don’t get any error message at this stage, go to the next step to configure your extension !

Basic testOnce the configuration page has been saved.

Go in Sales > Invoices, select an invoice and click on button “Print”

You must see a PDF like this one

global_pdf

1

Page 8: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

Note

Don’t worry about the black square this mean the Company logo has not been saved in the configuration page asthis is not a required settings.

global_pdf

2

Page 9: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

How to disable the extension ?Edit MDN_GlobalPDF.xml in app/code/etc/modules

Change True by False.

Save the file, and Refresh your caches (System - Cache Management).

3. ConfigurationAll settings are available using menu

Warning

If you get an error message (access denied), you need to logout and login to Magento Admin panel to resetpermission.

3. Configuration

3

Page 10: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

General

Field Value

Theme Directory name to use for xml templates (for more information, please read “Customize PDF”section)

company name Set the name of your company it will be dispalyed in the PDF

Logo Picture to display in PDF headers (use jpg or png format)

Store Address Your postal address (displayed on invoices, shipments and credit memo

Legal information Text displayed in PDF footer

Debug mode If enabled, display every PDF item areas for purpose

Enable cache Improve product PDF generation time

Convert gif tojpeg

if set to yes it will convert the giff extension image into jpeg to make the PDF imagecompatible

3. Configuration

4

Page 11: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

Use magento font Set to yes, if you want to use Magento font instead of global pdf font ( helvetica )

Date

Note

Check FAQ section for more informations about “Available date parameters”.

Field Value

Short format Define the date format for the short printing mode

Medium format Set the date format for the medium printing mode

Long format Define the date format for the long printing mode

4. How to use

1. Improved Invoice PDFTo view invoice PDF, print an invoice using menu

Sales > Invoices > [Select an invoice] > Print button.

2. Improved packing slip PDFTo view packing slip PDF, print a shipment using menu

Sales > Shipments > [Select a shipment] > Print button.

3. Improved credit memo PDFTo view credit memo PDF, print a credit memo using menu

Sales > Credit Memo > [select a credit memo] > Print button.

4. Print product sheetOn the front side, select any product and click on the “Print” button (close to the “Add to cart” button).

5. Print the cart itemOn the front side, add any product and once your are on the cart page, click on the “Print” button (close to the “Placeorder”).

6. Build PDF catalogWith Global PDF, you can easily build a PDF catalog with selected products.

4. How to use

5

Page 12: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

To create a catalog, select menu Catalog > Build PDF catalog

Fill in catalog name, select a category or manually select product using the bottom grid and then, click on the “BuildCatalog” button.

5. Customization template

1. Create a new themeFollow these instructions

1. Create a new “my_theme” directory in /media/GlobalPDF/

2. Copy all /media/GlobalPDF/default files in your “my_theme” directory

3. Enable your theme in System > Configuration > Global pdf > Theme

Note

Here my_theme is your custom theme name.

2. TemplatesTemplates are xml files used to generate the PDF files, and located by default in /media/GlobalPdf/default

• header.xml : template for all pdf header

• footer.xml : template for all pdf footer

• shipment.xml : template for packing slip pdf

• product.xml : template for product pdf

• order.xml : template for order pdf

• invoice.xml : tempate for invoice pdf

• creditmemo.xml : template for creditmemo pdf

• catalog.xml : template for the first product catalog page

• cart.xml : template for cart pdf

3. Syntax rules

• {xxx} : used to print a dynamic value.

For example, {name} return product name in the product PDF.

• [xxx] : used to translate a label.

For example, [invoice] will be converted to “facture” if website is in french.

4. Template ItemsYou can use items in templates to draw picture, rectangle, text… Here are the different available items :

Rectangle

• Description : Draw a rectangle

• Attributes :

• border : border size

• bordercolor : border color

5. Customization template

6

Page 13: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

• bgcolor : background color

• Sub items : zindex, position, size

Text

• Description : Draw a single text

• Attributes :

• value : text to draw

• Sub items : zindex, position, size, font

Img

• Description : insert a picture

• Attributes :

• src : picture server path

• mode : “Zoom” keep product proportion, use “shrink” to fit picture to area

• Sub items : zindex, position, size

If

• Description : Draw items if condition is true

• Attributes :

• condition : condition to test (you can use {values} operator : comparison type : use “neq” for different,“eq” for equal

• value : value to compare in condition

• Sub items :all items

Method

• Description : Call a PDF function

• Attributes :

• name : method to call : increment_y, increment_x, set_x, set_y, set_store, set_footer_height

• value : method parameter

• Sub items : none

Multitext

• Description : Draw multi line text

• Attributes :

• value : text to print increment_y : if 1, the system will increase y value using text height

• max_lines : max lines to draw

• Sub items : zindex, position, size, font

Repeater

• Description : Used to loop on collection (for example, used to print order items)

• Attributes :

• source : collection to use

• max_occurences : max time to loop

• Sub items :all items

5. Edit template

5. Customization template

7

Page 14: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

Note

It’s highly recommended to create a new custom theme instead of edit the default Global PDF theme.

Add an image into a PDF

1. Edit the php file of the desired PDF like, for exampleapp/code/community/MDN/GlobalPDF/Model/Pdf/Order/Invoice.php

2. Add following code

$data['my_image'] = '/your_complete_ftp_path/skin/frontend/[theme]/[design]/images/image.png';

Where [theme]/[design] are the theme and design folders of your actual magento template.

before the line

return data;

Note

You can rename “image.png” to put your own image name.

3. Go into the targeted XML file like invoice.xml then add this code :

<img src="{my_image}" mode="zoom"> <zindex value="1" /> <position lef="320" top="20" mode="relative" /> <size width="260" height="90" /></img>

Manage a new page

Two possibilities if you want to manage a new page into the targeted XML like invoice.xml

1. Allow a multitext zone to go to the next page if it grows too.

2. Check the Y position, and get on the next page.

6. Add a variableLet’s say, we want to add a new variable in the invoice PDF.

Edit app/code/community/MDN/GlobalPDF/Model/Pdf/Order/Invoice.php

Search for setTemplateData function and add inside:

$data['my_custom_data'] = //some code

Then in the XML file, media/GlobalPdf/default/invoice.xml

You will be able to use the new variable with {my_custom_data}

5. Customization template

8

Page 15: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

6. Usable code

1. General

Field Value

current_store_id current store id

store_address Store address (set in System > Configuration > GlobalPDF)

legal_information Legal information (set in system > configuration >Global PDF)

logo Logo path (set in System > Configuration > GlobalPDF)

globalpdf_image_directory Current theme image directory

catalog_image_directory Magento product image directory

store_currency Currency for current store

2. Productentity_id, entity_type_id, attribute_set_id, type_id, sku, has_options, required_options, created_at, updated_at,exclude_from_supply_needs, external_logistic_run_id, sent_to_logistic_company, name, meta_title,meta_description, image, small_image, thumbnail, url_key, url_path, custom_design, page_layout,options_container, image_label, small_image_label, thumbnail_label, gift_message_available, price, special_price,cost, weight, status, tax_class_id, is_recurring, visibility, enable_googlecheckout, is_imported, default_supply_delay,allow_individual_quote_request, description, short_description, meta_keyword, custom_layout_update,special_from_date, special_to_date, news_from_date, news_to_date, custom_design_from, custom_design_to,media_gallery, tier_price, tier_price_changed, stock_item, is_in_stock, is_salable, additional_images,custom_options, has_custom_options, additional_information, has_additional_information, configurable_attributes,configurations, has_configurations, bundle_items, has_bundle_items

Note

You can also use any custom product attribute

6. Usable code

9

Page 16: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

3. invoiceinvoice.entity_id, invoice.store_id, invoice.base_grand_total, invoice.shipping_tax_amount, invoice.tax_amount,invoice.base_tax_amount, invoice.store_to_order_rate, invoice.base_shipping_tax_amount,invoice.base_discount_amount, invoice.base_to_order_rate, invoice.grand_total, invoice.shipping_amount,invoice.subtotal_incl_tax, invoice.base_subtotal_incl_tax, invoice.store_to_base_rate,invoice.base_shipping_amount, invoice.total_qty, invoice.base_to_global_rate, invoice.subtotal,invoice.base_subtotal, invoice.discount_amount, invoice.billing_address_id, invoice.is_used_for_refund,invoice.order_id, invoice.email_sent, invoice.can_void_flag, invoice.state, invoice.shipping_address_id,invoice.cybersource_token, invoice.store_currency_code, invoice.transaction_id, invoice.order_currency_code,invoice.base_currency_code, invoice.global_currency_code, invoice.increment_id, invoice.created_at,invoice.updated_at, invoice.hidden_tax_amount, invoice.base_hidden_tax_amount,invoice.shipping_hidden_tax_amount, invoice.base_shipping_hidden_tax_amount, invoice.shipping_incl_tax,invoice.base_shipping_incl_tax, order.entity_id, order.state, order.status, order.coupon_code, order.protect_code,order.shipping_description, order.is_virtual, order.store_id, order.customer_id, order.base_discount_amount,order.base_discount_canceled, order.base_discount_invoiced, order.base_discount_refunded,order.base_grand_total, order.base_shipping_amount, order.base_shipping_canceled,order.base_shipping_invoiced, order.base_shipping_refunded, order.base_shipping_tax_amount,order.base_shipping_tax_refunded, order.base_subtotal, order.base_subtotal_canceled,order.base_subtotal_invoiced, order.base_subtotal_refunded, order.base_tax_amount, order.base_tax_canceled,order.base_tax_invoiced, order.base_tax_refunded, order.base_to_global_rate, order.base_to_order_rate,order.base_total_canceled, order.base_total_invoiced, order.base_total_invoiced_cost,order.base_total_offline_refunded, order.base_total_online_refunded, order.base_total_paid,order.base_total_qty_ordered, order.base_total_refunded, order.discount_amount, order.discount_canceled,order.discount_invoiced, order.discount_refunded, order.grand_total, order.shipping_amount,order.shipping_canceled, order.shipping_invoiced, order.shipping_refunded, order.shipping_tax_amount,order.shipping_tax_refunded, order.store_to_base_rate, order.store_to_order_rate, order.subtotal,order.subtotal_canceled, order.subtotal_invoiced, order.subtotal_refunded, order.tax_amount, order.tax_canceled,order.tax_invoiced, order.tax_refunded, order.total_canceled, order.total_invoiced, order.total_offline_refunded,order.total_online_refunded, order.total_paid, order.total_qty_ordered, order.total_refunded,order.can_ship_partially, order.can_ship_partially_item, order.customer_is_guest, order.customer_note_notify,order.billing_address_id, order.customer_group_id, order.edit_increment, order.email_sent,order.forced_do_shipment_with_invoice, order.gift_message_id, order.payment_authorization_expiration,order.paypal_ipn_customer_notified, order.quote_address_id, order.quote_id, order.shipping_address_id,order.adjustment_negative, order.adjustment_positive, order.base_adjustment_negative,order.base_adjustment_positive, order.base_shipping_discount_amount, order.base_subtotal_incl_tax,order.base_total_due, order.payment_authorization_amount, order.shipping_discount_amount,order.subtotal_incl_tax, order.total_due, order.weight, order.customer_dob, order.increment_id,order.applied_rule_ids, order.base_currency_code, order.customer_email, order.customer_firstname,order.customer_lastname, order.customer_middlename, order.customer_prefix, order.customer_suffix,order.customer_taxvat, order.discount_description, order.ext_customer_id, order.ext_order_id,order.global_currency_code, order.hold_before_state, order.hold_before_status, order.order_currency_code,order.original_increment_id, order.relation_child_id, order.relation_child_real_id, order.relation_parent_id,order.relation_parent_real_id, order.remote_ip, order.shipping_method, order.store_currency_code,order.store_name, order.x_forwarded_for, order.customer_note, order.created_at, order.updated_at,order.total_item_count, order.customer_gender, order.hidden_tax_amount, order.base_hidden_tax_amount,order.shipping_hidden_tax_amount, order.base_shipping_hidden_tax_amount, order.hidden_tax_invoiced,order.base_hidden_tax_invoiced, order.hidden_tax_refunded, order.base_hidden_tax_refunded,order.shipping_incl_tax, order.base_shipping_incl_tax, order.stocks_updated, order.fullstock_date,order.estimated_shipping_date, order.payment_validated, order.is_valid, order.anounced_date,order.anounced_date_max, order.external_logistic_run_id, order.sent_to_logistic_company, order.logistic_status,order.billing_address, order.shipping_address, order.payment_method, invoice.items, invoice.history

6. Usable code

10

Page 17: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

4. Credit memocreditmemo.entity_id, creditmemo.store_id, creditmemo.adjustment_positive,creditmemo.base_shipping_tax_amount, creditmemo.store_to_order_rate, creditmemo.base_discount_amount,creditmemo.base_to_order_rate, creditmemo.grand_total, creditmemo.base_adjustment_negative,creditmemo.base_subtotal_incl_tax, creditmemo.shipping_amount, creditmemo.subtotal_incl_tax,creditmemo.adjustment_negative, creditmemo.base_shipping_amount, creditmemo.store_to_base_rate,creditmemo.base_to_global_rate, creditmemo.base_adjustment, creditmemo.base_subtotal,creditmemo.discount_amount, creditmemo.subtotal, creditmemo.adjustment, creditmemo.base_grand_total,creditmemo.base_adjustment_positive, creditmemo.base_tax_amount, creditmemo.shipping_tax_amount,creditmemo.tax_amount, creditmemo.order_id, creditmemo.email_sent, creditmemo.creditmemo_status,creditmemo.state, creditmemo.shipping_address_id, creditmemo.billing_address_id, creditmemo.invoice_id,creditmemo.cybersource_token, creditmemo.store_currency_code, creditmemo.order_currency_code,creditmemo.base_currency_code, creditmemo.global_currency_code, creditmemo.transaction_id,creditmemo.increment_id, creditmemo.created_at, creditmemo.updated_at, creditmemo.hidden_tax_amount,creditmemo.base_hidden_tax_amount, creditmemo.shipping_hidden_tax_amount,creditmemo.base_shipping_hidden_tax_amount, creditmemo.shipping_incl_tax,creditmemo.base_shipping_incl_tax, order.entity_id, order.state, order.status, order.coupon_code,order.protect_code, order.shipping_description, order.is_virtual, order.store_id, order.customer_id,order.base_discount_amount, order.base_discount_canceled, order.base_discount_invoiced,order.base_discount_refunded, order.base_grand_total, order.base_shipping_amount,order.base_shipping_canceled, order.base_shipping_invoiced, order.base_shipping_refunded,order.base_shipping_tax_amount, order.base_shipping_tax_refunded, order.base_subtotal,order.base_subtotal_canceled, order.base_subtotal_invoiced, order.base_subtotal_refunded,order.base_tax_amount, order.base_tax_canceled, order.base_tax_invoiced, order.base_tax_refunded,order.base_to_global_rate, order.base_to_order_rate, order.base_total_canceled, order.base_total_invoiced,order.base_total_invoiced_cost, order.base_total_offline_refunded, order.base_total_online_refunded,order.base_total_paid, order.base_total_qty_ordered, order.base_total_refunded, order.discount_amount,order.discount_canceled, order.discount_invoiced, order.discount_refunded, order.grand_total,order.shipping_amount, order.shipping_canceled, order.shipping_invoiced, order.shipping_refunded,order.shipping_tax_amount, order.shipping_tax_refunded, order.store_to_base_rate, order.store_to_order_rate,order.subtotal, order.subtotal_canceled, order.subtotal_invoiced, order.subtotal_refunded, order.tax_amount,order.tax_canceled, order.tax_invoiced, order.tax_refunded, order.total_canceled, order.total_invoiced,order.total_offline_refunded, order.total_online_refunded, order.total_paid, order.total_qty_ordered,order.total_refunded, order.can_ship_partially, order.can_ship_partially_item, order.customer_is_guest,order.customer_note_notify, order.billing_address_id, order.customer_group_id, order.edit_increment,order.email_sent, order.forced_do_shipment_with_invoice, order.gift_message_id,order.payment_authorization_expiration, order.paypal_ipn_customer_notified, order.quote_address_id,order.quote_id, order.shipping_address_id, order.adjustment_negative, order.adjustment_positive,order.base_adjustment_negative, order.base_adjustment_positive, order.base_shipping_discount_amount,order.base_subtotal_incl_tax, order.base_total_due, order.payment_authorization_amount,order.shipping_discount_amount, order.subtotal_incl_tax, order.total_due, order.weight, order.customer_dob,order.increment_id, order.applied_rule_ids, order.base_currency_code, order.customer_email,order.customer_firstname, order.customer_lastname, order.customer_middlename, order.customer_prefix,order.customer_suffix, order.customer_taxvat, order.discount_description, order.ext_customer_id,order.ext_order_id, order.global_currency_code, order.hold_before_state, order.hold_before_status,order.order_currency_code, order.original_increment_id, order.relation_child_id, order.relation_child_real_id,order.relation_parent_id, order.relation_parent_real_id, order.remote_ip, order.shipping_method,order.store_currency_code, order.store_name, order.x_forwarded_for, order.customer_note, order.created_at,order.updated_at, order.total_item_count, order.customer_gender, order.hidden_tax_amount,order.base_hidden_tax_amount, order.shipping_hidden_tax_amount, order.base_shipping_hidden_tax_amount,order.hidden_tax_invoiced, order.base_hidden_tax_invoiced, order.hidden_tax_refunded,order.base_hidden_tax_refunded, order.shipping_incl_tax, order.base_shipping_incl_tax, order.stocks_updated,order.fullstock_date, order.estimated_shipping_date, order.payment_validated, order.is_valid, order.anounced_date,order.anounced_date_max, order.external_logistic_run_id, order.sent_to_logistic_company, order.logistic_status,order.billing_address, order.shipping_address, order.payment_method, creditmemo.items, creditmemo.history

6. Usable code

11

Page 18: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

5. Cartentity_id, store_id, created_at, updated_at, converted_at, is_active, is_virtual, is_multi_shipping, items_count,items_qty, orig_order_id, store_to_base_rate, store_to_quote_rate, base_currency_code, store_currency_code,quote_currency_code, grand_total, base_grand_total, checkout_method, customer_id, customer_tax_class_id,customer_group_id, customer_email, customer_prefix, customer_firstname, customer_middlename,customer_lastname, customer_suffix, customer_dob, customer_note, customer_note_notify, customer_is_guest,remote_ip, applied_rule_ids, reserved_order_id, password_hash, coupon_code, global_currency_code,base_to_global_rate, base_to_quote_rate, customer_taxvat, customer_gender, subtotal, base_subtotal,subtotal_with_discount, base_subtotal_with_discount, is_changed, trigger_recollect, ext_shipping_info,gift_message_id, anounced_date, anounced_date_max, x_forwarded_for, items, shipping_amount,shipping_description, tax_amount

6. Orderentity_id, state, status, coupon_code, protect_code, shipping_description, is_virtual, store_id, customer_id,base_discount_amount, base_discount_canceled, base_discount_invoiced, base_discount_refunded,base_grand_total, base_shipping_amount, base_shipping_canceled, base_shipping_invoiced,base_shipping_refunded, base_shipping_tax_amount, base_shipping_tax_refunded, base_subtotal,base_subtotal_canceled, base_subtotal_invoiced, base_subtotal_refunded, base_tax_amount, base_tax_canceled,base_tax_invoiced, base_tax_refunded, base_to_global_rate, base_to_order_rate, base_total_canceled,base_total_invoiced, base_total_invoiced_cost, base_total_offline_refunded, base_total_online_refunded,base_total_paid, base_total_qty_ordered, base_total_refunded, discount_amount, discount_canceled,discount_invoiced, discount_refunded, grand_total, shipping_amount, shipping_canceled, shipping_invoiced,shipping_refunded, shipping_tax_amount,shipping_tax_refunded, store_to_base_rate, store_to_order_rate, subtotal,subtotal_canceled, subtotal_invoiced, subtotal_refunded, tax_amount, tax_canceled, tax_invoiced, tax_refunded,total_canceled, total_invoiced, total_offline_refunded, total_online_refunded, total_paid, total_qty_ordered,total_refunded, can_ship_partially, can_ship_partially_item, customer_is_guest,customer_note_notify,billing_address_id, customer_group_id, edit_increment, email_sent, forced_do_shipment_with_invoice,gift_message_id, payment_authorization_expiration, paypal_ipn_customer_notified, quote_address_id, quote_id,shipping_address_id, adjustment_negative, adjustment_positive, base_adjustment_negative,base_adjustment_positive, base_shipping_discount_amount, base_subtotal_incl_tax, base_total_due,payment_authorization_amount, shipping_discount_amount, subtotal_incl_tax, total_due, weight, customer_dob,increment_id, applied_rule_ids, base_currency_code, customer_email, customer_firstname, customer_lastname,customer_middlename, customer_prefix, customer_sufficustomer_taxvat, discount_description, ext_customer_id,ext_order_id, global_currency_code, hold_before_state, hold_before_status, order_currency_code,original_increment_id, relation_child_id, relation_child_real_id, relation_parent_id, relation_parent_real_id,remote_ip, shipping_method, store_currency_code, store_name, x_forwarded_for, customer_note,created_atupdated_at, total_item_count, customer_gender, hidden_tax_amount, base_hidden_tax_amount,shipping_hidden_tax_amount, base_shipping_hidden_tax_amount, hidden_tax_invoiced,base_hidden_tax_invoiced, hidden_tax_refunded, base_hidden_tax_refunded, shipping_incl_tax,base_shipping_incl_tax, stocks_updated, fullstock_date, estimated_shipping_date, payment_validated, is_valid,anounced_date, anounced_date_max, external_logistic_run_id, sent_to_logistic_company, logistic_status,billing_address, shipping_address, payment_method, items

6. Usable code

12

Page 19: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

7. Order - Invoice - Credit memoitem_id, order_id, parent_item_id, quote_item_id, store_id, created_at, updated_at, product_id, product_type,product_options, weight, is_virtual, sku, name, description, applied_rule_ids, additional_data, free_shipping,is_qty_decimal, no_discount, qty_backordered, qty_canceled, qty_invoiced, qty_ordered, qty_refunded,qty_shipped, base_cost, price, base_price, original_price, base_original_price, tax_percent, tax_amount,base_tax_amount, tax_invoiced, base_tax_invoiced, discount_percent, discount_amount, base_discount_amount,discount_invoiced, base_discount_invoiced, amount_refunded, base_amount_refunded, row_total, base_row_total,row_invoiced, base_row_invoiced, row_weight, gift_message_id, gift_message_available,base_tax_before_discount, tax_before_discount, ext_order_item_id, weee_tax_applied, weee_tax_applied_amount,weee_tax_applied_row_amount, base_weee_tax_applied_amount, base_weee_tax_applied_row_amount,weee_tax_disposition, weee_tax_row_disposition, base_weee_tax_disposition, base_weee_tax_row_disposition,locked_do_invoice, locked_do_ship, price_incl_tax, base_price_incl_tax, row_total_incl_tax,base_row_total_incl_tax, hidden_tax_amount, base_hidden_tax_amount, hidden_tax_invoiced,base_hidden_tax_invoiced, hidden_tax_refunded, base_hidden_tax_refunded, is_nominal, tax_canceled,hidden_tax_canceled, tax_refunded, comments, reserved_qty, purchase_order_id, logistic_status

8. Purchase orderYou can use the following codes to display informations

About purchase order

• purchase.total_tax_amount

• purchase.po_zoll_cost_ttc

• purchase.po_shipping_cost_ttc

• purchase.items

• purchase.po_date

• purchase.po_order_id (PO reference)

• purchase.po_supply_date

• purchase.po_carrier

• purchase.po_payment_type

• purchase.po_currency

• purchase.po_invoice_date

• purchase.po_invocie_ref

• purchase.po_paid

• purchase.po_currency_change_rate

• purchase.po_shipping_cost

• purchase.po_zoll_cost

• purchase.po_tax_rate

• purchase.po_comments

• purchase.po_payment_date

• purchase.po_status

About the purchase order items

• pop_product_id

• pop_product_name

• pop_qty

• pop_supplied_qty

• pop_price_ht (excl tax)

6. Usable code

13

Page 20: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

• pop_supplier_ref (supplier sku)

• pop_eco_tax (weee)

• pop_extended_costs

• pop_tax_rate

• pop_discount

• pop_delivery_date

• pop_subtotal

• pop_total

About the supplier

• supplier.sup_name (supplier name)

• supplier.sup_address1

• supplier.sup_address2

• supplier.sup_zipcode

• supplier.sup_country

• supplier.sup_city

• supplier.sup_tel

• supplier.sup_fax

• supplier.sup_contact

• supplier.sup_mail

• supplier.sup_website

• supplier.currency

7. FAQ

Remove print button on order + shipment + invoice admin page ?Edit file app/code/community/MDN/GlobalPDF/etc/config.xml

Note

Make a backup the file before to edit it.

Remove code:

<rewrite> <MDN_GlobalPDF_Sales_Order_Print> <from><![CDATA[#^/sales/order/print/#]]> </from> <to>/GlobalPDF/Order/Print/</to> </MDN_GlobalPDF_Sales_Order_Print> <MDN_GlobalPDF_Sales_Order_Print_Invoice> <from><![CDATA[#^/sales/order/printInvoice/#]]> </from> <to>/GlobalPDF/Invoice/Print/</to> </MDN_GlobalPDF_Sales_Order_Print_Invoice></rewrite>

<sales>

7. FAQ

14

Page 21: global pdfdocumentation.boostmyshop.com/global_pdf.pdf · GlobalPDF is a Magento extension design to customize Magento PDF documents but also add new ones: • Fully customizable

<rewrite> <order_pdf_invoice>MDN_GlobalPDF_Model_Pdf_Order_Invoice</order_pdf_invoice> <order_pdf_shipment>MDN_GlobalPDF_Model_Pdf_Order_Shipment</order_pdf_shipment> <order_pdf_creditmemo>MDN_GlobalPDF_Model_Pdf_Order_Creditmemo</order_pdf_creditmemo> </rewrite></sales>

Save the file and refresh your magento caches.

How to display product qty on frontend PDF product ?Edit file app/code/community/MDN/GlobalPDF/Model/Pdf/Product.php

After line

$data = $product->getData();

Add this code

$data['qty'] = $product->getStockItem()->getQty();

In the template XML file add the tag to grab the {qty} parameter.

How to remove the Frontend “Print” button ?Edit app/design/frontend/[package]/[theme]/template/GlobalPDF/Product.phtml

Rename the file Product.phtml into Product.phtml.old

Refresh magento caches

Change the total incl tax into excl tax in the invoice PDF ?Edit file app/code/community/MDN/GlobalPDF/Model/Pdf/Order/Invoice.php

Change line 95

$itemData['row_total'] = $itemData['row_total'] + $itemData['tax_amount'];

With

$itemData['row_total'] = $itemData['row_total'] ; //+ $itemData['tax_amount'];

Fatal error: Call to a member function getResource() on a non-objectDid you use the parameter “use magento font” ? If yes, set it to “no” and save.

Maybe the font Helvetica or other fonts is not present on your computer.

Fatal error: Call to a member function getElementsByTagName() on anon-objectThis error is due to the “Debug mode” option, try to disable it, it should solve your issue.

It’s a problem with Magento compability.

Available date parametersCheck the Parameters section of the PHP “date” documentation on http://php.net/manual/en/function.date.php

7. FAQ

15