|
<!-- Begin related product --> |
|
<div class="recommended-products"> |
|
<h2 class="section-title">YOU MAKE LIKE</h2> |
|
<ul class=" |
|
product-row |
|
uniform-layout |
|
under-style |
|
rows-of-4"> |
|
{% assign vendor = product.title %} |
|
{% assign vendor_handle = vendor | handleize %} |
|
{% assign handle = product.handle %} |
|
{% assign counter = '' %} |
|
{% paginate collections.all.products by 1000 %} |
|
{% for related_product in collections.all.products %} |
|
{% if vendor == related_product.title and counter.size < 4 and handle != related_product.handle %} |
|
{% capture temp %}{{ counter }}*{% endcapture %} |
|
{% assign counter = temp %} |
|
<li class="product-list-item"> |
|
{% if related_product.price_min < related_product.compare_at_price_min %} |
|
{% if settings.show_sale_circle %} |
|
<span class="circle sale">Sale</span> |
|
{% endif %} |
|
{% endif %} |
|
|
|
<a href="{{ related_product.url }}"> |
|
<img src="{{ related_product.featured_image | product_img_url: 'large' }}" alt="{{ related_product.title | escape }}" /> |
|
</a> |
|
|
|
<div class="product-list-item-details"> |
|
<a href="{{ related_product.url }}" class="clearfix"> |
|
<h4 class="product-list-item-title">{{ related_product.title }}</h4> |
|
<h4 class="product-list-item-title font-weight">{{ related_product.tags.first | link_to_tag: product.tags.first }}</h4> |
|
|
|
{% if settings.product_vendor %} |
|
<span class="vendor">{{ related_product.vendor }}</span> |
|
{% endif %} |
|
|
|
<p class="product-list-item-price"><span class="price-money"></span> |
|
{% if related_product.available %} |
|
{% if related_product.compare_at_price_max > related_product.price %} |
|
<p class="product-list-item-price">{{ related_product.compare_at_price | money }}</p> |
|
{% endif %} |
|
{% if related_product.price_varies %} |
|
<small>from</small> |
|
{% endif %} |
|
{{ related_product.price | money }} |
|
{% else %} |
|
{{ related_product.price | money }} Sold Out |
|
{% endif %} |
|
</p> |
|
</a> |
|
</div> |
|
</li> |
|
{% endif %} |
|
{% endfor %} |
|
{%- endpaginate -%} |
|
</ul> |
|
</div> |
logic for custom related items example https://snapbook.com/collections/cases/products/moroccan-pattern