Hello
How to make my text input a required field, so that my shoppers can’t add the product to the cart without filling this field. Add “Fill Out This Field” tooltip in case the input fields are left empty.
{%- if section.settings.product != blank -%}
{% include ‘global-variables’ %}
{%- assign product = all_products[section.settings.product] -%}
{% include ‘product-res-variables’ %}
{%- assign image_size = image_size | default: ‘470x’ -%}
{%- assign reverse = reverse | default: section.settings.reverse -%}
{%- assign show_arrows = show_arrows | default: section.settings.show_arrows -%}
{%- assign show_label_in_stock = show_label_in_stock | default: section.settings.show_label_in_stock -%}
{%- assign show_label_pre_order = show_label_pre_order | default: section.settings.show_label_pre_order -%}
{%- assign show_label_out_stock = show_label_out_stock | default: section.settings.show_label_out_stock -%}
{%- assign show_label_sale = show_label_sale | default: section.settings.show_label_sale -%}
{%- assign show_label_new = show_label_new | default: section.settings.show_label_new -%}
{%- assign show_label_hot = show_label_hot | default: section.settings.show_label_hot -%}
{%- assign show_collections = show_collections | default: section.settings.show_collections -%}
{%- assign show_title = show_title | default: section.settings.show_title -%}
{%- assign show_sku = show_sku | default: section.settings.show_sku -%}
{%- assign show_barcode = show_barcode | default: section.settings.show_barcode -%}
{%- assign show_availability = show_availability | default: section.settings.show_availability -%}
{%- assign show_type = show_type | default: section.settings.show_type -%}
{%- assign show_vendor = show_vendor | default: section.settings.show_vendor -%}
{%- assign show_price = show_price | default: section.settings.show_price -%}
{%- assign show_sale_details = show_sale_details | default: section.settings.show_sale_details -%}
{%- assign show_options = show_options | default: section.settings.show_options -%}
{%- assign show_custom_options = show_custom_options | default: settings.product_show_custom_options -%}
{%- assign show_size_guide = show_size_guide | default: section.settings.show_size_guide -%}
{%- assign show_delivery_return = show_delivery_return | default: section.settings.show_delivery_return -%}
{%- assign show_quantity = show_quantity | default: section.settings.show_quantity -%}
{%- assign show_button_add_to_cart = show_button_add_to_cart | default: section.settings.show_button_add_to_cart -%}
{%- assign show_button_add_to_wishlist = show_button_add_to_wishlist | default: section.settings.show_button_add_to_wishlist -%}
{%- assign show_button_add_to_compare = show_button_add_to_compare | default: section.settings.show_button_add_to_compare -%}
{%- assign show_button_dynamic_checkout = show_button_dynamic_checkout | default: section.settings.show_button_dynamic_checkout -%}
{%- assign show_dynamic_checkout_confirmation = show_dynamic_checkout_confirmation | default: section.settings.show_dynamic_checkout_confirmation -%}
{%- assign styled_dynamic_checkout = styled_dynamic_checkout | default: section.settings.styled_dynamic_checkout -%}
{%- assign show_reviews = show_reviews | default: section.settings.show_reviews -%}
{%- assign hide_reviews_counter = hide_reviews_counter | default: section.settings.hide_reviews_counter -%}
{%- assign show_countdown = show_countdown | default: section.settings.show_countdown -%}
{% capture image_size_placeholder %}_{width}x.{% endcapture %}
{%- if settings.compare_type == ‘disable’ -%}
{%- assign show_button_add_to_compare = false -%}
{%- endif -%}
{%- if settings.wishlist_type == ‘disable’ -%}
{%- assign show_button_add_to_wishlist = false -%}
{%- endif -%}
{%- if settings.reviews_type == ‘disable’ -%}
{%- assign show_reviews = false -%}
{%- endif -%}
{%- if section.settings.layout == ‘1’ -%}
{%- assign mobile_centered = true -%}
{%- assign mobile_start = false -%}
{%- else -%}
{%- assign mobile_centered = false -%}
{%- assign mobile_start = true -%}
{%- endif -%}
{%- assign product_form_id = ‘product-form-’ | append: section.id -%}
{%- elsif settings.reviews_type == ‘loox’ and product.metafields.loox.num_reviews -%}
{%- endif -%}
{{ 'products.product.sku' | t }}: {{ sku }}
{{ 'products.product.barcode' | t }}: {{ barcode }}
{{ 'products.product.availability' | t }}: {% if available %}{{ 'products.product.availability_value_in_stock' | t: count: quantity, item: item }}{% else %}{{ 'products.product.availability_value_out_stock' | t }}{% endif %}
{{ 'products.product.type' | t }}: {{ type }}
{{ 'products.product.vendor' | t }}: {{ vendor }}
{%- if compare_at_price > price -%} {%- assign price_save = compare_at_price | minus: price -%} {%- assign price_save_money = price_save | money -%} {%- assign price_save_procent = price | times: 100 | divided_by: compare_at_price | minus: 100 | times: -1 -%} {{ 'products.product.price_sale_details_html' | t: price: price_save_money, procent: price_save_procent }} {%- endif -%}
{%- endif -%}{% if product.title contains ‘oh Wanted Studio 3D Customized Car Plate Keychain’ %}
{%- if show_button_add_to_cart or show_options -%}
{% schema %}
{
“name”: “One product”,
“settings”: [
{
“type”: “product”,
“id”: “product”,
“label”: “Product”
},
{
“type”: “select”,
“id”: “layout”,
“label”: “Layout”,
“default”: “1”,
“options”: [
{
“value”: “1”,
“label”: “1 (mobile centered)”
},
{
“value”: “2”,
“label”: “2”
}
]
},
{
“type”: “checkbox”,
“id”: “reverse”,
“label”: “Reverse layout”,
“default”: false
},
{
“type”: “header”,
“content”: “Gallery”
},
{
“type”: “checkbox”,
“id”: “show_gallery”,
“label”: “Show gallery”,
“default”: true
},
{
“type”: “image_picker”,
“id”: “image”,
“label”: “Image”
},
{
“type”: “checkbox”,
“id”: “show_arrows”,
“label”: “Arrows”,
“default”: true
},
{
“type”: “header”,
“content”: “Labels”
},
{
“type”: “checkbox”,
“id”: “show_label_in_stock”,
“label”: “Show label ‘In stock’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_label_pre_order”,
“label”: “Show label ‘Pre order’”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_label_out_stock”,
“label”: “Show label ‘Out of stock’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_label_sale”,
“label”: “Show label ‘Sale’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_label_new”,
“label”: “Show label ‘New’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_label_hot”,
“label”: “Show label ‘Hot’”,
“default”: false
},
{
“type”: “header”,
“content”: “Elements”
},
{
“type”: “checkbox”,
“id”: “show_collections”,
“label”: “Show the product’s collections”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_title”,
“label”: “Show the product title”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_price”,
“label”: “Show the product price”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_sale_details”,
“label”: “Show sale price details”,
“default”: true
},
{
“type”: “textarea”,
“id”: “description_content”,
“label”: “Description content”,
“info”: “Clear field to remove description”,
“default”: “Description”
},
{
“type”: “checkbox”,
“id”: “show_sku”,
“label”: “Show product SKU”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_barcode”,
“label”: “Show product barcode”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_availability”,
“label”: “Show product stock status”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_type”,
“label”: “Show product type”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show product vendor”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_reviews”,
“label”: “Show product reviews”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “hide_reviews_counter”,
“label”: “Hide reviews counter”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_countdown”,
“label”: “Show countdown”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_options”,
“label”: “Show options (variants)”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_size_guide”,
“label”: “Show button ‘Size guide’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_delivery_return”,
“label”: “Show button ‘Delivery return’”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_quantity”,
“label”: “Show quantity”,
“default”: false
},
{
“type”: “select”,
“id”: “button_layout”,
“label”: “Buttons layout”,
“default”: “1”,
“options”: [
{
“value”: “1”,
“label”: “1”
},
{
“value”: “2”,
“label”: “2”
}
]
},
{
“type”: “checkbox”,
“id”: “show_button_add_to_cart”,
“label”: “Show button ‘Add to cart’”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_button_add_to_wishlist”,
“label”: “Show button ‘Add to wishlist’”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_button_add_to_compare”,
“label”: “Show button ‘Add to compare’”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_button_dynamic_checkout”,
“label”: “Show dynamic checkout button”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_dynamic_checkout_confirmation”,
“label”: “Show dynamic checkout confirmation”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “styled_dynamic_checkout”,
“label”: “Custom style for dynamic checkout button”,
“default”: false
},
{
“type”: “header”,
“content”: “Background image”
},
{
“type”: “image_picker”,
“id”: “bg_image”,
“label”: “Background image”
},
{
“type”: “select”,
“id”: “height”,
“label”: “Image height”,
“default”: “auto”,
“options”: [
{
“value”: “auto”,
“label”: “Auto adaptation to the image”
},
{
“value”: “fullscreen”,
“label”: “Fullscreen”
},
{
“value”: “fullscreen_header”,
“label”: “Fullscreen excluding header”
}
]
},
{
“type”: “image_picker”,
“id”: “bg_image_mobile”,
“label”: “Mobile background image”
},
{
“type”: “header”,
“content”: “Support”
},
{
“type”: “paragraph”,
“content”: “Watch video tutorials”
},
{
“type”: “paragraph”,
“content”: “Read user manual”
}
],
“presets”: [
{
“name”: “One product”,
“category”: “4) Collections”
}
]
}
{% endschema %}