If you offer gift wrapping in your WooCommerce store, the hardest part isn’t taking the order — it’s making sure the warehouse actually sees that an item needs wrapping before it ships. In this guide you’ll learn how to clearly highlight gift-wrapped items on your WooCommerce order details and PDF packing slips, with copy-paste code you can use today.
Why gift-wrap flags get missed in fulfillment
Most gift-wrapping setups add a small fee or a line of text to the order, but that information is easy to overlook on a busy packing slip. When a customer pays extra for gift wrapping and receives a bare product, you get a refund request, a bad review, and a lost repeat sale — all over a detail that was technically in the order the whole time.
The fix is to make the gift-wrap status visually impossible to miss on the document your packers actually read: the packing slip. A bold, high-contrast flag next to the wrapped line item does exactly that.
How gift-wrap status is stored on a WooCommerce order
To highlight a wrapped item reliably, you first need the status saved on the order in a form your code can read. When a customer chooses gift wrapping, the choice should be stored as order-item meta on each wrapped line.
For example, the Gift Wrapping for WooCommerce – Cart & Checkout plugin saves two things per wrapped item:
- A human-readable label (e.g.
Gift wrapped: Yes) that shows on the order screen and in emails. - A stable, non-translatable meta key —
_cgwfw_wrapped— that your packing-slip code can check.
_cgwfw_wrapped returns the same value in every language.What the highlighted packing slip looks like
🎁 GIFT WRAP — “Happy Birthday, Mom!”
🎁 GIFT WRAP
Step 1 — Install a PDF packing-slip plugin
WooCommerce doesn’t generate PDF packing slips on its own. The most popular free option is PDF Invoices & Packing Slips for WooCommerce by WP Overnight. Install and activate it, then enable the packing-slip document under WooCommerce → PDF Invoices → Documents. The snippet below hooks into that plugin.
Step 2 — Add the highlight snippet
Add the following code with the free Code Snippets plugin (set it to “Run everywhere”) or in your child theme’s functions.php. It prints a bold 🎁 GIFT WRAP flag — plus the gift message — under each wrapped item, and it covers both the classic and the newer “Smart/Premium” PDF templates.
/**
* Highlight gift-wrapped items on the WooCommerce PDF packing slip.
* Works with "PDF Invoices & Packing Slips for WooCommerce" (WP Overnight).
*/
// Classic PDF templates
add_action( 'wpo_wcpdf_after_item_meta', function ( $document_type, $item, $order ) {
if ( 'packing-slip' !== $document_type ) {
return;
}
$line = ( isset( $item['item'] ) && is_object( $item['item'] ) )
? $item['item']
: ( isset( $item['item_id'] ) ? $order->get_item( $item['item_id'] ) : null );
if ( ! $line || ! $line->get_meta( '_cgwfw_wrapped' ) ) {
return;
}
$message = $line->get_meta( '_cgwfw_message' );
echo '<div style="margin-top:5px;padding:4px 8px;background:#ffe600;'
. 'color:#000;font-weight:bold;border:2px solid #000;display:inline-block;">'
. '🎁 GIFT WRAP' . ( $message ? ' — ' . esc_html( $message ) : '' )
. '</div>';
}, 10, 3 );
// Smart / Premium PDF templates
add_action( 'wpo_wcpdf_templates_after_order_details_row', function ( $document, $item_id, $item_columns ) {
if ( 'packing-slip' !== $document->get_type() ) {
return;
}
$line = $document->order->get_item( $item_id );
if ( ! $line || ! $line->get_meta( '_cgwfw_wrapped' ) ) {
return;
}
$message = $line->get_meta( '_cgwfw_message' );
$colspan = max( 1, count( (array) $item_columns ) );
printf(
'<tr><td colspan="%d"><span style="display:inline-block;margin:2px 0;'
. 'padding:4px 8px;background:#ffe600;color:#000;font-weight:bold;'
. 'border:2px solid #000;">🎁 GIFT WRAP%s</span></td></tr>',
$colspan,
$message ? ' — ' . esc_html( $message ) : ''
);
}, 10, 3 );
Step 3 — Test with a new order
Place a test order with gift wrapping enabled on at least one item, then open or regenerate its packing slip. You should see the yellow 🎁 GIFT WRAP flag under each wrapped product. Because the flag reads live order meta, it appears on any order that stored the gift-wrap data — typically every order placed after the plugin was activated.
Highlighting gift wrapping elsewhere
The same stable meta key lets you surface gift wrapping anywhere your team looks:
- Admin order screen & emails: the human-readable label already appears automatically with most gift-wrap plugins.
- Invoices: swap
'packing-slip'for'invoice'in the snippet to flag wrapped items on invoices too. - Pick lists / exports: read
_cgwfw_wrappedin any custom export or order-management integration.
Add gift wrapping to your store in minutes
Gift Wrapping for WooCommerce – Cart & Checkout lets customers wrap items right from the cart or checkout, stores a stable meta key for clean integrations, and works with the block and classic cart.
Get the pluginFrequently asked questions
How do I show gift wrapping on a WooCommerce packing slip?
Store the gift-wrap status as order-item meta when the order is placed, then hook into your PDF plugin’s packing-slip template — such as the WP Overnight PDF Invoices & Packing Slips plugin — to print a clear, bold flag for each wrapped line item, as shown in the snippet above.
Why should I use a stable meta key instead of the visible label?
The visible label is translated into the store language, so code that checks for text like “Gift wrapped” breaks as soon as the store is translated. A stable, non-translatable key such as _cgwfw_wrapped always returns the same value, so your packing-slip code keeps working in every language.
Will the highlight appear on existing orders?
The flag appears on any order whose line items carry the gift-wrap meta. New orders placed after the plugin and snippet are active show it automatically; older orders only show it if they already stored the meta.
Does this work with the WooCommerce block cart and checkout?
Yes. As long as the gift-wrap choice is saved to the order as item meta — which the Gift Wrapping for WooCommerce plugin does for both the classic and block-based cart and checkout — the packing-slip flag works the same way.
