Add a gift-wrap option to your cart page

You can offer a gift wrapping service to your customers on the cart page of your online store. For customers who want their order wrapped, you can charge either a flat rate, or charge on a per product basis.

Gift wrap

Sectioned and non-sectioned themes

The steps for this tutorial differ depending on whether you are using a sectioned or a non-sectioned theme. A sectioned theme is a newer theme that lets you drag and drop to arrange the layout of your store's pages.

To figure out whether your theme supports sections, go to the theme's Edit code page. If there are files in the Sections directory, you are using a sectioned theme. Non-sectioned themes were released before October 2016, and do not have files in the Sections directory.

If you are using a sectioned theme, then click the Sectioned themes button and follow the instructions. If you are using an older, non-sectioned theme, then click the Non-sectioned themes button and follow the instructions.

Create a gift-wrap product

First, you will create your gift-wrap option as a product:

  1. From your Shopify admin, go to Products > All products.

  2. Click Add product.

  3. Create a gift-wrap product just as you would create any other product:

    Create a gift-wrap product

    • You can use your product description to explain what materials will be used to gift-wrap the items.
    • Give your gift-wrap product the price that you want to charge for the service. If you want gift wrapping to be free, then set the price of your gift-wrap product to be 0.
    • You can upload an image for the product to show your customers what a gift-wrapped order will look like.
    • Make sure your gift-wrap product includes inventory, or else adjust the settings so that Shopify doesn't track inventory for the gift-wrap product. If your store has multiple locations, then uncheck Track quantity to prevent Shopify from tracking inventory for the gift-wrap product.
  4. Click Save.

Create a menu

Next, create a menu that points to your gift-wrap product:

  1. Click Add menu.

  2. Name your menu Gift wrapping, so that the handle that's assigned to the menu is gift-wrapping.

  3. Add the gift-wrap product to the menu:

    1. Click Add menu item, and then enter a Name for the link to the gift-wrap product.
    2. In the Link field, select Products, and then select the gift-wrap product from the drop-down menu.
    3. Click Add.
  4. Click Save menu.

Create a code snippet

To create a code snippet for the gift-wrap option:

  1. In the Snippets directory, click Add a new snippet.

  2. Name your snippet gift-wrapping and click Create snippet. Your snippet file will open in the code editor.

  3. In this step, you will paste some code into your new gift-wrapping snippet file. The code you paste depends on how you want to charge your customers for the gift wrapping service:

    To add a flat rate charge per order

    To add a flat rate charge for gift wrapping, paste this code hosted on GitHub.

    To add a charge that is multiplied by the number of products in the order

    With this option, if there are three products in the order, then the gift wrap charge will be multiplied by three. To add a charge that is multiplied by the number of products in the order, paste this code hosted on GitHub.

  4. Click Save.

Include the snippet in your cart template

To include the gift-wrapping snippet in your cart template:

  1. In the Sections directory, click cart-template.liquid. If your theme doesn't have a cart-template.liquid, then click cart.liquid in the Templates directory.

  2. Find the closing </form> tag in the code. On a new line above the closing </form> tag, paste the following code:

    {% render 'gift-wrapping' %}
  3. Click Save.

Include jQuery in your theme.liquid

For this customization to work, some themes require that a script tag for jQuery is added to the theme.liquid layout file. If you use Boundless, Debut, Narrative, or Venture, then you will need to follow the next steps:

  1. In the Layout directory, click theme.liquid.

  2. Find the closing </head> tag in the code. On a new line above the closing </head> tag, paste the following code:

    {{ '//ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js' | script_tag }}
  3. Click Save.

Demo store

Click here to view a demo of this customization.

Create a gift-wrap product

First, you will create your gift-wrap option as a product:

  1. From your Shopify admin, go to Products > All products.

  2. Click Add product.

  3. Create a gift-wrap product just as you would create any other product:

Create a gift wrap product

  • You can use your product description to explain what materials will be used to gift-wrap the items.
  • Give your gift-wrap product the price the price that you want to charge for the service. If you want gift wrapping to be free, then set the price of your gift-wrap product to be 0.
  • You can upload an image for the product to show your customers what a gift-wrapped order will look like.
  1. Click Save product.

Create a menu

Next, you will create a menu that points to your gift-wrap product:

  1. Click Add menu.

  2. Name your menu Gift wrapping, so that the handle that's assigned to the menu is gift-wrapping:

    Create a menu

  3. Add the gift-wrap product to the menu:

    1. In the Menu items section, give your new link any Name you like.
    2. For Link, select Product.
    3. Select your gift-wrap product from the drop-down menu:
      Add menu item
  4. Click Save menu.

Create a code snippet

To create a code snippet for the gift-wrap option:

  1. In the Snippets directory, click Add a new snippet.

  2. Name your snippet gift-wrapping and click Create snippet. Your snippet file will open in the code editor.

  3. In this step, you will paste some code into your new gift-wrapping snippet file. The code you paste depends on how you want to charge your customers for the gift wrapping service:

    To add a flat rate charge per order

    To add a flat rate charge for gift wrapping, paste this code hosted on GitHub.

    To add a charge that is multiplied by the number of products in the order

    With this option, if there are three products in the order, then the gift wrap charge will be multiplied by three. To add a charge that is multiplied by the number of products in the order, paste this code hosted on GitHub.

  4. Click Save.

Include the snippet in your cart template

To include the gift-wrapping snippet in your cart template:

  1. In the Templates directory, click cart.liquid.

  2. Find the closing </form> tag in the code. On a new line above the closing </form> tag, paste the following code:

    {% render 'gift-wrapping' %}
  3. Click Save.

Demo store

Click here to view a demo of this customization.

Ready to start selling with Shopify?

Try it free