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.

alt

Sectioned and non-sectioned themes

Create a gift-wrap product

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

  1. From your Shopify admin, click Products.

  2. Click Add product.

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

alt
  • 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.
  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 new menu
  1. Add the gift-wrap product to the menu:
    a. In the Menu items section, give your new link any Name you like.
    b. For Link, select Product.
    c. Select your gift-wrap product from the drop-down menu:
Add menu item
  1. Click Save menu.

Create a code snippet

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

  1. Find the theme you want to edit, click Actions, and then click Edit code.

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

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

  4. 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.

  5. 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:

    {% include '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, click 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
  1. Add the gift-wrap product to the menu:
    a. In the Menu items section, give your new link any Name you like.
    b. For Link, select Product.
    c. Select your gift-wrap product from the drop-down menu:
Add menu item
  1. Click Save menu.

Create a code snippet

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

  1. Find the theme you want to edit, click Actions, and then click Edit code.

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

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

  4. 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.

  5. 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:

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

Demo store

Click here to view a demo of this customization.

Want to discuss this page?

Visit the Shopify Community