Documentation
Gift Wrapping for WooCommerce – Cart & Checkout
Let customers add gift wrapping right from the cart or checkout — per item or per order — without a page reload. By TinyPlugs.com.
Introduction
Gift Wrapping for WooCommerce – Cart & Checkout adds a gift‑wrapping option to your store. Shoppers can wrap a single product, several products, or the whole order, and optionally add a gift message — all updated instantly over AJAX, with no page reload.
The plugin works with both the classic cart/checkout and the newer WooCommerce Cart & Checkout blocks. A free version covers the essentials; a Pro upgrade unlocks multiple wrap designs, product‑page wrapping, targeting, and more (see Free vs Pro).
Requirements
- WordPress 5.8 or later
- WooCommerce 6.0 or later (HPOS compatible)
- PHP 7.4 or later
Installation
From your WordPress admin
- Go to Plugins → Add New → Upload Plugin.
- Choose the plugin
.zipfile and click Install Now. - Click Activate.
- Open WooCommerce → Settings → Gift Wrapping to configure.
The free version is also available from the WordPress.org plugin directory (Plugins → Add New → search “Gift Wrapping for WooCommerce”).
Quick start
- Go to WooCommerce → Settings → Gift Wrapping.
- Choose a Wrapping mode — Per order (one option for the whole cart, the default) or Per item (a button under each product).
- Set the Flat fee per wrap.
- Optionally enable the gift message.
- Save. Add a product to the cart and you’ll see the gift‑wrap option.
Settings — wrapping mode & fee
| Setting | What it does |
|---|---|
| Wrapping mode | Per order shows a single option below the cart totals. Per item shows a button under each cart product (classic cart only). |
| Also show on the product page Pro | Adds a gift‑wrap control to single product pages (per‑item mode). The choice carries into the cart, where it can still be changed. |
| Product‑page display style Pro | How the product‑page control looks: checkbox, “gift icon + text”, or switch box. Used in flat‑fee mode (design mode always uses a dropdown). |
| Flat fee per wrap | The amount charged per wrapped item. In per‑order mode it’s charged once. |
| Charge the fee | Per item multiplies the fee by quantity (4 of the same product = 4 fees). Per cart line charges one fee per wrapped row. Per‑item mode only. |
| Charge tax on the fee? | Whether the wrapping fee is taxable. |
| Fee tax class | The tax class applied to the fee when tax is charged. Use Standard unless wrapping is taxed differently in your region. |
Settings — targeting Pro
Control which products are eligible for wrapping. In per‑order mode this also gates the order‑level option: it appears only when the cart contains at least one eligible product.
| Setting | What it does |
|---|---|
| Offer wrapping for | All products, Only selected categories, or All products except selected categories. |
| Categories | The categories to include or exclude, depending on the option above. |
| Exclude specific products? | Never offer wrapping for certain products, regardless of the targeting above. |
| Excluded products | The products that never show the wrap option. |
Settings — gift wrapping included Pro
Mark products that already arrive gift‑wrapped (e.g. from the supplier). These show an “included” badge in the cart instead of the paid wrap option.
| Setting | What it does |
|---|---|
| Mark some products as already wrapped? | Turns on the “gift wrapping included” badge for the selected categories/products. |
| Included categories / products | Which categories or products are pre‑wrapped. |
| Included badge text | The text shown on the badge. |
Settings — gift message
| Setting | What it does |
|---|---|
| Allow a gift message? | Lets customers add a gift message when they wrap an item. |
| Message character limit | Maximum length of the gift message. |
Settings — wrap designs Pro
Offer several wrapping designs, each with its own name, image and price, instead of a single flat fee.
| Setting | What it does |
|---|---|
| Wrapping offer | Single flat fee uses the fee above. Multiple designs lets customers pick a design, shown as a compact dropdown or a pop‑up lightbox. |
| Designs | Add designs (name, image, price). Leave empty to use the single flat fee. |
| Design picker label | The prompt shown on the design dropdown before a design is chosen. |
| “No wrapping” option label | The first option in the dropdown, letting the customer choose no wrapping. |
The chosen design and its price are saved to the order and shown on the order screen and in emails.
Settings — labels & display styles
| Setting | What it does |
|---|---|
| Per‑item display style | How the per‑item control looks: Button (free), or Gift icon + text / Switch box Pro. |
| Button / switch label (not wrapped) | Label before wrapping is added. |
| Button label (wrapped) | Label once wrapping is added. |
| Per‑order display style | Checkbox (simple, in cart totals) or Card (promo box with icon & button). |
| Show the per‑order option on | Cart and checkout, Cart only, or Checkout only. |
| Per‑order option label / card title | The order‑level option text or card title. |
| Card subtitle / buttons | Small text and button labels for the card style. |
| Gift message field label | Label above the gift‑message field. |
| Fee label (cart totals & order) | How the wrapping fee line is named. |
| Show an info tooltip? / Tooltip text | Adds a small “?” icon next to the option with a short explanation on hover/focus. |
Settings — button style
| Setting | What it does |
|---|---|
| Button size Pro | Normal or Small (tighter padding, smaller font). Per‑item button only. |
| Button background | Background colour of the per‑item button. |
| Button background (wrapped) Pro | Background colour once an item is wrapped. |
| Button text color | Text colour of the button. |
| Button corner radius (px) Pro | Rounds the button corners. |
Settings — advanced
| Setting | What it does |
|---|---|
| Delete settings on uninstall | Off by default. When on, all of the plugin’s settings are removed from the database when the plugin is deleted. Leave off to keep your settings if you reinstall later. |
Free vs Pro
| Feature | Free | Pro |
|---|---|---|
| Per‑item & per‑order wrapping | ✓ | ✓ |
| Single flat fee (per‑unit / per‑line, tax) | ✓ | ✓ |
| Gift message | ✓ | ✓ |
| Info tooltip | ✓ | ✓ |
| Basic button colour & text colour | ✓ | ✓ |
| Block & classic cart/checkout | ✓ | ✓ |
| Multiple wrap designs (image + price) | — | ✓ |
| Single‑product‑page wrapping | — | ✓ |
| Category & product targeting | — | ✓ |
| “Gift wrapping included” badge | — | ✓ |
| Extra display styles (icon+text, switch box) | — | ✓ |
| Advanced button styling (size, radius, wrapped colour) | — | ✓ |
| Priority support | — | ✓ |
In the free version, Pro settings are visible but locked, and saved Pro values are kept (they take effect again if you upgrade).
How it looks for customers
Cart
Per item: a wrap button appears under each eligible product. Per order: a single option (checkbox or promo card) appears below the cart totals. Toggling updates the fee and totals instantly via AJAX.
Checkout
The per‑order option can also appear in the checkout order summary (configurable: cart, checkout, or both).
Single product page Pro
A wrap control (checkbox, icon+text, switch, or design picker) appears before the Add‑to‑cart button. The choice carries into the cart and remains editable there.
Block cart & checkout
The order‑level option renders in the block order summary, with live fee/total updates over the WooCommerce Store API.
Orders, emails & PDF packing slips
Gift‑wrap status and messages are saved to the order and shown on the order screen, in WooCommerce emails, and on the front‑end order details.
What is stored
| Where | Meta |
|---|---|
| Per‑item (order line) | Human‑readable Gift wrapped / Gift message (translated), plus stable keys _cgwfw_wrapped = yes and _cgwfw_message. |
| Per‑order | _cgwfw_wrapped = order, _cgwfw_order_message, and (design mode) _cgwfw_order_design. |
_cgwfw_wrapped key is stable and non‑translatable, so PDF packing slips and other integrations can detect wrapped items reliably regardless of the store’s language. The internal _cgwfw_* keys are hidden from the admin order screen but readable in code.Recipe — highlight wrapped items on PDF packing slips
Using the PDF Invoices & Packing Slips for WooCommerce plugin (WP Overnight)? This snippet prints a bold 🎁 GIFT WRAP flag (with the gift message) under each wrapped product on the packing slip, so packers don’t miss it. It reads the stable _cgwfw_wrapped meta, so it works in any store language, and covers both the classic and the “Smart/Premium” PDF templates.
Add it via the Code Snippets plugin (set it to run everywhere) or your child theme’s functions.php:
/**
* Highlight gift-wrapped items on the WP Overnight PDF packing slip.
*/
// Classic WPO 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 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 );
$line->get_meta( '_cgwfw_wrapped' ) ?: $line->get_meta( 'Gift wrapped' ).Compatibility
- WooCommerce HPOS (High‑Performance Order Storage) — fully compatible.
- Cart & Checkout blocks — supported via the Store API (order‑level option).
- WP Rocket — the cart/blocks scripts are excluded from “Delay JavaScript execution” and JS minify/combine, and the CSS is safelisted against “Remove Unused CSS”, so the wrap button stays interactive and styled.
- PDF Invoices & Packing Slips — gift‑wrap status is saved as order‑item meta (see above), so it can be shown on packing slips.
- Works with standard themes including Flatsome.
Translations
All strings are translatable. A translation template (.pot) ships in the languages/ folder, and the block UI loads its translations via wp_set_script_translations. Translate with Poedit or Loco Translate, or place a compiled .mo in wp-content/languages/plugins/.
FAQ & troubleshooting
Does it reload the cart?
No. Toggling a wrap and updating totals happens via AJAX.
Why doesn’t the per‑item button show in my block‑based cart?
The Cart & Checkout blocks have no per‑line‑item slot, so the per‑item button only works with the classic cart. On the block cart, use Per order mode (the default — it works in both), or switch your Cart and Checkout pages to the classic [woocommerce_cart] and [woocommerce_checkout] shortcodes.
Can I offer different wrapping designs?
Yes, in Pro. Under Wrap Designs add several designs, each with a name, image and price. Leave designs empty to use a single flat fee.
The wrap button doesn’t look styled / its colour is wrong.
If you use a page‑cache/optimisation plugin, make sure the plugin’s CSS isn’t stripped. The plugin already safelists its own styles for WP Rocket; for other tools, exclude the plugin’s CSS from “Remove Unused CSS”.
Licensing & support
- Pro license: manage it under WooCommerce → Account (activate, deactivate, view license).
- Pro support: open a priority support ticket.
- Free support: the WordPress.org plugin support forum.
Gift Wrapping for WooCommerce – Cart & Checkout · by TinyPlugs · Documentation v1.13.0
