SwftGifts
Gift message and gift wrap for Swft Checkout. Customers add a personalised message and optionally request gift wrapping. Both are preserved through the checkout and written to the WooCommerce order.
What it does
Section titled “What it does”- Adds a Gift Message textarea to the Swft Cart drawer
- Adds a Gift Wrap toggle with configurable price
- Passes both through the checkout session as
extensions.gifts - Adds a gift wrap fee row to the checkout order summary
- Writes gift data to the WooCommerce order as
_swft_ext_gifts - Adds an order note for the packing team
Installation
Section titled “Installation”- Download
swft-gifts.zipfrom swft.co.uk/modules - Install via Plugins → Add New → Upload Plugin
- Activate
Configuration
Section titled “Configuration”Go to WooCommerce → Settings → SwftGifts:
| Setting | Option | Default |
|---|---|---|
| Enable gift message | swft_gifts_message_enabled | yes |
| Enable gift wrap | swft_gifts_wrap_enabled | yes |
| Gift wrap price | swft_gifts_wrap_price | 299 (pence) |
| Wrap product SKU | swft_gifts_wrap_sku | “ |
| Notification email | swft_gifts_notify_email | “ |
If Wrap product SKU is set, SwftGifts adds that product to the WooCommerce order line items when wrap is selected, so it appears in fulfilment and inventory.
Extension data
Section titled “Extension data”SwftGifts adds the following to extensions.gifts in the session:
{ "message": "Happy birthday!", "wrap": true, "price": 299}Available in the checkout frontend via:
window.SwftCheckout.getExtension('gifts')// { message: 'Happy birthday!', wrap: true, price: 299 }Order meta
Section titled “Order meta”After payment, the WooCommerce order receives:
| Meta key | Value |
|---|---|
_swft_ext_gifts | {"message":"Happy birthday!","wrap":true,"price":299} |
Events fired
Section titled “Events fired”SwftGifts does not fire custom events beyond the standard Swft Cart events. Listen for swftcart:cart-updated to detect when gift options change.
PHP filter
Section titled “PHP filter”SwftGifts exposes one filter to modify the extension data before it is sent:
add_filter( 'swft_gifts_extension_data', function( array $data ): array { // e.g. override price for premium members if ( wc_memberships_is_user_active_member( get_current_user_id(), 'premium' ) ) { $data['price'] = 0; } return $data;} );