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

Create a gift-wrap product

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

  1. From your Shopify admin, go to<一个href="//www.theturtleeffect.com/admin/products">Products.

  2. ClickAdd product.

  3. Create a gift-wrap product<一个href="//www.theturtleeffect.com/help/en/manual/products/add-update-products" target="_self">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 be0.
  • 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 uncheckTrack quantityto prevent Shopify from tracking inventory for the gift-wrap product.
  1. ClickSave.

Create a menu

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

  1. From your Shopify admin, go to<一个href="//www.theturtleeffect.com/admin/menus">欧宝体育官网入口首页>Navigation.
  2. ClickAdd menu.
  3. 命名您的菜单Gift wrapping, so that the handle that's assigned to the menu is礼品包装服务.
  4. Add the gift-wrap product to the menu:
    1. ClickAdd menu item, and then enter aNamefor the link to the gift-wrap product.
    2. Linkfield, selectProducts, and then select the gift-wrap product from the drop-down menu.
    3. ClickAdd.
  5. ClickSave menu.

Create a code snippet

  1. From your Shopify admin, go to欧宝体育官网入口首页><一个href="//www.theturtleeffect.com/admin/themes">Themes.
  2. Find the theme you want to edit, click thebutton to open the actions menu, and then clickEdit code.
  3. Snippetsdirectory, clickAdd a new snippet.
  4. Name your snippet礼品包装服务and clickCreate snippet. Your snippet file will open in the code editor.
  5. In this step, you will paste some code into your new礼品包装服务snippet file. The code you paste depends on how you want to charge your customers for the gift wrapping service:

Add a flat rate charge for gift wrapping

Paste the following code andSave:

{% if linklists.gift-wrapping.links.size > 0 and linklists.gift-wrapping.links.first.type == 'product_link' %}id="is-a-gift"style="clear: left; margin: 30px 0"class="clearfix rte">

id="gift-wrapping"type="checkbox"name="attributes[gift-wrapping]"value="yes"{%ifcart.attributes.gift-wrapping%}checked="checked"{%endif%}style="float: none"/>for="gift-wrapping"style="display:inline; padding-left: 5px; float: none;">For {{ linklists.gift-wrapping.links.first.object.price | money }} please wrap the products in this order.

style="display:block"for="gift-note">Gift message (free and optional):>name="attributes[gift-note]"id="gift-note">{{ cart.attributes.gift-note }}>

{% assign id = linklists.gift-wrapping.links.first.object.variants.first.id %} {% assign gift_wraps_in_cart = 0 %} {% for item in cart.items %} {% if item.id == id %} {% assign gift_wraps_in_cart = item.quantity %} {% endif %} {% endfor %}{% else %}style="clear: left; margin: 30px 0"class="rte">You attempted to add a gift-wrapping script to your shopping cart, but it won't work because you don't have a link list with handle礼品包装服务which, in turn, contains a link to your gift-wrapping product. Please review the steps outlined<一个href="https://help.shopify.com/manual/online-store/themes/os/customize/add-gift-wrap-option"target="_blank"rel="noopener noreferrer nofollow">here>.

{% endif %}

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. Paste the following code andSave:

{% if linklists.gift-wrapping.links.size > 0 and linklists.gift-wrapping.links.first.type == 'product_link' %}id="is-a-gift"style="clear: left; margin: 30px 0"class="clearfix rte">

id="gift-wrapping"type="checkbox"name="attributes[gift-wrapping]"value="yes"{%ifcart.attributes.gift-wrapping%}checked="checked"{%endif%}style="float: none"/>for="gift-wrapping"style="display:inline; padding-left: 5px; float: none;">For {{ linklists.gift-wrapping.links.first.object.price | money }} per item, please wrap the products in this order.

style="display:block"for="gift-note">Gift message (free and optional):>name="attributes[gift-note]"id="gift-note">{{ cart.attributes.gift-note }}>

{% assign id = linklists.gift-wrapping.links.first.object.variants.first.id %} {% assign gift_wraps_in_cart = 0 %} {% for item in cart.items %} {% if item.id == id %} {% assign gift_wraps_in_cart = item.quantity %} {% endif %} {% endfor %} {% assign items_in_cart = cart.item_count | minus: gift_wraps_in_cart %}{% else %}style="clear: left; margin: 30px 0"class="rte">You attempted to add a gift-wrapping script to your shopping cart, but it won't work because you don't have a link list with handle礼品包装服务which, in turn, contains a link to your gift-wrapping product. Please review the steps outlined<一个href="https://help.shopify.com/manual/online-store/themes/os/customize/add-gift-wrap-option"target="_blank"rel="noopener noreferrer nofollow">here>.

{% endif %}

Include the snippet in your cart template

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

  1. Sectionsdirectory, clickcart-template.liquid. If your theme doesn't have acart-template.liquid, then clickcart.liquidin theTemplatesdirectory.

  2. Findthe closingtag in the code. On a new line above the closingtag, paste the following code:

{%render'gift-wrapping'%}
  1. ClickSave.
Ready to start selling with Shopify?<一个class="ml-4 inline-block cursor-pointer rounded-full bg-black px-5 py-2.5 text-white" href="//www.theturtleeffect.com/accounts/store-create?language=en&locale=en&itcat=help-center&itterm=en-help-p-footer" target="_blank" rel="noopener noreferrer" data-testid="signup-cta-link">Try it free