Installing Product Bundle Snippets 🚀

If you are on the Giftship Standard plan, or higher, and would like to use the product bundle feature, some code installation in your theme is required.

When you installed Giftship, we attempt to install these snippets automatically, however, due to much variation between themes, sometimes this does not work.

In order to verify the installation of these snippets, or to manually install them yourself, please follow the below instructions:

Step 1: Snippet Upload

Verify Giftship’s snippets are uploaded into your theme by navigating to Shopify Admin -> Online Store -> “Your Theme” -> Actions -> Edit Code. In the left hand bar, you should see 3 files under the snippets section. 

If the 3 files are not there, navigate to Giftship’s dashboard, by going to Admin -> Apps -> Giftship and run the “Performance Utility”:

Step 2: Snippet Installation

Next, verify that each snippet has been included in the correct location in your theme.

Snippet 1:

First, you’ll need to locate the line of code that looks like the below excerpt:

{% for item in cart items %}

This is usually found in your templates/cart.liquid file, or your sections/cart-template.liquid file.

Right after this line of code, ensure that the following snippet is there:

{%- include 'giftship-cart-item' with item -%}

If it is not there, paste it directly beneath, so that your code looks like this:

Once the snippet is in place, you will need to change your price display inputs with the variables set in the snippet.

First, find the variable that displays the single item price, and replace it with {{ giftship_price }}. Then, find the variable that displays the line price, and replace it with {{ giftship_line_price }}.

The item price variable might look like any of the below:

{{ item.price }}
{{ item.final_price }}

The line price variable might look like any of the below:

{{ item.line_price }}
{{ item.final_line_price }}

Once your variables are swapped out, click save.

You may also want to total the cart price based on the bundle contents as well. This can be done as follows:

{% assign giftship_subtotal = 0 %}

{% for item in cart.items %}

{% include 'giftship-cart-item' with item %}

{% assign giftship_subtotal = giftship_line_price | plus: giftship_subtotal %}

{% end

Once that is in place, you will need to replace your subtotal price variable with the following:

{{ giftship_subtotal }}

Snippet 2:

The second snippet is normally found on the same page, however, it is for the “line item properties”, which contain the product information about your bundle.

Find the link of code that looks like the below excerpt:

{% for p in item.properties %}

Directly above this, ensure that the following snippet is there:

{%- include 'giftship-cart-item-properties' with item -%}

If it is not there, paste it directly above the property loop, so it looks like this:

Click save.

Snippet 3:

The third snippet is found in your layout/theme.liquid file, right above the closing “</head>” html tag.

First, find the closing “head” tag in your HTML, and verify that the below snippet is located directly above it:

{% include 'giftship' %} 

If it is not there, paste it directly above it, so it looks like below.

Click save. 🙂

Can't find the answer in our documentation?
Contact Support