Theme guide

How to add a gift wrap option to Shopify without an app

What you’ll need

  • The theme editor (to add a Custom Liquid block; no code editing)

    How to get this: The theme editor
    1. Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
    2. Add section or Add block › Custom Liquid, paste the code, then Save.

    Step-by-step guide (opens in a new tab)

  • Your settings for the feature (for example your free shipping amount or countdown end date)

Make my gift wrap checkbox

1. Create the gift wrap product

  1. Products › Add product. Title: Gift wrap. Price: what you charge, like 5.00.
  2. Under Inventory, untick Track quantity so it never sells out. Keep “This is a physical product” ticked so it ships with the order (weight 0).
  3. Status: Active. Under Publishing, keep Online Store on (the cart can only add products on the Online Store).
  4. Don’t add it to any collection. To keep it out of your store’s search, add the metafield seo.hidden with the value 1 (Shopify’s documented way to hide a product from search).
  5. Save. Its handle is the end of its web address, usually gift-wrap.

2. Add the checkbox to the cart page

  1. Open the Liquid Snippet Studio and choose Gift wrap option. Type the handle, choose once per order or per item, and whether to ask for a gift message.
  2. Online Store › Themes › Customize. Switch to Cart at the top.
  3. Add section › Custom Liquid, paste the code and Save.
  4. Add a product to your cart and open the cart page: tick the box and the gift wrap appears as a line with its price.

How it behaves in Dawn and Horizon

  • Ticking the box adds the Gift wrap product with Shopify’s Cart API (/cart/add.js) and the cart total updates to include its price; unticking removes the line again (/cart/change.js).
  • The gift message is saved with /cart/update.js as the cart note or a cart attribute, so it carries through checkout onto the order.
  • A new Custom Liquid section is added at the bottom of the cart template. In Horizon that is below “You may also like”, so drag it up under the cart items where shoppers will see it.

Pitfalls that make gift wrap show twice

  • Two gift wrap products (an old app’s and yours). Keep one handle.
  • Charging per item but letting shoppers change the gift wrap quantity by hand: the checkbox puts it back in step with the cart each time the cart page loads, and removes it when nothing else is left.
  • A theme notes box and the gift message both writing the order note. If your cart page has an order notes field, save the gift message as an order attribute instead.

Where the gift wrap and message show up

  • Gift wrap is a normal line on the order, so it prints on packing slips, shows in reports and counts in sales.
  • A message saved as the order note shows on the order and can print on packing slips.
  • A message saved as the Gift message attribute shows under Additional details on the order.

Questions

Can shoppers choose gift wrap for some items only?

Use the per-order mode and a gift message like “Wrap the blue mug only”, or add custom fields to the product page with a “Gift wrap this item” checkbox. Charging per chosen item needs a separate product option or variant.

Does it work in the cart drawer?

Dawn’s and Horizon’s cart drawers have no place for a section, so the checkbox shows on the cart page. In Dawn, set Theme settings › Cart › Cart type to Page to send shoppers there.

More guides