Documentation

Documentation

WooCommerce extension

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

  1. Go to Plugins → Add New → Upload Plugin.
  2. Choose the plugin .zip file and click Install Now.
  3. Click Activate.
  4. 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”).

Activating Pro: after installing the Pro version, open WooCommerce → Account and enter your license key (received by email after purchase). On the free version there is no license — it simply works.

Quick start

  1. Go to WooCommerce → Settings → Gift Wrapping.
  2. Choose a Wrapping modePer order (one option for the whole cart, the default) or Per item (a button under each product).
  3. Set the Flat fee per wrap.
  4. Optionally enable the gift message.
  5. Save. Add a product to the cart and you’ll see the gift‑wrap option.
Using the block cart? Choose Per order mode — it works on both the block and classic cart. The per‑item button is a classic‑cart feature (see the FAQ).

Settings — wrapping mode & fee

SettingWhat it does
Wrapping modePer 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 ProAdds 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 ProHow 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 wrapThe amount charged per wrapped item. In per‑order mode it’s charged once.
Charge the feePer 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 classThe 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.

SettingWhat it does
Offer wrapping forAll products, Only selected categories, or All products except selected categories.
CategoriesThe 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 productsThe products that never show the wrap option.
Virtual and downloadable products are never offered wrapping automatically — there’s nothing physical to wrap.

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.

SettingWhat it does
Mark some products as already wrapped?Turns on the “gift wrapping included” badge for the selected categories/products.
Included categories / productsWhich categories or products are pre‑wrapped.
Included badge textThe text shown on the badge.

Settings — gift message

SettingWhat it does
Allow a gift message?Lets customers add a gift message when they wrap an item.
Message character limitMaximum 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.

SettingWhat it does
Wrapping offerSingle flat fee uses the fee above. Multiple designs lets customers pick a design, shown as a compact dropdown or a pop‑up lightbox.
DesignsAdd designs (name, image, price). Leave empty to use the single flat fee.
Design picker labelThe prompt shown on the design dropdown before a design is chosen.
“No wrapping” option labelThe 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

SettingWhat it does
Per‑item display styleHow 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 styleCheckbox (simple, in cart totals) or Card (promo box with icon & button).
Show the per‑order option onCart and checkout, Cart only, or Checkout only.
Per‑order option label / card titleThe order‑level option text or card title.
Card subtitle / buttonsSmall text and button labels for the card style.
Gift message field labelLabel above the gift‑message field.
Fee label (cart totals & order)How the wrapping fee line is named.
Show an info tooltip? / Tooltip textAdds a small “?” icon next to the option with a short explanation on hover/focus.

Settings — button style

SettingWhat it does
Button size ProNormal or Small (tighter padding, smaller font). Per‑item button only.
Button backgroundBackground colour of the per‑item button.
Button background (wrapped) ProBackground colour once an item is wrapped.
Button text colorText colour of the button.
Button corner radius (px) ProRounds the button corners.

Settings — advanced

SettingWhat it does
Delete settings on uninstallOff 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

FeatureFreePro
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

WhereMeta
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.
For developers / PDF integrations: the _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;">'
        . '&#127873; GIFT WRAP' . ( $message ? ' &mdash; ' . 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;">&#127873; GIFT WRAP%s</span></td></tr>',
        $colspan,
        $message ? ' &mdash; ' . esc_html( $message ) : ''
    );
}, 10, 3 );
Note: this flags per‑item wraps (per‑item mode). The highlight appears on a new order placed after the plugin is active. If you translate the plugin and prefer the legacy human‑readable key, you can fall back to it with $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