Hello, i want do show a total compare at price in the cart.
My cart is splittet into two sections main-cart-footer.liquid and main-cart-items.liquid
in the main-cart-items.liquid i have a variable with the name “compareat”
{% assign compareat = 0 %}
{% assign compareat2 = 0 %}
{%- for item in cart.items -%}
{% assign compareat2 = item.variant.compare_at_price | times: item.quantity %}
{% assign compareat = compareat | plus: compareat2 %}
{%- endfor -%}
in the main-cart-items.liquid the compare at price works great but i can’t use this “compareat” variable in the main-cart-footer.liquid.
How can i make this variable as a global variable in shopify?