I want to move the sale badge to somewhere that doesn’t cut off the image. Theme is focal.
see website https://clearskinhouse.com.au/collections/aspect
I want to move the sale badge to somewhere that doesn’t cut off the image. Theme is focal.
see website https://clearskinhouse.com.au/collections/aspect
[dir=ltr] .product-item__label-list {
bottom: 0 !important;
top: auto !important;
}
Option 3 please
Hi @Clearskinhouse ,
Please send me the code of product-item.liquid file or product-card.liquid file. I will check it
I don’t have either of those files?
Hi @Clearskinhouse ,
Can you try with card-product.liquid file? or I can send you collaborator invite and change it for you
{%- assign color_label_list = ‘general.label.color’ | t | replace: ', ', ‘,’ | downcase | split: ‘,’ -%}
{%- assign color_white_label = ‘general.label.white’ | t | downcase -%}
{%- assign quick_buy_icon_name = ‘quick-buy-’ | append: settings.cart_icon | replace: ‘_’, ‘-’ -%}
{%- if product.url contains ‘?’ -%}
{%- assign product_url_contains_query = true -%}
{%- else -%}
{%- assign product_url_contains_query = false -%}
{%- endif -%}
<product-item class=“product-item {% unless product.available %}product-item–sold-out{% endunless %}” {% if reveal %}reveal{% endif %}>
{%- capture product_labels -%}
{%- for tag in product.tags -%}
{%- if tag contains ‘__label’ -%}
{{ tag | split: ‘:’ | last }}
{%- endif -%}
{%- endfor -%}
{%- unless product.available -%}
{{ ‘collection.product.sold_out’ | t }}
{%- endunless -%}
{%- assign cheapest_variant = product.variants | sort: ‘price’ | first -%}
{%- if settings.show_discount and product.available and product.price < product.compare_at_price and cheapest_variant.compare_at_price != blank -%}
{%- if settings.discount_mode == ‘percentage’ -%}
{%- assign savings = product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price | round | append: ‘%’ -%}
{%- else -%}
{%- capture savings -%}{{ product.compare_at_price | minus: product.price | money }}{%- endcapture -%}
{%- endif -%}
{{ ‘collection.product.discount_html’ | t: savings: savings }}
{%- endif -%}
{%- endcapture -%}
{%- if settings.product_color_display == ‘swatch’ -%}
{%- assign featured_media = product.variants | map: ‘featured_media’ -%}
{%- for media in featured_media -%}
{%- unless media == product.featured_media -%}
<img class=“product-item__primary-image” hidden data-media-id=“{{ media.id | escape }}” loading=“lazy” sizes=“{{ sizes_attribute }}” {% render ‘image-attributes’, image: media, sizes: ‘200,300,400,500,600,700,800,900,1000,1100,1200’ %}>
{%- endunless -%}
{%- endfor -%}
{%- endif -%}
{%- if request.page_type != ‘password’ and settings.product_add_to_cart and product.available and reduced_content != true and show_cta != true -%}
{%- if product.variants.size == 1 -%}
{%- capture form_id -%}product_form_{{ section.id }}{{ block.id }}{{ product.id }}_{% increment product_form_index %}{%- endcapture -%}
{%- form ‘product’, product, data-productid: product.id, is: ‘product-form’, id: form_id, class: ‘product-item__quick-form’ -%}
{{ ‘collection.product.add_to_cart_short’ | t }}
{{ ‘collection.product.add_to_cart_short’ | t }}
{%- render ‘icon’ with quick_buy_icon_name -%}
{%- endform -%}
{%- else -%}
{%- comment -%}
IMPLEMENTATION NOTE: Depending on the device we show a different icon or open a different mode (either popover or drawer)
{%- endcomment -%}
{%- endif -%}
{%- endif -%}
{%- unless collection_for_vendor.empty? -%}
{{ product.vendor }}
{%- else -%}
{{ product.vendor }}
{%- endunless -%}
{%- endif -%}
{%- capture price_min -%}
{%- if settings.currency_code_enabled -%}
{{- cheapest_variant.price | money_with_currency -}}
{%- else -%}
{{- cheapest_variant.price | money -}}
{%- endif -%}
{%- endcapture -%}
{%- if cheapest_variant.price < cheapest_variant.compare_at_price -%}
{{ ‘product.general.sale_price’ | t }}
{{- ‘collection.product.from_price_html’ | t: price_min: price_min -}}
{%- if settings.currency_code_enabled -%}
{{- cheapest_variant.compare_at_price | money_with_currency -}}
{%- else -%}
{{- cheapest_variant.compare_at_price | money -}}
{%- endif -%}
{%- else -%}
{{ ‘product.general.sale_price’ | t }}
{{- ‘collection.product.from_price_html’ | t: price_min: price_min -}}
{%- endif -%}
{%- elsif product.price < product.compare_at_price -%}
{{ ‘product.general.sale_price’ | t }}
{%- if settings.currency_code_enabled -%}
{{- product.price | money_with_currency -}}
{%- else -%}
{{- product.price | money -}}
{%- endif -%}
{%- capture price_max -%}
{%- if settings.currency_code_enabled -%}
{{- product.price_max | money_with_currency -}}
{%- else -%}
{{- product.price_max | money -}}
{%- endif -%}
{%- endcapture -%}
{%- if settings.currency_code_enabled -%}
{{- product.price | money_with_currency -}}
{%- else -%}
{{- product.price | money -}}
{%- endif -%}
{%- endif -%}
{%- if product.selected_or_first_available_variant.unit_price_measurement -%}
{%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_value }}
{%- endif -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
{%- if settings.show_product_rating and reduced_content != true -%}
{%- render ‘product-rating’, product: product -%}
{%- endif -%}
{%- if settings.product_color_display != ‘hide’ and reduced_content != true -%}
{%- for color_label in color_label_list -%}
{%- if product.options_by_name[color_label] != blank -%}
{%- assign product_option = product.options_by_name[color_label] -%}
{%- case settings.product_color_display -%}
{%- when ‘count’ -%}
{{- 'collection.product.available_colors_count' | t: count: product_option.values.size -}}
{%- when ‘swatch’ -%}
{%- capture color_name -%}{{ section.id }}-{{ block.id }}-{{ product.id }}{%- endcapture -%}
{%- for value in product_option.values -%}
{%- capture color_id -%}{{ color_name }}-{{ forloop.index }}{%- endcapture -%}
{%- assign color_value_downcase = value | downcase -%}
{%- assign variant_for_value = product.variants | where: variant_option, value | first -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{% comment %}
{%- if product.available and reduced_content or show_cta -%}
{% else %}
{%- if product.available %}
{%- form ‘product’, product, data-productid: product.id, is: ‘product-form’, id: form_id -%}
<button type=“submit” {% if show_cta %}is=“loader-button”{% endif %} class=“{% if reduced_content %}product-item__link link text–subdued{% else %}product-item__cta button button–primary{% endif %}”>{{ ‘collection.product.add_to_cart_short’ | t }}
{%- endform -%}
{% else %}
{{ ‘collection.product.sold_out’ | t }}
{%- endif -%}
{% endif %}
{%- else -%}
<button type=“button” {% if show_cta %}loader{% endif %} is=“toggle-button” aria-controls=“product-{{ section.id }}-{{ block.id }}-{{ product.id }}-drawer” aria-expanded=“false” class=“{% if reduced_content %}product-item__link link text–subdued{% else %}product-item__cta button button–primary{% endif %} hidden-phone”>{{ ‘collection.product.quick_view’ | t }}
<button type=“button” {% if show_cta %}loader{% endif %} is=“toggle-button” aria-controls=“product-{{ section.id }}-{{ block.id }}-{{ product.id }}-popover” aria-expanded=“false” class=“{% if reduced_content %}product-item__link link text–subdued{% else %}product-item__cta button button–primary{% endif %} hidden-tablet-and-up”>{{ ‘collection.product.quick_view’ | t }}
{%- endif -%}
See code below
Hi @Clearskinhouse ,
Please change all code:
{%- assign color_label_list = 'general.label.color' | t | replace: ', ', ',' | downcase | split: ',' -%}
{%- assign color_white_label = 'general.label.white' | t | downcase -%}
{%- assign quick_buy_icon_name = 'quick-buy-' | append: settings.cart_icon | replace: '_', '-' -%}
{%- if product.url contains '?' -%}
{%- assign product_url_contains_query = true -%}
{%- else -%}
{%- assign product_url_contains_query = false -%}
{%- endif -%}
That worked. Is there a way to make each product evenly spaced so everything g is aligned when there are side by side? I don’t like how sometimes the add to cart button is lower than the one next to it and vice versa
Hi @Clearskinhouse ,
I checked and the ‘add to cart’ buttons are aligned, can you explain more about it?