forked from TrellisCommerce/shopify-tailwind-starter-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart-notification-product.liquid
53 lines (53 loc) · 2.06 KB
/
cart-notification-product.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{%- if cart != empty -%}
{%- for item in cart.items -%}
<div id="cart-notification-product-{{ item.key }}" class="cart-item">
{%- if item.image -%}
<div class="cart-notification-product__image global-media-settings">
<img
src="{{ item.image | image_url: width: 140 }}"
alt="{{ item.image.alt | escape }}"
width="70"
height="{{ 70 | divided_by: item.image.aspect_ratio | ceil }}"
loading="lazy"
>
</div>
{%- endif -%}
<div>
{%- if settings.show_vendor -%}
<p class="caption-with-letter-spacing light">{{ item.product.vendor }}</p>
{%- endif -%}
<h3 class="cart-notification-product__name h4">{{ item.product.title | escape }}</h3>
<dl>
{%- unless item.product.has_only_default_variant -%}
{%- for option in item.options_with_values -%}
<div class="product-option">
<dt>{{ option.name }}:</dt>
<dd>{{ option.value }}</dd>
</div>
{%- endfor -%}
{%- endunless -%}
{%- for property in item.properties -%}
{%- assign property_first_char = property.first | slice: 0 -%}
{%- if property.last != blank and property_first_char != '_' -%}
<div class="product-option">
<dt>{{ property.first }}:</dt>
<dd>
{%- if property.last contains '/uploads/' -%}
<a href="{{ property.last }}" class="link" target="_blank">
{{ property.last | split: '/' | last }}
</a>
{%- else -%}
{{ property.last }}
{%- endif -%}
</dd>
</div>
{%- endif -%}
{%- endfor -%}
</dl>
{%- if item.selling_plan_allocation != nil -%}
<p class="product-option">{{ item.selling_plan_allocation.selling_plan.name }}</p>
{%- endif -%}
</div>
</div>
{%- endfor -%}
{%- endif -%}