require input when buying.

Phigolf
Excursionist
18 0 1

 

                 {%- form 'product', product, id: id_frm, data-productid: pid, class: cl_frm -%}
                    {{ form | payment_terms }}
                    {%- if no_sold_out and settings.enable_sub_reCharge %}{% include 'subscription-product' %}{% endif -%} 
                    {%- if settings.enable_infiniteoptions %}<div id="infiniteoptions-container"></div>{% endif -%} 
                    {%- if default -%}
                       <input name="id" data-productid="{{pid}}" value="{{ pr_variants.first.id }}" type="hidden">
                       <div class="nt_pr_js lazypreloadt4s op__0" data-id="{{call_cl}}" data-rendert4s="{{locale_url}}/products/{{product.handle}}/?view=js{{call_cl}}"></div>
                       {%- if pr_incoming_mess and inventory_management and inventory_quantity <= 0 and current_variant.incoming -%}
                           {%- assign idate = current_variant.next_incoming_date | date: format: settings.date_in -%}
                           <div id="pr_incoming_mess{{call_cl}}" class="nt_varianqtyss mb__15 cb tu fwsb">{% if current_variant.available %}{{ 'products.product.will_not_ship_until_html' | t: date:idate }}{% else %}{{ 'products.product.will_be_in_stock_after_html' | t: date:idate }}{% endif %}</div>
                       {%- endif -%}
                       {{-product.metafields.meta.customProperty -}}
                    {%- else -%}
                       <select name="id" data-productid="{{pid}}" id="product-select{{call_cl}}" class="product-select_pr product-form__variants hide hidden">
                          {%- for variant in pr_variants -%}
                              {%- if variant.available -%}
                                <option {% if variant.id == current_variant.id %} selected="selected" {% endif %} value="{{ variant.id }}">{{ variant.title | escape }}</option>
                              {%- else -%}
                                <option value="{{ variant.id }}"{%- if remove_soldout %} disabled="disabled"{%- endif %} class="nt_sold_out">{{ variant.title | escape }}</option>
                              {%- endif -%}
                            {%- endfor -%}
                       </select>

                       {%- case bk_stts.swatch_design -%}
                          {%- when '1' -%}{%- render 'swatch',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '2' -%}{%- render 'swatch_2',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '3' -%}{%- render 'swatch_radio',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '4' -%}{%- render 'swatch_radio_2',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '5' -%}{%- render 'swatch_radio_3',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '6' -%}{%- render 'swatch_radio_4',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '7' -%}{%- render 'swatch_rectangle',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '8' -%}{%- render 'swatch_rectangle_2',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '9' -%}{%- render 'swatch_simple',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                          {%- when '10' -%}{%- render 'swatch_simple_2',product:product,block:block,remove_soldout:remove_soldout,call_cl:call_cl,locale_url:locale_url,html_sizeg:html_sizeg,ck_sizeg:ck_sizeg,name_sizeg:name_sizeg -%}
                       {%- endcase -%}
                       {{-product.metafields.meta.customProperty -}}
                        <div class="nt_pr_js lazypreloadt4s op__0" data-id="{{call_cl}}" data-rendert4s="{{locale_url}}/products/{{product.handle}}/?view=js{{call_cl}}"></div>
                       {%- if pr_incoming_mess -%}
                          {%- if inventory_quantity <= 0 and current_variant.incoming and variants_size < 2 and inventory_management  -%}
                              {%- assign idate = current_variant.next_incoming_date | date: format: settings.date_in -%}
                              <div id="pr_incoming_mess{{call_cl}}" class="nt_varianqtyss mb__15 cb tu fwsb">{% if current_variant.available %}{{ 'products.product.will_not_ship_until_html' | t: date:idate }}{% else %}{{ 'products.product.will_be_in_stock_after_html' | t: date:idate }}{% endif %}</div>
                          {%- else -%}
                              <div id="pr_incoming_mess{{call_cl}}" class="nt_varianqty mb__15 cb tu fwsb dn">{{ 'products.product.will_not_ship_until_html' | t: date:'[19041994]' }}</div>
                          {%- endif -%}
                       {%- endif -%}
                    {%- endif -%}

                   {%- if price_varies and current_variant.unit_price_measurement -%}
                        <span class="price">
                           <span class="price_varies">
                            {%- if on_sale -%}<del>{{ current_variant.compare_at_price  | money }}</del><ins>{{ current_variant.price | money }}</ins>{%- else -%}{{ current_variant.price | money }}{%- endif -%}
                           </span>
                           {%- capture unit_price_base_unit -%}
                            <span class="unit_base">
                              {%- if current_variant.unit_price_measurement -%}
                                {%- if current_variant.unit_price_measurement.reference_value != 1 -%}
                                  {{- current_variant.unit_price_measurement.reference_value -}}
                                {%- endif -%}
                                {{ current_variant.unit_price_measurement.reference_unit }}
                              {%- endif -%}
                            </span>
                           {%- endcapture -%}
                           <span class="price__unit db"><span class="unit_price">{{ current_variant.unit_price | money }}</span><span>/</span>{{- unit_price_base_unit -}}</span>
                        </span>
                   {%- elsif price_varies and on_sale -%}<span class="price price_varies"><del>{{ current_variant.compare_at_price | money }}</del> <ins>{{ current_variant.price | money }}</ins></span>
                   {%- elsif price_varies -%}<span class="price price_varies">{{ current_variant.price | money }}</span>{%- endif -%}
                    
                    {%- assign PR_buy_pr = false -%}
                    {%- if bk_stts.enable_payment_btn and ck_external == false and no_sold_out -%}
                    {%- assign PR_buy_pr = true -%}
                    {%- endif -%}
                    <div class="variations_button in_flex column w__100 buy_qv_{{PR_buy_pr}}">
                       <div class="flex wrap">
                          {%- if ck_external -%}<a href="{{link}}" rel="nofollow" target="_blank" class="truncate external_btn button">{{title}}</a>{%- render 'nt_add_w',class:"order-3",tooltip:"ttip_nt tooltip_top_left" -%}
                          {%- elsif no_sold_out == false -%}
                                <a rel="nofollow" data-no-instant href="#" class="truncate out_stock button pe_none" id="out_stock{{call_cl}}">{{'products.product.outofstock' | t}}</a>
                                {%- render 'nt_add_w',tooltip:"ttip_nt tooltip_top_left" -%}
                          {%- else -%}
                             <div class="quantity pr mr__10 order-1 qty__{{bk_stts.show_qty}}" id="sp_qty{{call_cl}}"> 
                                <input type="number" class="input-text qty text tc qty_pr_js" step="1" min="1" max="{% if ck_preoder %}999{% elsif inventory_management != null %}{{inventory_quantity}}{% else %}9999{% endif %}" name="quantity" value="1" size="4" pattern="[0-9]*" inputmode="numeric">
                                <div class="qty tc fs__14"><button type="button" class="plus db cb pa pd__0 pr__15 tr r__0"><i class="facl facl-plus"></i></button><button type="button" class="minus db cb pa pd__0 pl__15 tl l__0"><i class="facl facl-minus"></i></button></div>
                             </div> 
                             <a rel="nofollow" data-no-instant href="#" class="single_stt out_stock button pe_none order-2" id="out_stock{{call_cl}}">{{'products.product.outofstock' | t}}</a>
                             {%- render 'nt_add_w',class:"order-3",tooltip:"ttip_nt tooltip_top_left" -%}
                         
                         <button id="btn_Buy" type="submit" data-time='{{bk_stts.time}}000' data-ani='{{bk_stts.ani}}' class="single_add_to_cart_button button truncate js_frm_cart w__100 mt__20 order-4{% if PR_no_pick %} disabled{% endif %}"><span class="txt_add {{classdn1}}">{{'products.product.add_to_cart' | t}}</span><span class="txt_pre {{classdn2}}">{{'products.product.pre_orders' | t}}</span></button> 
                          {%- endif -%}
                       </div>
                       {%- if PR_buy_pr -%}{{- form | payment_button -}}
                      		{%- if template == 'product.KT' -%}   
                         
                                   <br>
                                   <p class="line-item-property__field">                                   
                                          <label for="said">SAID 입력(필수)</label>
                                          <input placeholder= "SAID 번호를 입력하세요(필수)" required class="required" id="said" type="text" name="properties[SAID 입력]" onpageshow="isEmpty()" onkeyup="isEmpty()" onkeydown="isEmpty()">                                      
                                   </p>
                                   <br>
                      		{%- endif -%}
                       {%- endif -%} 
                    </div>
                 {%- endform -%}

 

 

this is the code in my product when buying.. 

Phigolf_0-1635832403118.png

if you see this code.. when buying a item i made a input field in the product page like this.. 

 

Phigolf_1-1635832521946.png

but i suppose to make this input require when you click BUT IT NOW but it doesn't work.. 


I definitely wrote "required" in the input attribute in the form block, but this doesn't work. Even if it's empty, it goes over even if I press buy it now. Please help me.

 

Replies 0 (0)