Includethesnippetinyourcartpag
2022-05-31 14:25:31
为配备加上模板设置
在Config文件目录中,点击settings_schema.json
。
在源代码中搜索第一个右中括号},
。在右大括号},
下边的新行中,黏贴下列编码:
{name:HearAboutUs,settings:[{type:text,id:hau_form_options,label:Formoptions,default:Facebook,Twitter,Google,Instagram,Youtube,info:Separateeachoptionwithacomma},{type:header,content:Formvalidation},{type:checkbox,id:hau_form_validation,label:Enableformvalidation,default:true},{type:text,id:hau_error_message,label:Errormessage,info:Theerrormessagethatisdisplayedwhennoselectionismade,default:Pleaseselectanoptionbelow},{type:text,id:hau_error_message_other,label:Otherfielderrormessage,info:TheerrormessagethatisdisplayedwhenthereisnoinputintheOtherfield,default:Pleasefillthetextfieldbelow},{type:header,content:Errorstyling},{type:color,id:hau_error_color,label:Color,default:#ff0000}]},
点击储存。
将表格字段设置为必录字段
若要避免顾客在没有挑选您是怎样掌握到大家店铺的?表格字段中选择项的情形下再次付款,您可以将该字段设置为必录字段。
在Sections文件目录中,点击cart-template.liquid
。假如您的模板中不包含cart-template.liquid
,请点击Templates文件目录中的cart.liquid
。
在加入购物车表格字段中搜索下列novalidate
属性:
novalidate
将novalidate
属性更换为下列编码:
{%unlesssettings.hau_form_validation%}novalidate{%endunless%}
点击储存。
在模板编辑软件中,点击侧栏上的模板设置。
点击掌握大家菜单栏。
在表单验证下,保证已开启启用表单验证设置。
备注名称:您可以根据改动不正确信息和别的字段不正确信息文字字段设置来源于界定表明的不正确信息。您可以根据变更不正确款式下的颜色设置来源于界定不正确颜色。
Shopify商家官方网站全文详细信息:
Includethesnippetinyourcartpage
ToincludetheHowdidyouhearaboutus?snippetinyourcartpage:
IntheSectionsdirectory,click
cart-template.liquid
.Ifyourthemedoesntincludeacart-template.liquid
,thenclickcart.liquid
intheTemplatesdirectory.Findtheclosing
/form
taginthecode.Onanewlineabovetheclosing/form
tag,pastethefollowingcode:{%renderhear-about-us%}
ClickSave.
Addthemesettingsforconfiguration
IntheConfigdirectory,click
settings_schema.json
.Findthefirstclosingcurlybracket
},
inthecode.Onanewlinebelowtheclosingcurlybracket},
,pastethefollowingcode:{name:HearAboutUs,settings:[{type:text,id:hau_form_options,label:Formoptions,default:Facebook,Twitter,Google,Instagram,Youtube,info:Separateeachoptionwithacomma},{type:header,content:Formvalidation},{type:checkbox,id:hau_form_validation,label:Enableformvalidation,default:true},{type:text,id:hau_error_message,label:Errormessage,info:Theerrormessagethatisdisplayedwhennoselectionismade,default:Pleaseselectanoptionbelow},{type:text,id:hau_error_message_other,label:Otherfielderrormessage,info:TheerrormessagethatisdisplayedwhenthereisnoinputintheOtherfield,default:Pleasefillthetextfieldbelow},{type:header,content:Errorstyling},{type:color,id:hau_error_color,label:Color,default:#ff0000}]},
ClickSave.
Maketheformfieldrequired
TopreventcustomersfromproceedingtothecheckoutwithoutselectinganoptionintheHowdidyouhearaboutus?formfield,youcanmakethefieldrequired.
IntheSectionsdirectory,click
cart-template.liquid
.Ifyourthemedoesntincludeacart-template.liquid
,thenclickcart.liquid
intheTemplatesdirectory.Findthefollowing
novalidate
attributeinthecartformcode:novalidate
Replacethe
novalidate
attributewiththefollowingcode:{%unlesssettings.hau_form_validation%}novalidate{%endunless%}
ClickSave.
Inthethemeeditor,clickThemesettingsonthesidebar.
ClicktheHearAboutUstab.
UnderFormValidation,makesuretheEnableformvalidationsettingisenabled.
Note
YoucancustomisetheerrormessagesdisplayedbymodifyingtheErrormessageandOtherfielderrormessagetextfieldsettings.YoucanalsocustomisetheerrorcolorbychangingtheColorsettingunderErrorStyling.
文章由来:Shopify商家官网
部分文章来源于网络,如有侵权,请联系 caihong@youzan.com 删除。