{% assign hideOtherLabelsWhenSoldOut = true -%} {% assign money_format = request.money_format | strip_html -%} {% assign removePriceDecimal = false -%} {% assign showCentAsSuperscript = false -%} {% assign decimalDelimiter = '' -%} {% assign withoutTrailingZeros = true -%} {% assign compareAtPriceMin = product.compare_at_price_min | default: 0 -%} {% assign priceMin = product.price_min | default: 0 %} {% assign yagi_discount_percentage = product | product_metafield: 'yagi.discount_percentage' | plus: 0 %} {% if yagi_discount_percentage > 0.01 %} {% assign compareAtPriceMin = priceMin %} {% assign deducted_percentage = 1.0 | minus: yagi_discount_percentage %} {% assign priceMin = priceMin | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil %} {% endif %} {% if hideOtherLabelsWhenSoldOut != true -%} {% settings if themeSettings.productItems.productImg.elements.productSaleLabel.isEnable %} {% if compareAtPriceMin > priceMin -%} {% assign percent = compareAtPriceMin | minus: priceMin | times: 100 | divided_by: compareAtPriceMin | round -%} {% if yagi_discount_percentage > 0.01 %} {% assign percent = yagi_discount_percentage | times: 100 | ceil %} {% endif %} {% assign salePercent = percent | append: '%' -%} {% assign saleAmount = compareAtPriceMin | minus: priceMin | format_currency: money_format, showCentAsSuperscript, removePriceDecimal, decimalDelimiter, withoutTrailingZeros -%} {% assign productItemSaleTranslated = "productItem.productItemSale" | translate: translations, "Sale" | replace: '{{salePercent}}', salePercent | replace: '{{saleAmount}}', saleAmount -%}
{{ productItemSaleTranslated }}
{% endif -%} {% settings endif %} {% settings if themeSettings.productItems.productImg.elements.productSoldOutLabel.isEnable %} {% if product.available == false -%}
{{ "productItem.productItemSoldOut" | translate: translations, "Sold out" }}
{% endif -%} {% settings endif %} {% settings if themeSettings.productItems.productImg.elements.productCustomLabelByTag.isEnable %} {% assign filtered_tags = "" -%} {% assign all_tags = product.tags -%} {% if product.original_tags != nill %} {% assign all_tags = all_tags | concat: product.original_tags -%} {% endif %} {% for tag in all_tags -%} {% if tag contains 'pfs:label' -%} {% assign tag_without_label = tag | remove: 'pfs:label-' -%} {% assign filtered_tags = filtered_tags | append: tag_without_label | append: ',' -%} {% endif -%} {% endfor -%} {% assign filtered_tags = filtered_tags | split: ',' -%} {% for tag in filtered_tags -%} {% unless tag == blank %}
{{ tag }}
{% endunless %} {% endfor -%} {% settings endif %} {% else -%} {% if product.available == false -%} {% settings if themeSettings.productItems.productImg.elements.productSoldOutLabel.isEnable %}
{{ "productItem.productItemSoldOut" | translate: translations, "Sold out" }}
{% settings endif %} {% else -%} {% settings if themeSettings.productItems.productImg.elements.productSaleLabel.isEnable %} {% if compareAtPriceMin > priceMin -%} {% assign percent = compareAtPriceMin | minus: priceMin | times: 100 | divided_by: compareAtPriceMin| round -%} {% if yagi_discount_percentage > 0.01 %} {% assign percent = yagi_discount_percentage | times: 100 | ceil %} {% endif %} {% assign salePercent = percent | append: '%' -%} {% assign saleAmount = compareAtPriceMin | minus: priceMin | format_currency: money_format, showCentAsSuperscript, removePriceDecimal, decimalDelimiter, withoutTrailingZeros -%} {% assign translatedText = "productItem.productItemSale" | translate: translations, "Sale" | replace: '{{salePercent}}', salePercent | replace: '{{saleAmount}}', saleAmount %}
{{ translatedText }}
{% endif -%} {% settings endif %} {% settings if themeSettings.productItems.productImg.elements.productCustomLabelByTag.isEnable %} {% assign filtered_tags = "" -%} {% assign all_tags = product.tags -%} {% if product.original_tags != nill %} {% assign all_tags = all_tags | concat: product.original_tags -%} {% endif %} {% for tag in all_tags -%} {% if tag contains 'pfs:label' -%} {% assign tag_without_label = tag | remove: 'pfs:label-' -%} {% assign filtered_tags = filtered_tags | append: tag_without_label | append: ',' -%} {% endif -%} {% endfor -%} {% assign filtered_tags = filtered_tags | split: ',' -%} {% for tag in filtered_tags -%} {% unless tag == blank %}
{{ tag }}
{% endunless %} {% endfor -%} {% settings endif %} {% endif -%} {% endif -%}