How to Customize Your WooCommerce Packing Slips: Common Issues and Solutions
Content
Many WooCommerce store owners use the 'PDF Invoices & Packing Slips for WooCommerce' plugin to manage their order documents. A common area of customization is the packing slip, which often needs to be tailored for warehouse use, shipping providers, or specific business requirements. This guide covers the most frequent packing slip customization requests and how to address them using the free version of the plugin where possible.
Common Packing Slip Customizations
Based on community discussions, here are the most sought-after changes and how to achieve them.
1. Changing the Paper Size (e.g., for 4x6 labels)
The default plugin template is designed for standard paper sizes like A4. However, you can set a custom paper size for packing slips using a code snippet. This is useful for printing on smaller labels.
/**
* Set a custom paper size for packing slips (4x6 inches)
*/
add_filter( 'wpo_wcpdf_paper_format', function( $paper_format, $document_type ) {
if ( $document_type == 'packing-slip' ) {
$width = 4; //inches
$height = 6; //inches
$paper_format = array( 0, 0, $width * 72, $height * 72 );
}
return $paper_format;
}, 10, 2 );
You may need to add additional CSS to adjust the layout for the smaller format.
2. Removing the Shop Logo and Address
To remove the shop logo and address from only the packing slips, you can use custom CSS via a code snippet.
/**
* Hide shop logo and address on packing slips
*/
add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
?>
.packing-slip table.head {
display:none;
}
<?php
}, 10, 2 );
3. Adding Custom Data (e.g., Customer Phone, Role, or ACF Fields)
You can display additional order, customer, or product data on your packing slips using hooks.
To add the customer's phone number: This is typically available if you have the Professional extension. However, if you are using a custom template, you can try to access the data with $this->shipping_phone.
To add the customer's role:
/**
* Display customer role on packing slip
*/
add_action( 'wpo_wcpdf_after_order_data', function($document_type, $order) {
if ( $document_type == 'packing-slip' ) {
if( $user = $order->get_user() ) {
global $wp_roles;
$customer_role = translate_user_role( $wp_roles->roles[$user->roles[0]]['name'] );
?>
<tr class="customer-role">
<th>Customer Role:</th>
<td><?php echo $customer_role; ?></td>
</tr>
<?php
}
}
}, 10, 2 );
To add an ACF custom field from products: The process involves fetching the product meta. You can find guides on the plugin's documentation for displaying custom fields.
4. Adjusting Font Size and Layout Spacing
If the text on your packing slip is too small or the spacing is off, you can adjust it with custom CSS.
/**
* Adjust packing slip font size and spacing
*/
add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
?>
.packing-slip {
font-size: 10pt; /* Adjust font size */
}
.packing-slip .document-type-label {
margin: 2mm 0; /* Adjust title margins */
}
.packing-slip table.order-data-addresses {
margin-bottom: 5mm; /* Adjust space after addresses */
}
<?php
}, 10 , 2 );
Important Notes and Limitations
- Code Snippets: The solutions above require adding code to your site. You can add this code to your child theme's
functions.phpfile or use a code snippets plugin. Always test code on a staging site first. - Free vs. Premium Features: The 'PDF Invoices & Packing Slips for WooCommerce' team offers premium extensions that provide a user interface for many of these customizations without code. Features like adding product images, sorting items, hiding virtual products, automatically emailing slips, and adding numbering to packing slips are part of these paid extensions. Due to WordPress.org forum guidelines, support for those paid features cannot be provided here.
- Data Source: Remember that the information on the PDF (like the shipping address) is pulled directly from the order data. If the information is wrong on the PDF, it is likely wrong in the WooCommerce order itself. Check for conflicts with other plugins that might be modifying order data.
By using these code snippets, you can significantly customize your packing slips to better fit your workflow. For more complex needs involving the premium extensions, you would need to contact the plugin's team directly.
Related Support Threads Support
-
If Order belongs to “virtual” category exclude from packing sliphttps://wordpress.org/support/topic/if-order-belongs-to-virtual-category-exclude-from-packing-slip/
-
Add number to packing-slip like invoice pdf.https://wordpress.org/support/topic/i-want-packing-slip-have-number-like-invoice-pdf/
-
Font size packing sliphttps://wordpress.org/support/topic/font-size-packing-slip/
-
Show discount/coupon code on the packing sliphttps://wordpress.org/support/topic/show-discount-coupon-code-on-the-packing-slip/
-
How do I add a products ACF custom field to the packing slip?https://wordpress.org/support/topic/how-do-i-add-a-product-acf-field-to-packing-slip/
-
Customer role to packing list?https://wordpress.org/support/topic/customer-role-to-packing-list/
-
Display acf field on package sliphttps://wordpress.org/support/topic/display-acf-field-on-package-slip/
-
Include A meta key Value on Invoice/Packing Slip Outputhttps://wordpress.org/support/topic/include-a-meta-key-value-on-invoice-packing-slip-output/
-
Packing Slip Address Errorhttps://wordpress.org/support/topic/packing-slip-address-error/
-
Sort the products in the Invoice and Pakcing Slipshttps://wordpress.org/support/topic/sort-the-products-in-the-invoice-and-pakcing-slips/
-
Generate packing slip document for particular orderhttps://wordpress.org/support/topic/generate-packing-slip-document-for-particular-order/
-
show coupon code on packing slipshttps://wordpress.org/support/topic/show-coupon-code-on-packing-slips/
-
Weight in packing sliphttps://wordpress.org/support/topic/weight-in-packing-slip/
-
Checkmark only when printed and no when just clickedhttps://wordpress.org/support/topic/checkmark-only-when-printed-and-no-when-just-clicked/
-
my account order list packing slip buttonhttps://wordpress.org/support/topic/my-account-order-list-packing-slip-button/
-
Product Images Packaging Sliphttps://wordpress.org/support/topic/product-images-packaging-slip/
-
Put the cell phone on the labelhttps://wordpress.org/support/topic/put-the-cell-phone-on-the-label/
-
Sorting items in invoice or packing sliphttps://wordpress.org/support/topic/sorting-items-in-invoice-or-packing-slip/
-
HS/HSN Code on packing-sliphttps://wordpress.org/support/topic/hs-hsn-code-on-packing-slip/
-
Phone Number & Email Address ( customer ) on Packing Listhttps://wordpress.org/support/topic/phone-number-email-address-customer-on-packing-list/
-
automatic packing list mail to fulfillment househttps://wordpress.org/support/topic/automatic-packing-list-mail-to-fulfillment-house/
-
Print both packing slip and invoicehttps://wordpress.org/support/topic/print-both-packing-slip-and-invoice/
-
Invoice Info versus Packing Slip Infohttps://wordpress.org/support/topic/invoice-info-versus-packing-slip-info/
-
How to set diferent paper size for package slips?https://wordpress.org/support/topic/how-to-set-diferent-paper-size-for-package-slips/
-
Generate document on order status change?https://wordpress.org/support/topic/generate-document-on-order-status-change/
-
packing slip refundshttps://wordpress.org/support/topic/packing-slip-refunds/
-
Logo and shop address removal from packing sliphttps://wordpress.org/support/topic/logo-and-shop-address-removal-from-packing-slip/
-
Change order of items on packing listhttps://wordpress.org/support/topic/change-order-of-items-on-packing-list/
-
Packing Slip to customer on order…https://wordpress.org/support/topic/packing-slip-to-customer-on-order/
-
Packing Slip issuehttps://wordpress.org/support/topic/packing-slip-issue/
-
Can we get a 4×6 paper option for packing slips?https://wordpress.org/support/topic/can-we-get-a-4x6-paper-option-for-packing-slips/
-
Printning packing label from mobile apphttps://wordpress.org/support/topic/printning-packing-label-from-mobile-app/