PART I: Updating your cart

Step 1: Go to Themes > Current theme

Step 2: Under `Actions` of your current theme, press `Edit Code`

Step 3: Type in ‘cart-template’ in the search field, and click on the liquid file under the folder ‘Sections’

Step 4: Press ‘ctrl+f’(Search) inside the code editor and search for the following codes:

These changes will allow Raid Funnels to dynamically update the cart prices according to the discounts that the customers will receive.

Do note that some of them might not be found on your template. If you can't find, you may skip the instruction and move on to the next tag.

Cart Item Original Price

This class shows the slashed original price and the discounted price

Find

{{ item.original_price | money }}

Replace it with: 

<span class='raidupsell-cart-item-original-price' data-key='{{item.key}}'> {{ item.original_price | money }} </span>

Sample:

Cart Item Price

Find

{{ item.price | money }}

Replace it with

<span class='raidupsell-cart-item-price' data-key='{{item.key}}'> {{ item.price | money }} </span>

Cart Item Line Price

Find

{{ item.line_price | money }}

Replace it with

<span class='raidupsell-cart-item-line-price' data-key='{{item.key}}'> {{ item.line_price | money }} </span>

Cart Item Original Line Price

Find

{{ item.original_line_price | money }}

Replace it with

<span class='raidupsell-cart-original-line-price' data-key='{{item.key}}'> {{ item.original_line_price | money }} </span>

Cart Item Final Line Price
Find

{{ item.final_line_price | money }}

Replace it with:

<span class='raidupsell-cart-final-line-price' data-key='{{item.key}}'> {{ item.final_line_price | money }} </span> 

Cart Item Key

Find

{%- if property_size > 0 -%}

Replace it with

<div class='raidupsell-cart-item-detail' data-key='{{item.key}}'></div> {%- if property_size > 0 -%}

Cart Total Price

Find

{{ cart.total_price | money }}

Replace it with

<span class='raidupsell-cart-total-price' data-key='{{item.key}}'> {{ cart.total_price | money }} </span>

Find

{{ cart.total_price | money_with_currency }}

Replace it with

<span class='raidupsell-cart-total-price' data-key='{{item.key}}'> {{ cart.total_price | money_with_currency }} </span>

If these codes are not found inside your cart-template liquid file, search for cart.liquid instead and replace raid codes to the file.

PART II: Install additional styles

In order to style your cart, we need to add some additional styles. To make it easier to manage, these styles can be saved as a separate snippet.

Step 1: Go to Themes > Current theme

Step 2: Under `Actions` of your current theme, press `Edit Code`

Step 3:Type in ‘snippets’ in the search field

Step 4: Under the snippets folder, click the link that says ‘Add a new snippet’

Name your new snippet file, raidfunnels_common.liquid 

Step 5: Paste the code below inside the newly created snippet:

raidfunnels_common.liquid  code:

<style>
  .raid-discount-terms{
      font-size: 13px;
      display: block
  }
  [data-classname="raid-compare-price"]{
      text-decoration: line-through;
      color: #b1b1b2;
      margin: 0 5px 0 0;
  }
  .raid-price{
      text-decoration: line-through;
      color: #b1b1b2;
      margin: 0 5px 0 0;
  }
  .raid-final-price{

  }
  .raidupsell-cart-item-detail{

  }
</style>
<script>
    window.raidupsellshop = {
        shop_slug: "{{shop.permanent_domain | remove: '.myshopify.com' }}",
        store_id: "{{shop.permanent_domain}}",
        money_format: "{{shop.money_format | replace: '"', "'"}}",
        cart: null,
        page_type: null,
        customer: null
    }
    {% if customer %}
        {% assign tags = "" %}
        {% for tag in customer.tags %}
            {% if forloop.index == 1 %}
                {% assign tags = tags | append : tag %}
            {% else %}
                {% assign tags = tags | append : ","| append : tag %}
            {% endif %}
        {% endfor %}
        window.hulkapps.customer = {
            id: {{customer.id}},
            tags: "{{tags}}"
        }
    {% endif %}
    {% if template contains "cart" %}
        window.raidupsellshop.page_type = "cart";
        window.raidupsellshop.cart = {{ cart | json }}
        if (typeof window.raidupsellshop.cart.items == "object") {
            for (var i=0; i<window.raidupsellshop.cart.items.length; i++) {
                ["sku", "grams", "vendor", "url", "image", "handle", "requires_shipping", "product_type", "product_description"].map(function(a) {
                    delete window.raidupsellshop.cart.items[i][a]
                })
            }
        }
        window.raidupsellshop.cart_collections = {}
        {% for item in cart.items %}
            window.raidupsellshop.cart_collections["{{item.variant_id}}"] = []
            {% for c in item.product.collections %}
                window.raidupsellshop.cart_collections["{{item.variant_id}}"].push({{c.id}})
            {% endfor %}
        {% endfor %}
    {% endif %}
</script>

PART III: Include the snippet into your theme

Step 1: Go to Themes > Current theme

Step 2: Under `Actions` of your current theme, press `Edit Code`

Step 3: Type in ‘layout/theme.liquid’ in the search field, and click on the liquid file with the filename, ‘theme.liquid’

Step 4: Scroll all the way down in the liquid file and insert the following code just before the closing </body> tag:

{% include 'raidfunnels_common' %}
Did this answer your question?