{% comment %} Renders a product card Accepts: - card_product: {Object} Product Liquid object (optional) - media_aspect_ratio: {String} Size of the product image card. Values are "square" and "portrait". Default is "square" (optional) - image_shape: {String} Image mask to apply to the product image card. Values are "arch", "blob", "chevronleft", "chevronright", "diamond", "parallelogram", and "round". (optional) - show_secondary_image: {String} Show the secondary image on hover. Values are "inherit" and "disabled". Default: inherit (optional) - show_carousel: {String} Show the product image carousel. Values are "inherit" and "disabled". Default: inherit (optional) - show_vendor: {Boolean} Show the product vendor. Default: false - show_rating: {Boolean} Show the product rating. Default: false - show_price: {Boolean} Show the product price. Default: True - custom_badge_label: {String} Custom label for the badge - extend_height: {Boolean} Card height extends to available container space. Default: true (optional) - skip_styles: {Boolean} Don't include component styles. Useful when rendering multiple product cards in a loop. Default: false (optional) - quick_add: {Boolean} Show the quick add button. - section_id: {String} The ID of the section that contains this card. - horizontal_class: {Boolean} Add a card--horizontal class if set to true. Default: false (optional) - horizontal_quick_add: {Boolean} Changes the quick add button styles when set to true. Default: false (optional) - placeholder_image: {String} The placeholder image to use when no product exists. Default: 'product-apparel-2' (optional) Usage: {% render 'card-product', show_vendor: section.settings.show_vendor %} {% endcomment %} {% liquid if hide_price == blank assign hide_price = false endif if show_sold_out_badge == blank assign show_sold_out_badge = false endif if show_sale_badge == blank assign show_sale_badge = false endif %} {% comment %} hide for professionals {% endcomment %} {% assign is_pro_customer = false %} {% if customer %} {% if customer.tags contains 'Pro level 1' or customer.tags contains 'Pro level 2' or customer.tags contains 'Pro level 3' %} {% assign is_pro_customer = true %} {% endif %} {% endif %} {% assign is_professional_product = false %} {% for c in card_product.collections %} {% if c.handle == 'professional-use' %} {% assign is_professional_product = true %} {% break %} {% endif %} {% endfor %} {% if media_aspect_ratio %} {% if media_aspect_ratio != 'inherit' %} {% assign image_aspect_ratio = media_aspect_ratio %} {% if media_aspect_ratio == 'circle' %} {% assign image_aspect_ratio = '100%' %} {% endif %} {% style %} #shopify-section-{{ section.id }}{ --dbtfy-image-crop-ratio: {{ image_aspect_ratio }}; } {% endstyle %} {% else %} {% assign media_aspect_ratio = settings.dbtfy_product_image_crop_ratio %} {% endif %} {% endif %} {% if image_crop_position and image_crop_position != 'inherit' %} {% style %} #shopify-section-{{ section.id }}{ --dbtfy-image-crop-position: {{ image_crop_position }}; } {% endstyle %} {% endif %} {%- unless skip_styles -%} {{ 'component-rating.css' | asset_url | stylesheet_tag }} {{ 'component-volume-pricing.css' | asset_url | stylesheet_tag }} {{ 'component-price.css' | asset_url | stylesheet_tag }} {{ 'quick-order-list.css' | asset_url | stylesheet_tag }} {{ 'quantity-popover.css' | asset_url | stylesheet_tag }} {%- endunless -%} {%- if card_product and card_product != empty -%} {%- liquid if show_secondary_image == 'inherit' and settings.dbtfy_show_second_image_on_hover assign show_secondary_image = true else assign show_secondary_image = false endif if show_carousel == 'inherit' and settings.dbtfy_show_product_card_carousel assign show_carousel = true else assign show_carousel = false endif -%}
{{ options | json }}
{% endfor %} {% for variant in card_product.variants -%} {% for option in variant.options -%} {{ option }} {%- endfor %} {%- endfor %} {% endcomment %}