You can get the updated template files from the updated plugin itself.
You can also change code manually with the below guide:
To update your template, follow the instructions below in order. Keeping a backup of your template is good in case anything goes wrong.
Update html-document-wrapper.php
file: Replace the entire code with the one you can find here.
Update Template Files: For each template file (invoice.php
, packing-slips.php
), perform the following:
- Add this line at the top of each template file:
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
- Replace or remove any occurrences of the following if you encounter them. Note that the spacing around parentheses may vary in your files, so search for different queries to ensure you find them.
- Replace
'wpo_wcpdf'
with 'woocommerce-pdf-invoices-packing-slips'
. (Please note that It should be exactly 'wpo_wcpdf'
, with one quotation around.)
- Remove the global variable
$wpo_wcpdf
you can find in the beginning lines of files.
- Replace
$wpo_wcpdf
with $this
.
- Replace
$this->export->order
with $this->order
.
- Replace
$this->export->template_type
with $this->get_type()
.
- Replace
$this->settings->template_settings
with $this->settings
.
- Replace
'invoice_email'
with 'display_email'
.
- Replace
'invoice_phone'
with 'display_phone'
.
- Replace
'packing_slip_email'
with 'display_email'
.
- Replace
'packing_slip_phone'
with 'display_phone'
.
- Replace
apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $this->get_type(), $this->order, $item_id );
with apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, $this->get_type(), $this->order, $item_id );
- Replace
isset($this['invoice_shipping_address']) && $this->ships_to_different_address()
with $this->show_shipping_address()
.
- Replace
isset($this['packing_slip_billing_address']) && $this->ships_to_different_address()
with $this->show_billing_address()
.