WooCommerce Checkout Field Editor (Manager) Pro - Version 1.5.2

Version Description

  • Added WooCommerce 6.0.0 compatibility.
  • Added Number, Hidden, Multi-Select, Checkbox, Checkbox Group and Heading as new field types.
Download this release

Release Info

Developer ThemeHigh
Plugin Icon 128x128 WooCommerce Checkout Field Editor (Manager) Pro
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

admin/assets/css/thwcfd-admin.min.css CHANGED
@@ -1 +1 @@
1
- .align-center{text-align:center!important}.woocommerce-message{margin-top:10px}.err_msgs{color:red}.empty-msg-row{padding:20px 0!important;text-align:center}.color-red{color:red!important}.status-active{font-size:15px;color:green}.status-deactive{font-size:15px;color:red}.thpladmin-subtitle{font-size:11px;color:#666}a.button.big-button{font-size:1.1rem;background-color:#fff;border:1px solid #42af42;color:#42af42}a.button.big-button:focus,a.button.big-button:hover{background-color:#42af42;border:1px solid #42af42;box-shadow:0 0 0 1px #42af42;color:#fff}table.thpladmin_fields_table td.sort{cursor:move;font-size:15px;text-align:center}table.thpladmin_fields_table td.sort::before{content:'\f333';font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}.thpladmin-tab{width:100%;border:0 solid #d4d4d1;border-top:0;background-color:#fff;float:left}.thpladmin-tabs-menu{width:100%;margin:0;margin-top:10px;float:left;clear:both;border-bottom:1px solid #bcd4e6}.thpladmin-tabs-menu li{float:left;margin-right:5px;margin-bottom:-1px;border:1px solid #bcd4e6;outline:1px solid transparent;border-radius:4px 4px 0 0;background:#e1ecf4}.thpladmin-tabs-menu li.current{color:#555;position:relative;background-color:#fff;border-bottom:1px solid #fff;box-shadow:none}.thpladmin-tabs-menu li.first{margin-left:20px}.thpladmin-tabs-menu li a{font-size:18px;display:block;padding:12px 20px;text-decoration:none;color:#9fc2db;-webkit-transition:color .2s;transition:color .2s}.thpladmin-tabs-menu li a:focus{outline:0;box-shadow:none}.thpladmin-tabs-menu .current a{color:#2e7da3}.thpladmin-tab-content{padding:0;display:none;min-height:200px;max-height:485px;color:#000}.thpladmin-sections{list-style:outside none none;margin:8px 0 0;padding:0;font-size:13px;color:#666}.thpladmin-sections li{display:inline-block;margin:0;padding:0;white-space:nowrap}.thpladmin-sections a.current{font-weight:600;border:medium none;color:#000}.thpladmin-sections a{line-height:2;padding:.2em;text-decoration:none}.thpladmin-sections .delete_section img,.thpladmin-sections a.edit_section img{width:12px;height:12px}.thpladmin-sections a.add_link{margin-left:30px;background-color:#00a0d2;border:1px solid #0073aa;color:#fff;padding:2px 5px;border-radius:3px}.thpladmin-sections a.add_link:hover{background-color:#0073aa}.thpladmin-form-table td{padding:5px 0}.thpladmin-form-table td.thpladmin-form-section-title{font-weight:700;border-bottom:1px dashed #cecece}.thpladmin_fields_table tr.strikeout td{background:rgba(255,0,0,.4)!important;opacity:.6;text-decoration:line-through}.thpladmin_fields_table tr.thpladmin-disabled td{opacity:.4}.thpladmin_fields_table tr.thpladmin-disabled td.td_select{opacity:1}.thpladmin_fields_table .td_actions{width:90px}.thpladmin_fields_table .td_enabled{width:80px}.thpladmin_fields_table .td_clear{width:65px}.thpladmin_fields_table .td_required{width:85px}.thpladmin_fields_table .td_select{width:45px}.thpladmin_fields_table .td_type{width:150px}.thpladmin_fields_table .td_validate{text-transform:capitalize}.thpladmin_fields_table th.status{white-space:nowrap}.thpladmin_fields_table .dashicons{line-height:inherit}.thpladmin_fields_table .td_actions .dashicons{background-color:#f7f7f7;border:1px solid #ccc;border-radius:3px;padding:0 2px 2px 2px;box-shadow:0 1px 0 #ccc;webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.thpladmin_fields_table .td_actions .dashicons.disabled{color:#ccc;border:1px solid #e9e9e9;cursor:default}.thpladmin_fields_table .td_actions .dashicons-edit{cursor:pointer}.thpladmin_fields_table .td_actions .dashicons-admin-page{cursor:pointer}.thpladmin-sections .dashicons{cursor:pointer}.thpladmin-sections .dashicons-no{color:#ff4c4c}.thpladmin-notice .logo{float:right}.thpladmin-notice .logo img{height:18px;margin-top:12px}@media only screen and (min-width:45em){ul.feature-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}.th-nice-box{border:1px solid #c3c4c7;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%);background:#fff;margin:1.5rem 0 .75rem 0;padding:2rem}ul.feature-list li:before{content:"\f147";display:inline-block;-webkit-font-smoothing:antialiased;color:#2271b1;margin-right:10px;word-wrap:break-word;font-family:dashicons;font-weight:700}ul.star-list li:before{content:"\f155";color:#f90}.th-flexbox{display:flex;flex-wrap:wrap;justify-content:space-between}.th-title-box{display:flex;align-items:center}.th-title-box img{width:54px;height:54px;margin-right:1.2em;border-radius:6px}.th-title-box h3{flex:1}.th-title-box h3 a{color:#1d2327}.th-title-box h3 a:hover{opacity:.8}.th-flexbox-child{width:100%;height:auto;box-sizing:border-box}.th-plugins-wrapper{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;grid-gap:20px}.th-plugins-wrapper.featured{grid-template-columns:1fr 1fr 1fr;grid-gap:20px;margin-bottom:4em}.th-plugins-child{width:100%;height:auto;box-sizing:border-box;padding:5%;border-radius:2%;border:1px solid #fff;background:#fff;transition:box-shadow .5s;transition:border .5s}.th-plugins-child:hover{border:1px solid #e0e0e0;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%)}.th-plugin-action.updating-message::before{display:inline-block;content:"\f111";font:400 19px/1 dashicons;margin:0 5px 0 -2px;vertical-align:middle;animation:rotation 2s infinite linear}@media only screen and (min-width:45em){.th-flexbox-child{width:49%}}:root{--primary-bg-color:#007cba;--primary-text-color:#0071a1;--primary-border-color:#0071a1;--primary-alt-bg-color:#f3f5f6;--primary-alt-text-color:#0071a1;--primary-alt-border-color:#0071a1}*{box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}ol,ul{margin-top:0;margin-bottom:10px}:after,:before{box-sizing:border-box}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{cursor:pointer;color:#337ab7;text-decoration:none;background-color:transparent}.btn-link,a{color:#528ff0}.wp-core-ui select{line-height:2;border-color:#e2e2e2}.pull-right{float:right!important}.ml-30{margin-left:30px!important}.mt-10{margin-top:10px!important}.mt-20{margin-top:20px!important}.p-0{padding:0!important}.ph-5{padding-left:5px!important;padding-right:5px!important}.pv-2{padding-top:2px!important;padding-bottom:2px!important}.thwcfd-wrap div.thwcfd-notice{margin:10px 20px 0 2px}.thwcfd-wrap input[type=number],.thwcfd-wrap input[type=text],.thwcfd-wrap select,.thwcfd-wrap textarea{color:#32373c;line-height:1;min-height:30px;height:36px;width:auto;background-color:#fff;border:1px solid #e2e2e2;border-radius:2px;overflow:hidden;font-size:14px;padding:0 12px;box-shadow:0 0 0 transparent}.thwcfd-wrap textarea{height:auto;overflow:auto;padding:2px 6px;line-height:1.5;resize:vertical}.thwcfd-wrap input[type=number]:disabled,.thwcfd-wrap input[type=text]:disabled,.thwcfd-wrap select:disabled,.thwcfd-wrap textarea:disabled{color:#a0a5aa;border-color:#ddd;background-color:#f7f7f7}.thwcfd-wrap input[type=number]:disabled::placeholder,.thwcfd-wrap input[type=text]:disabled::placeholder,.thwcfd-wrap select:disabled::placeholder,.thwcfd-wrap textarea:disabled::placeholder{color:#a0a5aa}.thwcfd-wrap .btn{display:inline-block;background-image:none;font-size:14px;font-weight:400;text-align:center;vertical-align:middle;white-space:nowrap;cursor:pointer;touch-action:manipulation;line-height:1;border-width:1px;border-style:solid;border-radius:2px;outline:0;margin:0;padding:12px 20px;box-sizing:border-box;-webkit-appearance:none;-webkit-box-sizing:border-box;transition:.1s;-webkit-transition:.1s;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn:hover{opacity:.9}.thwcfd-wrap .btn-small{font-size:13px;padding:8px 10px;border-radius:2px}.thwcfd-wrap .btn-tiny{font-size:13px;padding:5px 5px;border-radius:2px}.thwcfd-wrap .btn-primary{color:#fff;background-color:var(--primary-bg-color);border-color:var(--primary-border-color)}.thwcfd-wrap .btn-primary-alt{color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn-danger{color:#fff;background-color:#f44336;border-color:#c3352b}.thwcfd-wrap .btn:disabled,.thwcfd-wrap .btn[disabled]{color:#cbcbcb;border-color:#cbcbcb;background-color:#fcfcfc;cursor:default}.thwcfd-checkbox{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.thwcfd-checkbox .cb-input,.thwcfd-radio .rb-input{display:block;height:0;margin:0;opacity:0;line-height:normal;box-sizing:border-box;overflow:hidden}.thwcfd-checkbox .cb-el{width:16px;margin-top:2px;margin-right:8px;height:16px;background:#fff;border-radius:2px;float:left;transition:.3s;cursor:pointer;border:1px solid #ccc}.thwcfd-checkbox .cb-el::after{content:'';display:block;width:6px;height:11px;opacity:0;transition:.2s;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) scale(1.5);margin:0 0 0 4px}.thwcfd-checkbox .cb-label{font-size:14px;cursor:pointer;white-space:normal;display:inline-block;font-weight:400;vertical-align:middle}.thwcfd-checkbox :checked+.cb-el{background:#528ff0;border-color:#528ff0}.thwcfd-checkbox :checked+.cb-el::after{opacity:1;transform:rotate(45deg)}.thwcfd-input-wrap{font-weight:400;display:block;margin:24px 0 8px;position:relative}.thwcfd-input-wrap .label{float:left;width:172px;text-align:right;margin-bottom:4px;font-weight:700;position:relative}.thwcfd-input-wrap.required .label::after{content:'*';font-size:12px;position:absolute;margin-left:1px;top:0;color:#f05050}.thwcfd-input-wrap .content{margin-left:190px;position:relative}.thwcfd-input-wrap.small .iel-wrapper{width:260px}.thwcfd-input-wrap .thwcfd-inputtext,.thwcfd-input-wrap .thwcfd-select{width:100%}.thpladmin-modal-mask{position:fixed;background-color:rgba(17,30,60,.6);top:0;left:0;width:100%;height:100%;z-index:9999;overflow:scroll;transition:opacity 250ms ease-in-out}.thpladmin-modal-mask{display:none}.thpladmin-modal .modal-container{position:absolute;background:#fff;border-radius:2px;overflow:hidden;left:50%;top:50%;transform:translate(-50%,-50%);width:90%;max-width:960px;min-height:560px;height:80vh;max-height:640px;animation:appear-down 250ms ease-in-out}.thpladmin-modal .modal-close{position:absolute;color:#58666e;font-size:30px;padding:9px 12px 11px;right:8px;top:8px;line-height:20px;cursor:pointer;z-index:10;user-select:none}.thpladmin-modal .form-wizard{max-width:1024px;height:80vh;max-height:640px;min-height:560px;background:#fafafa;position:relative}.thpladmin-modal .wizard aside{padding:24px 0;width:240px;background:#fff;position:absolute;height:100%;border-right:1px solid #eee}.thpladmin-modal .wizard aside p,.thpladmin-modal .wizard aside side-title{padding:0 24px}.thpladmin-modal .wizard aside side-title{font-size:18px;font-weight:700;display:block;margin-bottom:16px}.thpladmin-modal .wizard aside ul{margin:30px 0;padding:0}.thpladmin-modal .wizard aside li{cursor:pointer;list-style:none;padding:10px 24px;margin:4px 0;color:var(--primary-text-color);position:relative}.thpladmin-modal .wizard aside li.text-primary{color:var(--primary-text-color)}.thpladmin-modal .wizard aside li.active{background:var(--primary-bg-color);color:#fff}.thpladmin-modal .wizard aside li.disabled{display:none}.thpladmin-modal .wizard aside li .dashicons{margin-right:6px;line-height:18px;vertical-align:middle}.thpladmin-modal .wizard aside li.active .dashicons::before{color:#fff}.thpladmin-modal .wizard aside li i.i-chevron-right{font-style:normal;color:#fff;position:absolute;right:8px;font-family:dashicons;opacity:0;top:50%;transform:translate(-4px,-50%);transition:.35s}.thpladmin-modal .wizard aside li.active i.i-chevron-right{opacity:1}.thpladmin-modal .form-wizard main{left:0;right:0;padding:30px;position:absolute;bottom:80px;top:0;overflow:auto}.thpladmin-modal .wizard aside~footer,.thpladmin-modal .wizard aside~main{left:240px}.thpladmin-modal .form-wizard main.main-full{bottom:0}.thpladmin-modal .form-wizard main-title{text-transform:uppercase;display:block;font-weight:600;margin-bottom:12px;font-size:14px!important}.thpladmin-modal .form-wizard .sub-title{text-transform:uppercase;font-weight:600;font-size:14px!important}.thpladmin-modal .form-wizard .device-mobile{display:none}.thpladmin-modal .form-wizard .device-desktop{display:inline}.thpladmin-modal .form-wizard footer{left:0;padding:10px 20px;right:0;background:#f6f6f6;border-top:1px solid #e0e0e0;bottom:0;position:absolute;text-align:right;z-index:99999999}.thpladmin-modal .form-wizard footer .Loader{float:left;opacity:0;transition:1s opacity;margin-top:4px;line-height:27px}.thpladmin-modal .form-wizard footer .btn-toolbar>.btn{margin-left:5px}.thpladmin-modal .form-wizard .form{margin-top:0;padding-bottom:0}.thpladmin-modal .form-wizard .data-panel-content{margin-top:30px;padding-bottom:90px}.thwcfd_pp_table{width:100%}.thwcfd_pp_table tr.disabled td.label,.thwcfd_pp_table tr.disabled td.tip{opacity:.5}.thwcfd_pp_table tr.disabled.hide{display:none}.thwcfd_pp_table td{padding:5px 10px}.thwcfd_pp_table.compact td{padding:3px 10px}.thwcfd_pp_table td.h-separator{padding:20px 0!important}.thwcfd_pp_table td.h-separator span{display:block;height:2px;border-top:1px dashed #e6e6e6}.thwcfd_pp_table td.label{width:25%;text-align:right;padding-right:0;font-weight:700}.thwcfd_pp_table td.tip{width:16px;text-align:center;padding:0}.thwcfd_pp_table td.field{padding-left:0}.thwcfd_pp_table input[type=number],.thwcfd_pp_table input[type=text],.thwcfd_pp_table select{width:260px}.thwcfd_pp_table input[type=text].thwcfd-color{width:223px;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.thwcfd_pp_table .thpladmin-colorpickpreview{padding:9.5px 15px 8.5px 20px;border:1px solid #e2e2e2;border-radius:2px 0 0 2px;border-right:1;background-color:#fff}.product_page_th_extra_product_options_pro .select2-container .select2-selection{border-radius:2px;border:1px solid #e2e2e2;min-height:36px;padding:0 4px}.thpladmin-options-table{width:100%;margin-bottom:30px}.thpladmin-options-table input[type=text],.thpladmin-options-table select{width:100%;padding:0 6px}.thpladmin-options-table td{padding:2px 0 2px 4px}.thpladmin-options-table td.price{width:70px}.thpladmin-options-table td.price-type{width:110px}.thpladmin-options-table td.action-cell{width:100px}.thpladmin-options-table td.action-cell .btn{margin-left:6px;padding:1px 5px 2px 5px;font-size:18px;line-height:1}.thpladmin-options-table td.action-cell span.sort{cursor:move;font-size:18px;padding:0 1px 1px 1px;border-color:#999}.thpladmin-options-table td.action-cell span.sort::before{content:'\f333';content:'\f228';font-family:Dashicons;text-align:center;vertical-align:middle;line-height:1;color:#999}.thwcfd_tooltip{float:right;display:inline;position:relative;font-size:12px;height:100%;z-index:99999999}.thwcfd_tooltip img{padding:0;vertical-align:middle;cursor:help;border:medium none;height:16px;width:16px}.thwcfd_tooltip:hover:after{background:#333;background:#000;border-radius:5px;bottom:26px;color:#fff;content:attr(title);left:-100px;padding:10px 15px;position:absolute;z-index:9998;width:350px}.thwcfd_tooltip:hover:before{border:solid;border-color:#000 transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";left:50%;position:absolute;z-index:9999}.thwcfd-settings-table{width:100%}.thwcfd-settings-table td{padding:5px 0}.thwcfd-settings-table td.section-title{padding:30px 0 5px 0;text-align:left;font-weight:700;text-transform:capitalize;border-bottom:1px dashed #cecece}.thwcfd-settings-table td.label{width:22%;text-align:left;padding-right:0;font-weight:400}.thwcfd-settings-table td.label span{display:block}.thwcfd-settings-table td.label .description{font-size:.9em}.thwcfd-settings-table td.tip{width:16px;text-align:center;padding:0}.thwcfd-settings-table td.field{padding-left:0}.thwcfd-settings-table textarea{width:90%;font-size:.9em}.iris-picker{z-index:100;display:none;position:absolute!important;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.iris-picker .ui-slider{border:0!important;margin:0!important;width:auto!important;height:auto!important;background:0 0!important}.iris-picker .ui-slider .ui-slider-handle{margin-bottom:0!important}.thpladmin-colorpickpreview{padding:7px 10px 7px 20px;border:1px solid #7e8993;border-radius:4px;border-right:1;background-color:#fff;border-top-right-radius:0;border-bottom-right-radius:0}.thwcfd-wrap .thpladmin-colorpick{border-left:0!important;margin-left:0!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.select2-drop-mask{z-index:99999998!important}.select2-drop{z-index:99999999!important}.select2-container{z-index:99999999!important}.select2-container .select2-search--inline .select2-search__field{margin-top:0!important;margin-bottom:0!important;border:0!important}.select2-container .select2-search__field{min-width:0!important;background-image:none!important}.select2-results .select2-results__group{margin:0!important;padding:4px!important}.select2-results .select2-results__option{margin:0!important;padding:4px 4px 4px 8px!important;font-size:.9em}.thwcfd-wrap .select2-container .select2-selection{border-radius:2px!important;border:1px solid #e2e2e2!important;min-height:36px!important;padding:0 4px!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding:0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li{font-size:.8em!important;margin:4px 4px 0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li.select2-search{margin:0!important;height:26px!important;width:auto!important}
1
+ .align-center{text-align:center!important}.woocommerce-message{margin-top:10px}.err_msgs{color:red}.empty-msg-row{padding:20px 0!important;text-align:center}.color-red{color:red!important}.status-active{font-size:15px;color:green}.status-deactive{font-size:15px;color:red}.thpladmin-subtitle{font-size:11px;color:#666}a.button.big-button{font-size:1.1rem;background-color:#fff;border:1px solid #42af42;color:#42af42}a.button.big-button:focus,a.button.big-button:hover{background-color:#42af42;border:1px solid #42af42;box-shadow:0 0 0 1px #42af42;color:#fff}table.thpladmin_fields_table td.sort{cursor:move;font-size:15px;text-align:center}table.thpladmin_fields_table td.sort::before{content:'\f333';font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}.thpladmin-tab{width:100%;border:0 solid #d4d4d1;border-top:0;background-color:#fff;float:left}.thpladmin-tabs-menu{width:100%;margin:0;margin-top:10px;float:left;clear:both;border-bottom:1px solid #bcd4e6}.thpladmin-tabs-menu li{float:left;margin-right:5px;margin-bottom:-1px;border:1px solid #bcd4e6;outline:1px solid transparent;border-radius:4px 4px 0 0;background:#e1ecf4}.thpladmin-tabs-menu li.current{color:#555;position:relative;background-color:#fff;border-bottom:1px solid #fff;box-shadow:none}.thpladmin-tabs-menu li.first{margin-left:20px}.thpladmin-tabs-menu li a{font-size:18px;display:block;padding:12px 20px;text-decoration:none;color:#9fc2db;-webkit-transition:color .2s;transition:color .2s}.thpladmin-tabs-menu li a:focus{outline:0;box-shadow:none}.thpladmin-tabs-menu .current a{color:#2e7da3}.thpladmin-tab-content{padding:0;display:none;min-height:200px;max-height:485px;color:#000}.thpladmin-sections{list-style:outside none none;margin:8px 0 0;padding:0;font-size:13px;color:#666}.thpladmin-sections li{display:inline-block;margin:0;padding:0;white-space:nowrap}.thpladmin-sections a.current{font-weight:600;border:medium none;color:#000}.thpladmin-sections a{line-height:2;padding:.2em;text-decoration:none}.thpladmin-sections .delete_section img,.thpladmin-sections a.edit_section img{width:12px;height:12px}.thpladmin-sections a.add_link{margin-left:30px;background-color:#00a0d2;border:1px solid #0073aa;color:#fff;padding:2px 5px;border-radius:3px}.thpladmin-sections a.add_link:hover{background-color:#0073aa}.thpladmin-form-table td{padding:5px 0}.thpladmin-form-table td.thpladmin-form-section-title{font-weight:700;border-bottom:1px dashed #cecece}.thpladmin_fields_table tr.strikeout td{background:rgba(255,0,0,.4)!important;opacity:.6;text-decoration:line-through}.thpladmin_fields_table tr.thpladmin-disabled td{opacity:.4}.thpladmin_fields_table tr.thpladmin-disabled td.td_select{opacity:1}.thpladmin_fields_table .td_actions{width:90px}.thpladmin_fields_table .td_enabled{width:80px}.thpladmin_fields_table .td_clear{width:65px}.thpladmin_fields_table .td_required{width:85px}.thpladmin_fields_table .td_select{width:45px}.thpladmin_fields_table .td_type{width:150px}.thpladmin_fields_table .td_validate{text-transform:capitalize}.thpladmin_fields_table th.status{white-space:nowrap}.thpladmin_fields_table .dashicons{line-height:inherit}.thpladmin_fields_table .td_actions .dashicons{background-color:#f7f7f7;border:1px solid #ccc;border-radius:3px;padding:0 2px 2px 2px;box-shadow:0 1px 0 #ccc;webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.thpladmin_fields_table .td_actions .dashicons.disabled{color:#ccc;border:1px solid #e9e9e9;cursor:default}.thpladmin_fields_table .td_actions .dashicons-edit{cursor:pointer}.thpladmin_fields_table .td_actions .dashicons-admin-page{cursor:pointer}.thpladmin-sections .dashicons{cursor:pointer}.thpladmin-sections .dashicons-no{color:#ff4c4c}@media only screen and (min-width:45em){ul.feature-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}.th-nice-box{border:1px solid #c3c4c7;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%);background:#fff;margin:1.5rem 0 .75rem 0;padding:2rem}ul.feature-list li:before{content:"\f147";display:inline-block;-webkit-font-smoothing:antialiased;color:#2271b1;margin-right:10px;word-wrap:break-word;font-family:dashicons;font-weight:700}ul.star-list li:before{content:"\f155";color:#f90}.th-flexbox{display:flex;flex-wrap:wrap;justify-content:space-between}.th-title-box{display:flex;align-items:center}.th-title-box img{width:54px;height:54px;margin-right:1.2em;border-radius:6px}.th-title-box h3{flex:1}.th-title-box h3 a{color:#1d2327}.th-title-box h3 a:hover{opacity:.8}.th-flexbox-child{width:100%;height:auto;box-sizing:border-box}.th-plugins-wrapper{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;grid-gap:20px}.th-plugins-wrapper.featured{grid-template-columns:1fr 1fr 1fr;grid-gap:20px;margin-bottom:4em}.th-plugins-child{width:100%;height:auto;box-sizing:border-box;padding:5%;border-radius:2%;border:1px solid #fff;background:#fff;transition:box-shadow .5s;transition:border .5s}.th-plugins-child:hover{border:1px solid #e0e0e0;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%)}.th-plugin-action.updating-message::before{display:inline-block;content:"\f111";font:400 19px/1 dashicons;margin:0 5px 0 -2px;vertical-align:middle;animation:rotation 2s infinite linear}@media only screen and (min-width:45em){.th-flexbox-child{width:49%}}:root{--primary-bg-color:#007cba;--primary-text-color:#0071a1;--primary-border-color:#0071a1;--primary-alt-bg-color:#f3f5f6;--primary-alt-text-color:#0071a1;--primary-alt-border-color:#0071a1}*{box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}ol,ul{margin-top:0;margin-bottom:10px}:after,:before{box-sizing:border-box}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{cursor:pointer;color:#337ab7;text-decoration:none;background-color:transparent}.btn-link,a{color:#528ff0}.wp-core-ui select{line-height:2;border-color:#e2e2e2}.pull-right{float:right!important}.ml-30{margin-left:30px!important}.mt-10{margin-top:10px!important}.mt-20{margin-top:20px!important}.p-0{padding:0!important}.ph-5{padding-left:5px!important;padding-right:5px!important}.pv-2{padding-top:2px!important;padding-bottom:2px!important}.thwcfd-wrap div.thwcfd-notice{margin:10px 20px 0 2px}.thwcfd-wrap input[type=number],.thwcfd-wrap input[type=text],.thwcfd-wrap select,.thwcfd-wrap textarea{color:#32373c;line-height:1;min-height:30px;height:36px;width:auto;background-color:#fff;border:1px solid #e2e2e2;border-radius:2px;overflow:hidden;font-size:14px;padding:0 12px;box-shadow:0 0 0 transparent}.thwcfd-wrap textarea{height:auto;overflow:auto;padding:2px 6px;line-height:1.5;resize:vertical}.thwcfd-wrap input[type=number]:disabled,.thwcfd-wrap input[type=text]:disabled,.thwcfd-wrap select:disabled,.thwcfd-wrap textarea:disabled{color:#a0a5aa;border-color:#ddd;background-color:#f7f7f7}.thwcfd-wrap input[type=number]:disabled::placeholder,.thwcfd-wrap input[type=text]:disabled::placeholder,.thwcfd-wrap select:disabled::placeholder,.thwcfd-wrap textarea:disabled::placeholder{color:#a0a5aa}.thwcfd-wrap .btn{display:inline-block;background-image:none;font-size:14px;font-weight:400;text-align:center;vertical-align:middle;white-space:nowrap;cursor:pointer;touch-action:manipulation;line-height:1;border-width:1px;border-style:solid;border-radius:2px;outline:0;margin:0;padding:12px 20px;box-sizing:border-box;-webkit-appearance:none;-webkit-box-sizing:border-box;transition:.1s;-webkit-transition:.1s;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn:hover{opacity:.9}.thwcfd-wrap .btn-small{font-size:13px;padding:8px 10px;border-radius:2px}.thwcfd-wrap .btn-tiny{font-size:13px;padding:5px 5px;border-radius:2px}.thwcfd-wrap .btn-primary{color:#fff;background-color:var(--primary-bg-color);border-color:var(--primary-border-color)}.thwcfd-wrap .btn-primary-alt{color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn-danger{color:#fff;background-color:#f44336;border-color:#c3352b}.thwcfd-wrap .btn:disabled,.thwcfd-wrap .btn[disabled]{color:#cbcbcb;border-color:#cbcbcb;background-color:#fcfcfc;cursor:default}.thwcfd-checkbox{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.thwcfd-checkbox .cb-input,.thwcfd-radio .rb-input{display:block;height:0;margin:0;opacity:0;line-height:normal;box-sizing:border-box;overflow:hidden}.thwcfd-checkbox .cb-el{width:16px;margin-top:2px;margin-right:8px;height:16px;background:#fff;border-radius:2px;float:left;transition:.3s;cursor:pointer;border:1px solid #ccc}.thwcfd-checkbox .cb-el::after{content:'';display:block;width:6px;height:11px;opacity:0;transition:.2s;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) scale(1.5);margin:0 0 0 4px}.thwcfd-checkbox .cb-label{font-size:14px;cursor:pointer;white-space:normal;display:inline-block;font-weight:400;vertical-align:middle}.thwcfd-checkbox :checked+.cb-el{background:#528ff0;border-color:#528ff0}.thwcfd-checkbox :checked+.cb-el::after{opacity:1;transform:rotate(45deg)}.thwcfd-input-wrap{font-weight:400;display:block;margin:24px 0 8px;position:relative}.thwcfd-input-wrap .label{float:left;width:172px;text-align:right;margin-bottom:4px;font-weight:700;position:relative}.thwcfd-input-wrap.required .label::after{content:'*';font-size:12px;position:absolute;margin-left:1px;top:0;color:#f05050}.thwcfd-input-wrap .content{margin-left:190px;position:relative}.thwcfd-input-wrap.small .iel-wrapper{width:260px}.thwcfd-input-wrap .thwcfd-inputtext,.thwcfd-input-wrap .thwcfd-select{width:100%}.thpladmin-modal-mask{position:fixed;background-color:rgba(17,30,60,.6);top:0;left:0;width:100%;height:100%;z-index:9999;overflow:scroll;transition:opacity 250ms ease-in-out}.thpladmin-modal-mask{display:none}.thpladmin-modal .modal-container{position:absolute;background:#fff;border-radius:2px;overflow:hidden;left:50%;top:50%;transform:translate(-50%,-50%);width:90%;max-width:960px;min-height:560px;height:80vh;max-height:640px;animation:appear-down 250ms ease-in-out}.thpladmin-modal .modal-close{position:absolute;color:#58666e;font-size:30px;padding:9px 12px 11px;right:8px;top:8px;line-height:20px;cursor:pointer;z-index:10;user-select:none}.thpladmin-modal .form-wizard{max-width:1024px;height:80vh;max-height:640px;min-height:560px;background:#fafafa;position:relative}.thpladmin-modal .wizard aside{padding:24px 0;width:240px;background:#fff;position:absolute;height:100%;border-right:1px solid #eee}.thpladmin-modal .wizard aside p,.thpladmin-modal .wizard aside side-title{padding:0 24px}.thpladmin-modal .wizard aside side-title{font-size:18px;font-weight:700;display:block;margin-bottom:16px}.thpladmin-modal .wizard aside ul{margin:30px 0;padding:0}.thpladmin-modal .wizard aside li{cursor:pointer;list-style:none;padding:10px 24px;margin:4px 0;color:var(--primary-text-color);position:relative}.thpladmin-modal .wizard aside li.text-primary{color:var(--primary-text-color)}.thpladmin-modal .wizard aside li.active{background:var(--primary-bg-color);color:#fff}.thpladmin-modal .wizard aside li.disabled{display:none}.thpladmin-modal .wizard aside li .dashicons{margin-right:6px;line-height:18px;vertical-align:middle}.thpladmin-modal .wizard aside li.active .dashicons::before{color:#fff}.thpladmin-modal .wizard aside li i.i-chevron-right{font-style:normal;color:#fff;position:absolute;right:8px;font-family:dashicons;opacity:0;top:50%;transform:translate(-4px,-50%);transition:.35s}.thpladmin-modal .wizard aside li.active i.i-chevron-right{opacity:1}.thpladmin-modal .form-wizard main{left:0;right:0;padding:30px;position:absolute;bottom:80px;top:0;overflow:auto}.thpladmin-modal .wizard aside~footer,.thpladmin-modal .wizard aside~main{left:240px}.thpladmin-modal .form-wizard main.main-full{bottom:0}.thpladmin-modal .form-wizard main-title{text-transform:uppercase;display:block;font-weight:600;margin-bottom:12px;font-size:14px!important}.thpladmin-modal .form-wizard .sub-title{text-transform:uppercase;font-weight:600;font-size:14px!important}.thpladmin-modal .form-wizard .device-mobile{display:none}.thpladmin-modal .form-wizard .device-desktop{display:inline}.thpladmin-modal .form-wizard footer{left:0;padding:10px 20px;right:0;background:#f6f6f6;border-top:1px solid #e0e0e0;bottom:0;position:absolute;text-align:right;z-index:99999999}.thpladmin-modal .form-wizard footer .Loader{float:left;opacity:0;transition:1s opacity;margin-top:4px;line-height:27px}.thpladmin-modal .form-wizard footer .btn-toolbar>.btn{margin-left:5px}.thpladmin-modal .form-wizard .form{margin-top:0;padding-bottom:0}.thpladmin-modal .form-wizard .data-panel-content{margin-top:30px;padding-bottom:90px}.thwcfd_pp_table{width:100%}.thwcfd_pp_table tr.disabled td.label,.thwcfd_pp_table tr.disabled td.tip{opacity:.5}.thwcfd_pp_table tr.disabled.hide{display:none}.thwcfd_pp_table td{padding:5px 10px}.thwcfd_pp_table.compact td{padding:3px 10px}.thwcfd_pp_table td.h-separator{padding:20px 0!important}.thwcfd_pp_table td.h-separator span{display:block;height:2px;border-top:1px dashed #e6e6e6}.thwcfd_pp_table td.label{width:25%;text-align:right;padding-right:0;font-weight:700}.thwcfd_pp_table td.tip{width:16px;text-align:center;padding:0}.thwcfd_pp_table td.field{padding-left:0}.thwcfd_pp_table input[type=number],.thwcfd_pp_table input[type=text],.thwcfd_pp_table select{width:260px}.thwcfd_pp_table input[type=text].thwcfd-color{width:223px;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.thwcfd_pp_table .thpladmin-colorpickpreview{padding:9.5px 15px 8.5px 20px;border:1px solid #e2e2e2;border-radius:2px 0 0 2px;border-right:1;background-color:#fff}.product_page_th_extra_product_options_pro .select2-container .select2-selection{border-radius:2px;border:1px solid #e2e2e2;min-height:36px;padding:0 4px}.thpladmin-options-table{width:100%;margin-bottom:30px}.thpladmin-options-table input[type=text],.thpladmin-options-table select{width:100%;padding:0 6px}.thpladmin-options-table td{padding:2px 0 2px 4px}.thpladmin-options-table td.price{width:70px}.thpladmin-options-table td.price-type{width:110px}.thpladmin-options-table td.action-cell{width:100px}.thpladmin-options-table td.action-cell .btn{margin-left:6px;padding:1px 5px 2px 5px;font-size:18px;line-height:1}.thpladmin-options-table td.action-cell span.sort{cursor:move;font-size:18px;padding:0 1px 1px 1px;border-color:#999}.thpladmin-options-table td.action-cell span.sort::before{content:'\f333';content:'\f228';font-family:Dashicons;text-align:center;vertical-align:middle;line-height:1;color:#999}.thwcfd_tooltip{float:right;display:inline;position:relative;font-size:12px;height:100%;z-index:99999999}.thwcfd_tooltip img{padding:0;vertical-align:middle;cursor:help;border:medium none;height:16px;width:16px}.thwcfd_tooltip:hover:after{background:#333;background:#000;border-radius:5px;bottom:26px;color:#fff;content:attr(title);left:-100px;padding:10px 15px;position:absolute;z-index:9998;width:350px}.thwcfd_tooltip:hover:before{border:solid;border-color:#000 transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";left:50%;position:absolute;z-index:9999}.thwcfd-settings-table{width:100%}.thwcfd-settings-table td{padding:5px 0}.thwcfd-settings-table td.section-title{padding:30px 0 5px 0;text-align:left;font-weight:700;text-transform:capitalize;border-bottom:1px dashed #cecece}.thwcfd-settings-table td.label{width:22%;text-align:left;padding-right:0;font-weight:400}.thwcfd-settings-table td.label span{display:block}.thwcfd-settings-table td.label .description{font-size:.9em}.thwcfd-settings-table td.tip{width:16px;text-align:center;padding:0}.thwcfd-settings-table td.field{padding-left:0}.thwcfd-settings-table textarea{width:90%;font-size:.9em}.iris-picker{z-index:100;display:none;position:absolute!important;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.iris-picker .ui-slider{border:0!important;margin:0!important;width:auto!important;height:auto!important;background:0 0!important}.iris-picker .ui-slider .ui-slider-handle{margin-bottom:0!important}.thpladmin-colorpickpreview{padding:7px 10px 7px 20px;border:1px solid #7e8993;border-radius:4px;border-right:1;background-color:#fff;border-top-right-radius:0;border-bottom-right-radius:0}.thwcfd-wrap .thpladmin-colorpick{border-left:0!important;margin-left:0!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.select2-drop-mask{z-index:99999998!important}.select2-drop{z-index:99999999!important}.select2-container{z-index:99999999!important}.select2-container .select2-search--inline .select2-search__field{margin-top:0!important;margin-bottom:0!important;border:0!important}.select2-container .select2-search__field{min-width:0!important;background-image:none!important}.select2-results .select2-results__group{margin:0!important;padding:4px!important}.select2-results .select2-results__option{margin:0!important;padding:4px 4px 4px 8px!important;font-size:.9em}.thwcfd-wrap .select2-container .select2-selection{border-radius:2px!important;border:1px solid #e2e2e2!important;min-height:36px!important;padding:0 4px!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding:0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li{font-size:.8em!important;margin:4px 4px 0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li.select2-search{margin:0!important;height:26px!important;width:auto!important}
admin/assets/js/thwcfd-admin.js CHANGED
@@ -534,6 +534,10 @@ var thwcfd_settings_field = (function($, window, document) {
534
  placeholder : {name : 'placeholder', type : 'text'},
535
  class : {name : 'class', type : 'text'},
536
  validate : {name : 'validate', type : 'select', multiple : 1 },
 
 
 
 
537
 
538
  required : {name : 'required', type : 'checkbox'},
539
  enabled : {name : 'enabled', type : 'checkbox'},
@@ -820,18 +824,34 @@ var thwcfd_settings_field = (function($, window, document) {
820
  err_msgs = MSG_INVALID_NAME;
821
  }
822
 
823
- if(option_values.length>0 && fvalue !='' && (ftype == 'select' || ftype == 'radio') ){
824
- if(!(option_values.includes(fvalue))){
825
- err_msgs = __('Enter a value given in the options.', 'woo-checkout-field-editor-pro');
 
 
 
 
 
 
 
 
 
 
826
  }
827
  }
828
 
 
 
 
 
829
  if(err_msgs != ''){
830
  form.find('.err_msgs').html(err_msgs);
831
  thwcfd_base.form_wizard_start(popup);
832
  return false;
833
  }
834
 
 
 
835
  return true;
836
  }
837
 
@@ -991,26 +1011,6 @@ var thwcfd_settings = (function($, window, document) {
991
  thwcfd_base.setup_form_wizard();
992
  });
993
 
994
-
995
- $( document ).on( 'click', '.thpladmin-notice .notice-dismiss', function() {
996
- var wrapper = $(this).closest('div.thpladmin-notice');
997
- var nonce = wrapper.data("nonce");
998
- var action = wrapper.data("action");
999
- var data = {
1000
- thwcfd_security_review_notice: nonce,
1001
- action: action,
1002
- };
1003
- $.post( ajaxurl, data, function() {
1004
-
1005
- });
1006
- })
1007
-
1008
- $(document).ready(function(){
1009
- setTimeout(function(){
1010
- $("#thwcfd_review_request_notice").fadeIn(500);
1011
- }, 160);
1012
- });
1013
-
1014
  $(document).keypress(function(e) {
1015
  if ($("#thwcfd_field_form_pp").is(':visible') && (e.keycode == 13 || e.which == 13)) {
1016
  e.preventDefault();
@@ -1051,25 +1051,11 @@ var thwcfd_settings = (function($, window, document) {
1051
  row.find(".f_enabled").val(enabled);
1052
  });
1053
  }
1054
-
1055
- function hide_review_request_notice(elm){
1056
- var wrapper = $(elm).closest('div.thpladmin-notice');
1057
- var nonce = wrapper.data("nonce");
1058
- var data = {
1059
- thwcfd_security_review_notice: nonce,
1060
- action: 'skip_thwcfd_review_request_notice',
1061
- };
1062
- $.post( ajaxurl, data, function() {
1063
-
1064
- });
1065
- $(wrapper).hide(50);
1066
- }
1067
 
1068
  return {
1069
  selectAllFields : select_all_fields,
1070
  removeSelectedFields : remove_selected_fields,
1071
  enableDisableSelectedFields : enable_disable_selected_fields,
1072
- hideReviewRequestNotice : hide_review_request_notice,
1073
  };
1074
  }(window.jQuery, window, document));
1075
 
@@ -1088,7 +1074,3 @@ function thwcfdEnableSelectedFields(){
1088
  function thwcfdDisableSelectedFields(){
1089
  thwcfd_settings.enableDisableSelectedFields(0);
1090
  }
1091
-
1092
- function thwcfdHideReviewRequestNotice(elm){
1093
- thwcfd_settings.hideReviewRequestNotice(elm);
1094
- }
534
  placeholder : {name : 'placeholder', type : 'text'},
535
  class : {name : 'class', type : 'text'},
536
  validate : {name : 'validate', type : 'select', multiple : 1 },
537
+
538
+ title_type : {name : 'title_type', type : 'select'},
539
+
540
+ checked : {name : 'checked', type : 'checkbox'},
541
 
542
  required : {name : 'required', type : 'checkbox'},
543
  enabled : {name : 'enabled', type : 'checkbox'},
824
  err_msgs = MSG_INVALID_NAME;
825
  }
826
 
827
+ if(fvalue && (option_values.length>0) && (ftype == 'select' || ftype == 'radio' || ftype == 'multiselect' || ftype == 'checkboxgroup')){
828
+ if(ftype == 'select' || ftype == 'radio'){
829
+ if(!(option_values.includes(fvalue))){
830
+ err_msgs = __('Enter default value given in the options.', 'woo-checkout-field-editor-pro');
831
+ }
832
+ }else if(ftype == 'multiselect' || ftype == 'checkboxgroup'){
833
+ var value_array = fvalue.split(', ');
834
+ for(var i = 0; i < value_array.length; i++){
835
+ var value = value_array[i];
836
+ if(value && !(option_values.includes(value))){
837
+ err_msgs = __('Enter default values given in the options.', 'woo-checkout-field-editor-pro');
838
+ }
839
+ };
840
  }
841
  }
842
 
843
+ if(fvalue && ftype == 'number' && (/^-?\d+$/.test(fvalue) === false)){
844
+ err_msgs = __('Default value must be a number.', 'woo-checkout-field-editor-pro');
845
+ }
846
+
847
  if(err_msgs != ''){
848
  form.find('.err_msgs').html(err_msgs);
849
  thwcfd_base.form_wizard_start(popup);
850
  return false;
851
  }
852
 
853
+ //return false;
854
+
855
  return true;
856
  }
857
 
1011
  thwcfd_base.setup_form_wizard();
1012
  });
1013
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1014
  $(document).keypress(function(e) {
1015
  if ($("#thwcfd_field_form_pp").is(':visible') && (e.keycode == 13 || e.which == 13)) {
1016
  e.preventDefault();
1051
  row.find(".f_enabled").val(enabled);
1052
  });
1053
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
 
1055
  return {
1056
  selectAllFields : select_all_fields,
1057
  removeSelectedFields : remove_selected_fields,
1058
  enableDisableSelectedFields : enable_disable_selected_fields,
 
1059
  };
1060
  }(window.jQuery, window, document));
1061
 
1074
  function thwcfdDisableSelectedFields(){
1075
  thwcfd_settings.enableDisableSelectedFields(0);
1076
  }
 
 
 
 
admin/assets/js/thwcfd-admin.min.js CHANGED
@@ -1 +1 @@
1
- function thwcfdSetupEnhancedMultiSelectWithValue(elm){thwcfd_base.setupEnhancedMultiSelectWithValue(elm)}function thwcfdSetupSortableTable(parent,elm,left){thwcfd_base.setupSortableTable(parent,elm,left)}function thwcfdCloseModal(elm){thwcfd_base.form_wizard_close(elm)}function thwcfdWizardNext(elm){thwcfd_base.form_wizard_next(elm)}function thwcfdWizardPrevious(elm){thwcfd_base.form_wizard_previous(elm)}function thwcfdOpenNewFieldForm(sectionName){thwcfd_settings_field.openNewFieldForm(sectionName)}function thwcfdOpenEditFieldForm(elm,rowId){thwcfd_settings_field.openEditFieldForm(elm,rowId)}function thwcfdOpenCopyFieldForm(elm,rowId){thwcfd_settings_field.openCopyFieldForm(elm,rowId)}function thwcfdFieldTypeChangeListner(elm){thwcfd_settings_field.fieldTypeChangeListner(elm)}function thwcfdAddNewOptionRow(elm){thwcfd_settings_field.addNewOptionRow(elm)}function thwcfdRemoveOptionRow(elm){thwcfd_settings_field.removeOptionRow(elm)}function thwcfdSaveField(elm){thwcfd_settings_field.save_field(elm)}function thwcfdSelectAllCheckoutFields(elm){thwcfd_settings.selectAllFields(elm)}function thwcfdRemoveSelectedFields(){thwcfd_settings.removeSelectedFields()}function thwcfdEnableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(1)}function thwcfdDisableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(0)}function thwcfdHideReviewRequestNotice(elm){thwcfd_settings.hideReviewRequestNotice(elm)}!function(wp,$){"use strict";wp&&$(function(){$(document).on("click",".th-plugin-action.install-now",function(event){const $button=$(event.target);if($button.hasClass("activate-now"))return!0;event.preventDefault(),$button.hasClass("updating-message")||$button.hasClass("button-disabled")||(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(event),$(document).on("credential-modal-cancel",function(){$(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:$button.data("slug")}))})})}(window.wp,jQuery);var thwcfd_plugins_list=function($,window,document){"use strict";$(function(){$(document).on("click",".th-plugin-action.activate-now",function(event){const $button=$(event.target);if(event.preventDefault(),!$button.hasClass("updating-message")&&!$button.hasClass("button-disabled")){var url_string=$button.attr("href"),url=new URL(url_string),file=url.searchParams.get("plugin"),nonce=url.searchParams.get("_wpnonce"),action=url.searchParams.get("action");if("activate"==action&&(action="th_activate_plugin"),null!=file&&null!=nonce&&null!=action){var data={action:action,file:file,_wpnonce:nonce};jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:data,beforeSend:function(){$button.addClass("updating-message"),$button.text("Activating")},success:function(data){$button.removeClass("updating-message"),1==data?($button.text("Activated"),$button.addClass("disabled")):($button.text("Failed"),$button.addClass("disabled"))},error:function(xhr){$button.text("Failed"),$button.addClass("disabled")}})}}})})}(window.jQuery,window,document),thwcfd_base=function($,window,document){"use strict";function escapeHTML(html){var fn=function(tag){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;"}[tag]||tag};return html.replace(/[&<>"]/g,fn)}function decodeHtml(str){if(str&&"string"==typeof str){var map={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'"};return str.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,function(m){return map[m]})}return str}function isHtmlIdValid(id){return/^[a-z\_]+[a-z0-9\_]*$/.test(id.trim())}function isValidHexColor(value){return!!preg_match("/^#[a-f0-9]{6}$/i",value)}function is_option_field(type){var result=!1;return"select"!=type&&"multiselect"!=type&&"radio"!=type&&"checkboxgroup"!=type||(result=!0),result}function setup_tiptip_tooltips(){var tiptip_args={attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200};$(".tips").tipTip(tiptip_args)}function setup_enhanced_multi_select(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){$(this).hasClass("enhanced")||$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced")})}function setup_enhanced_multi_select_with_value(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){if(!$(this).hasClass("enhanced")){$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced");var value=$(this).data("value");value=value.split(","),$(this).val(value),$(this).trigger("change")}})}function setup_color_picker(form){form.find(".thpladmin-colorpick").iris({change:function(event,ui){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:ui.color.toString()})},hide:!0,border:!0}).click(function(){$(".iris-picker").hide(),$(this).closest("td").find(".iris-picker").show()}),$("body").click(function(){$(".iris-picker").hide()}),$(".thpladmin-colorpick").click(function(event){event.stopPropagation()})}function setup_color_pick_preview(form){form.find(".thpladmin-colorpick").each(function(){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:this.value})})}function prepare_field_order_indexes(elm){$(elm+" tbody tr").each(function(index,el){$("input.f_order",el).val(parseInt($(el).index(elm+" tbody tr")))})}function setup_sortable_table(parent,elm,left){parent.find(elm+" tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:".sort",scrollSensitivity:40,helper:function(e,ui){return ui.children().each(function(){$(this).width($(this).width())}),ui.css("left",left),ui}}),$(elm+" tbody").on("sortstart",function(event,ui){ui.item.css("background-color","#f6f6f6")}),$(elm+" tbody").on("sortstop",function(event,ui){ui.item.removeAttr("style"),prepare_field_order_indexes(elm)})}function get_property_field_value(form,type,name){var value="";switch(type){case"select":value=form.find("select[name=i_"+name+"]").val(),value=null==value?"":value;break;case"checkbox":value=form.find("input[name=i_"+name+"]").prop("checked"),value=value?1:0;break;case"textarea":value=form.find("textarea[name=i_"+name+"]").val(),value=null==value?"":value;break;default:value=form.find("input[name=i_"+name+"]").val(),value=null==value?"":value}return value}function set_property_field_value(form,type,name,value,multiple){switch(type){case"select":1==multiple?(value="string"==typeof value?value.split(","):value,name+="[]",form.find('select[name="i_'+name+'"]').val(value).trigger("change")):form.find('select[name="i_'+name+'"]').val(value);break;case"checkbox":value=1==value||"yes"==value,form.find("input[name=i_"+name+"]").prop("checked",value);break;case"textarea":value=value?decodeHtml(value):value,form.find("textarea[name=i_"+name+"]").val(value);break;case"colorpicker":var bg_color=value?{backgroundColor:value}:{};form.find("input[name=i_"+name+"]").val(value),form.find("."+name+"_preview").css(bg_color);break;default:value=value?decodeHtml(value):value,form.find("input[name=i_"+name+"]").val(value)}}function setup_form_wizard(){$(".pp_nav_links > li").click(function(){var index=$(this).data("index");open_tab($(this).closest(".thpladmin-modal-mask"),$(this),index),active_tab=index})}function get_popup(elm){return $(elm).closest(".thpladmin-modal-mask")}function get_active_tab(popup){return popup.find("ul.pp_nav_links").find("li.active")}function get_next_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.nextAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function get_prev_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.prevAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function form_wizard_open(popup){active_tab=0,popup.find("ul.pp_nav_links li").first().click(),popup.css("display","block")}function form_wizard_close(elm){get_popup(elm).css("display","none"),active_tab=0}function form_wizard_next(elm){active_tab=get_next_tab_index(elm),move_to(elm,active_tab)}function form_wizard_previous(elm){active_tab=get_prev_tab_index(elm),move_to(elm,active_tab)}function form_wizard_start(elm){active_tab=0,move_to(elm,active_tab)}function move_to(elm,index){var popup=get_popup(elm);open_tab(popup,popup.find('*[data-index="'+index+'"]'),index)}function open_tab(popup,link,index){var panel=popup.find(".data_panel_"+index);close_all_data_panel(popup),link.addClass("active"),panel.css("display","block"),enable_disable_btns(popup,link)}function close_all_data_panel(popup){popup.find(".pp_nav_links > li").removeClass("active"),popup.find(".data-panel").css("display","none")}function enable_disable_tab(popup,index,disable){var link=popup.find('*[data-index="'+index+'"]'),panel=popup.find(".data_panel_"+index);disable?(link.addClass("disabled"),panel.find(":input").attr("disabled",!0)):(link.removeClass("disabled"),panel.find(":input").attr("disabled",!1))}function form_wizard_enable_tab(popup,index){enable_disable_tab(popup,index,0)}function form_wizard_disable_tab(popup,index){enable_disable_tab(popup,index,1)}function form_wizard_enable_all_tabs(popup){popup.find(".pp_nav_links > li").removeClass("disabled")}function enable_disable_btns(popup,link){var nextBtn=popup.find(".next-btn"),prevBtn=popup.find(".prev-btn");link.hasClass("first")?(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!0)):link.hasClass("last")?(nextBtn.prop("disabled",!0),prevBtn.prop("disabled",!1)):(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!1))}var _wp$i18n=wp.i18n,active_tab=(_wp$i18n.__,_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,0);return{escapeHTML:escapeHTML,decodeHtml:decodeHtml,isHtmlIdValid:isHtmlIdValid,isValidHexColor:isValidHexColor,is_option_field:is_option_field,setup_tiptip_tooltips:setup_tiptip_tooltips,setupEnhancedMultiSelect:setup_enhanced_multi_select,setupEnhancedMultiSelectWithValue:setup_enhanced_multi_select_with_value,setupColorPicker:setup_color_picker,setup_color_pick_preview:setup_color_pick_preview,setupSortableTable:setup_sortable_table,get_property_field_value:get_property_field_value,set_property_field_value:set_property_field_value,setup_form_wizard:setup_form_wizard,form_wizard_open:form_wizard_open,form_wizard_close:form_wizard_close,form_wizard_next:form_wizard_next,form_wizard_previous:form_wizard_previous,form_wizard_start:form_wizard_start,form_wizard_enable_tab:form_wizard_enable_tab,form_wizard_disable_tab:form_wizard_disable_tab,form_wizard_enable_all_tabs:form_wizard_enable_all_tabs}}(window.jQuery,window,document),thwcfd_settings_field=function($,window,document){"use strict";function open_new_field_form(sname){open_field_form("new",!1,sname)}function open_edit_field_form(elm,rowId){open_field_form("edit",elm,!1)}function open_copy_field_form(elm,rowId){open_field_form("copy",elm,!1)}function open_field_form(type,elm,sname){var popup=$("#thwcfd_field_form_pp");populate_field_form(popup,$("#thwcfd_field_form"),type,elm,sname),thwcfd_base.form_wizard_open(popup)}function populate_field_form(popup,form,action,elm,sname){var title="edit"===action?__("Edit Field","woo-checkout-field-editor-pro"):__("New Field","woo-checkout-field-editor-pro");if(popup.find(".wizard-title").text(title),form.find(".err_msgs").html(""),form.find("input[name=f_action]").val(action),"new"===action)"billing"!=sname&&"shipping"!=sname&&"additional"!=sname||(sname+="_"),clear_field_form_general(form),form.find("select[name=i_type]").change(),thwcfd_base.set_property_field_value(form,"text","name",sname,0),thwcfd_base.set_property_field_value(form,"text","class","form-row-wide",0);else{var row=$(elm).closest("tr"),props_json=row.find(".f_props").val(),props=JSON.parse(props_json);populate_field_form_general(action,form,props),form.find("select[name=i_type]").change(),populate_field_form_props(form,row,props)}}function clear_field_form_general(form){thwcfd_base.set_property_field_value(form,"hidden","autocomplete","",0),thwcfd_base.set_property_field_value(form,"hidden","priority","",0),thwcfd_base.set_property_field_value(form,"hidden","custom","",0),thwcfd_base.set_property_field_value(form,"hidden","oname","",0),thwcfd_base.set_property_field_value(form,"hidden","otype","",0),thwcfd_base.set_property_field_value(form,"select","type","text",0),thwcfd_base.set_property_field_value(form,"text","name","",0)}function populate_field_form_general(action,form,props){var autocomplete=props.autocomplete?props.autocomplete:"",priority=props.priority?props.priority:"",custom=props.custom?props.custom:"",type=props.type?props.type:"text",name=props.name?props.name:"";"copy"===action&&(name=""),thwcfd_base.set_property_field_value(form,"hidden","autocomplete",autocomplete,0),thwcfd_base.set_property_field_value(form,"hidden","priority",priority,0),thwcfd_base.set_property_field_value(form,"hidden","custom",custom,0),thwcfd_base.set_property_field_value(form,"hidden","oname",name,0),thwcfd_base.set_property_field_value(form,"hidden","otype",type,0),thwcfd_base.set_property_field_value(form,"select","type",type,0),thwcfd_base.set_property_field_value(form,"text","name",name,0)}function populate_field_form_props(form,row,props){var ftype=props.type,custom=props.custom?props.custom:"";$.each(FIELD_FORM_PROPS,function(name,field){if("name"==name||"type"==name)return!0;var type=field.type,value=props&&props[name]?props[name]:"";"textarea"==ftype&&"default"==name&&(type="textarea"),thwcfd_base.set_property_field_value(form,type,name,value,field.multiple),"select"==type?(name=1==field.multiple?name+"[]":name,1!=field.multiple&&1!=field.change||form.find('select[name="i_'+name+'"]').trigger("change")):"checkbox"==type&&1==field.change&&form.find('input[name="i_'+name+'"]').trigger("change")});var optionsJson=row.find(".f_options").val();populate_options_list(form,optionsJson),1==custom?(form.find("input[name=i_name]").prop("disabled",!1),form.find("select[name=i_type]").prop("disabled",!1),form.find("input[name=i_show_in_email]").prop("disabled",!1),form.find("input[name=i_show_in_order]").prop("disabled",!1)):(thwcfd_base.set_property_field_value(form,"checkbox","show_in_email",!0,0),thwcfd_base.set_property_field_value(form,"checkbox","show_in_order",!0,0),form.find("input[name=i_name]").prop("disabled",!0),form.find("select[name=i_type]").prop("disabled",!0),form.find("input[name=i_show_in_email]").prop("disabled",!0),form.find("input[name=i_show_in_order]").prop("disabled",!0),form.find("input[name=i_label]").focus())}function field_type_change_listner(elm){var popup=$("#thwcfd_field_form_pp"),form=$(elm).closest("form"),type=$(elm).val();type=null==type?"text":type,form.find(".thwcfd_field_form_tab_general_placeholder").html($("#thwcfd_field_form_id_"+type).html()),enable_all_tabs_and_fields(popup,form),type in FIELDS_TO_HIDE&&$.each(FIELDS_TO_HIDE[type],function(index,name){if(FIELD_FORM_PROPS[name]){var f_props=FIELD_FORM_PROPS[name];disable_hide_field(form,f_props.type,name)}}),thwcfd_base.setupEnhancedMultiSelect(form),thwcfd_base.setupColorPicker(form),thwcfd_base.setupSortableTable(form,".thwcfd-option-list","100")}function enable_all_tabs_and_fields(popup,form){thwcfd_base.form_wizard_enable_all_tabs(popup),form.find(":input").attr("disabled",!1),form.find("tr").removeClass("disabled hide")}function enable_disable_field(form,type,name,enabled,hide){var elm=null;switch(type){case"select":elm=form.find('select[name="i_'+name+'"]'),0==elm.length&&(elm=form.find('select[name="i_'+name+'[]"]'));break;case"textarea":elm=form.find("textarea[name=i_"+name+"]"),0==elm.length&&(elm=form.find('textarea[name="i_'+name+'[]"]'));break;default:elm=form.find("input[name=i_"+name+"]"),0==elm.length&&(elm=form.find('input[name="i_'+name+'[]"]'))}if(elm&&elm.length){var rowClass=hide?"disabled hide":"disabled";enabled?(elm.attr("disabled",!1),elm.closest("tr.form_field_"+name).removeClass("disabled hide")):(elm.attr("disabled",!0),elm.closest("tr.form_field_"+name).addClass(rowClass))}}function disable_hide_field(form,type,name){enable_disable_field(form,type,name,!1,!0)}function save_field(elm){var popup=$("#thwcfd_field_form_pp"),form=$("#thwcfd_field_form");validate_field_form(form,popup)&&(prepare_field_form(form),form.submit())}function validate_field_form(form,popup){var err_msgs="",fname=thwcfd_base.get_property_field_value(form,"text","name"),ftype=thwcfd_base.get_property_field_value(form,"select","type"),fotype=(thwcfd_base.get_property_field_value(form,"text","label"),thwcfd_base.get_property_field_value(form,"hidden","otype")),fvalue=thwcfd_base.get_property_field_value(form,"text","default"),option_values=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get();return""==ftype&&-1==$.inArray(fotype,SPECIAL_FIELD_TYPES)?err_msgs="Type is required":""==fname?err_msgs="Name is required":thwcfd_base.isHtmlIdValid(fname)||(err_msgs=MSG_INVALID_NAME),option_values.length>0&&""!=fvalue&&("select"==ftype||"radio"==ftype)&&(option_values.includes(fvalue)||(err_msgs=__("Enter a value given in the options.","woo-checkout-field-editor-pro"))),""==err_msgs||(form.find(".err_msgs").html(err_msgs),thwcfd_base.form_wizard_start(popup),!1)}function prepare_field_form(form){var options_json=get_options(form);thwcfd_base.set_property_field_value(form,"hidden","options_json",options_json,0)}function get_options(form){for(var optionsKey=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get(),optionsText=form.find("input[name='i_options_text[]']").map(function(){return $(this).val()}).get(),optionsSize=optionsText.length,optionsArr=[],i=0;i<optionsSize;i++){var optionDetails={};optionDetails.key=optionsKey[i],optionDetails.text=optionsText[i],optionsArr.push(optionDetails)}var optionsJson=optionsArr.length>0?JSON.stringify(optionsArr):"";return optionsJson=encodeURIComponent(optionsJson)}function populate_options_list(form,optionsJson){var optionsHtml="";if(optionsJson)try{optionsJson=decodeURIComponent(optionsJson);var optionsList=$.parseJSON(optionsJson);optionsList&&jQuery.each(optionsList,function(){optionsHtml+=prepare_option_row_html(this)})}catch(err){console.log(err)}var optionsTable=form.find(".thwcfd-option-list tbody");optionsHtml?optionsTable.html(optionsHtml):optionsTable.html(prepare_option_row_html(null))}function prepare_option_row_html(option){var key="",text="";option&&(key=option.key?option.key:"",text=option.text?option.text:"");var html="<tr>";return html+='<td class="key"><input type="text" name="i_options_key[]" value="'+key+'" placeholder="'+__("Option Value","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="'+__("Option Text","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="action-cell">',html+='<a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="'+__("Add new option","woo-checkout-field-editor-pro")+'">+</a>',html+='<a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="'+__("Remove option","woo-checkout-field-editor-pro")+'">x</a>',html+='<span class="btn btn-tiny sort ui-sortable-handle"></span></td>',html+="</tr>"}function add_new_option_row(elm){var ptable=$(elm).closest("table");ptable.find("tbody tr").size()>0?ptable.find("tbody tr:last").after(prepare_option_row_html(null)):ptable.find("tbody").append(prepare_option_row_html(null))}function remove_option_row(elm){var ptable=$(elm).closest("table");$(elm).closest("tr").remove(),0==ptable.find("tbody tr").size()&&ptable.find("tbody").append(prepare_option_row_html(null))}var _wp$i18n=wp.i18n,__=_wp$i18n.__,MSG_INVALID_NAME=(_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,__('NAME/ID must begin with a lowercase letter ([a-z]) or underscores ("_") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores ("_")',"woo-checkout-field-editor-pro")),SPECIAL_FIELD_TYPES=["country","state","city"],FIELD_FORM_PROPS={name:{name:"name",type:"text"},type:{name:"type",type:"select"},label:{name:"label",type:"text"},default:{name:"default",type:"text"},placeholder:{name:"placeholder",type:"text"},class:{name:"class",type:"text"},validate:{name:"validate",type:"select",multiple:1},required:{name:"required",type:"checkbox"},enabled:{name:"enabled",type:"checkbox"},show_in_email:{name:"show_in_email",type:"checkbox"},show_in_order:{name:"show_in_order",type:"checkbox"}},FIELDS_TO_HIDE={radio:["placeholder","validate"],select:["validate"],password:["default"]};return{openNewFieldForm:open_new_field_form,openEditFieldForm:open_edit_field_form,openCopyFieldForm:open_copy_field_form,fieldTypeChangeListner:field_type_change_listner,addNewOptionRow:add_new_option_row,removeOptionRow:remove_option_row,save_field:save_field}}(window.jQuery,window,document),thwcfd_settings=function($,window,document){"use strict";function select_all_fields(elm){var checkAll=$(elm).prop("checked");$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]").prop("checked",checkAll)}function remove_selected_fields(){$("#thwcfd_checkout_fields tbody tr").removeClass("strikeout"),$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");row.hasClass("strikeout")||row.addClass("strikeout"),row.find(".f_deleted").val(1)})}function enable_disable_selected_fields(enabled){$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");0==enabled?row.hasClass("thpladmin-disabled")||row.addClass("thpladmin-disabled"):row.removeClass("thpladmin-disabled"),row.find(".td_enabled").html(1==enabled?'<span class="dashicons dashicons-yes tips" data-tip="'+__("Yes","woo-checkout-field-editor-pro")+'"></span>':"-"),row.find(".f_enabled").val(enabled)})}function hide_review_request_notice(elm){var wrapper=$(elm).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),data={thwcfd_security_review_notice:nonce,action:"skip_thwcfd_review_request_notice"};$.post(ajaxurl,data,function(){}),$(wrapper).hide(50)}var _wp$i18n=wp.i18n,__=_wp$i18n.__;_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx;return $(function(){var settings_form=$("#thwcfd_checkout_fields_form");thwcfd_base.setupSortableTable(settings_form,"#thwcfd_checkout_fields","0"),thwcfd_base.setup_tiptip_tooltips(),thwcfd_base.setup_form_wizard()}),$(document).on("click",".thpladmin-notice .notice-dismiss",function(){var wrapper=$(this).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),action=wrapper.data("action"),data={thwcfd_security_review_notice:nonce,action:action};$.post(ajaxurl,data,function(){})}),$(document).ready(function(){setTimeout(function(){$("#thwcfd_review_request_notice").fadeIn(500)},160)}),$(document).keypress(function(e){!$("#thwcfd_field_form_pp").is(":visible")||13!=e.keycode&&13!=e.which||(e.preventDefault(),thwcfdSaveField(this))}),{selectAllFields:select_all_fields,removeSelectedFields:remove_selected_fields,enableDisableSelectedFields:enable_disable_selected_fields,hideReviewRequestNotice:hide_review_request_notice}}(window.jQuery,window,document);
1
+ function thwcfdSetupEnhancedMultiSelectWithValue(elm){thwcfd_base.setupEnhancedMultiSelectWithValue(elm)}function thwcfdSetupSortableTable(parent,elm,left){thwcfd_base.setupSortableTable(parent,elm,left)}function thwcfdCloseModal(elm){thwcfd_base.form_wizard_close(elm)}function thwcfdWizardNext(elm){thwcfd_base.form_wizard_next(elm)}function thwcfdWizardPrevious(elm){thwcfd_base.form_wizard_previous(elm)}function thwcfdOpenNewFieldForm(sectionName){thwcfd_settings_field.openNewFieldForm(sectionName)}function thwcfdOpenEditFieldForm(elm,rowId){thwcfd_settings_field.openEditFieldForm(elm,rowId)}function thwcfdOpenCopyFieldForm(elm,rowId){thwcfd_settings_field.openCopyFieldForm(elm,rowId)}function thwcfdFieldTypeChangeListner(elm){thwcfd_settings_field.fieldTypeChangeListner(elm)}function thwcfdAddNewOptionRow(elm){thwcfd_settings_field.addNewOptionRow(elm)}function thwcfdRemoveOptionRow(elm){thwcfd_settings_field.removeOptionRow(elm)}function thwcfdSaveField(elm){thwcfd_settings_field.save_field(elm)}function thwcfdSelectAllCheckoutFields(elm){thwcfd_settings.selectAllFields(elm)}function thwcfdRemoveSelectedFields(){thwcfd_settings.removeSelectedFields()}function thwcfdEnableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(1)}function thwcfdDisableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(0)}!function(wp,$){"use strict";wp&&$(function(){$(document).on("click",".th-plugin-action.install-now",function(event){const $button=$(event.target);if($button.hasClass("activate-now"))return!0;event.preventDefault(),$button.hasClass("updating-message")||$button.hasClass("button-disabled")||(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(event),$(document).on("credential-modal-cancel",function(){$(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:$button.data("slug")}))})})}(window.wp,jQuery);var thwcfd_plugins_list=function($,window,document){"use strict";$(function(){$(document).on("click",".th-plugin-action.activate-now",function(event){const $button=$(event.target);if(event.preventDefault(),!$button.hasClass("updating-message")&&!$button.hasClass("button-disabled")){var url_string=$button.attr("href"),url=new URL(url_string),file=url.searchParams.get("plugin"),nonce=url.searchParams.get("_wpnonce"),action=url.searchParams.get("action");if("activate"==action&&(action="th_activate_plugin"),null!=file&&null!=nonce&&null!=action){var data={action:action,file:file,_wpnonce:nonce};jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:data,beforeSend:function(){$button.addClass("updating-message"),$button.text("Activating")},success:function(data){$button.removeClass("updating-message"),1==data?($button.text("Activated"),$button.addClass("disabled")):($button.text("Failed"),$button.addClass("disabled"))},error:function(xhr){$button.text("Failed"),$button.addClass("disabled")}})}}})})}(window.jQuery,window,document),thwcfd_base=function($,window,document){"use strict";function escapeHTML(html){var fn=function(tag){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;"}[tag]||tag};return html.replace(/[&<>"]/g,fn)}function decodeHtml(str){if(str&&"string"==typeof str){var map={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'"};return str.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,function(m){return map[m]})}return str}function isHtmlIdValid(id){return/^[a-z\_]+[a-z0-9\_]*$/.test(id.trim())}function isValidHexColor(value){return!!preg_match("/^#[a-f0-9]{6}$/i",value)}function is_option_field(type){var result=!1;return"select"!=type&&"multiselect"!=type&&"radio"!=type&&"checkboxgroup"!=type||(result=!0),result}function setup_tiptip_tooltips(){var tiptip_args={attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200};$(".tips").tipTip(tiptip_args)}function setup_enhanced_multi_select(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){$(this).hasClass("enhanced")||$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced")})}function setup_enhanced_multi_select_with_value(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){if(!$(this).hasClass("enhanced")){$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced");var value=$(this).data("value");value=value.split(","),$(this).val(value),$(this).trigger("change")}})}function setup_color_picker(form){form.find(".thpladmin-colorpick").iris({change:function(event,ui){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:ui.color.toString()})},hide:!0,border:!0}).click(function(){$(".iris-picker").hide(),$(this).closest("td").find(".iris-picker").show()}),$("body").click(function(){$(".iris-picker").hide()}),$(".thpladmin-colorpick").click(function(event){event.stopPropagation()})}function setup_color_pick_preview(form){form.find(".thpladmin-colorpick").each(function(){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:this.value})})}function prepare_field_order_indexes(elm){$(elm+" tbody tr").each(function(index,el){$("input.f_order",el).val(parseInt($(el).index(elm+" tbody tr")))})}function setup_sortable_table(parent,elm,left){parent.find(elm+" tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:".sort",scrollSensitivity:40,helper:function(e,ui){return ui.children().each(function(){$(this).width($(this).width())}),ui.css("left",left),ui}}),$(elm+" tbody").on("sortstart",function(event,ui){ui.item.css("background-color","#f6f6f6")}),$(elm+" tbody").on("sortstop",function(event,ui){ui.item.removeAttr("style"),prepare_field_order_indexes(elm)})}function get_property_field_value(form,type,name){var value="";switch(type){case"select":value=form.find("select[name=i_"+name+"]").val(),value=null==value?"":value;break;case"checkbox":value=form.find("input[name=i_"+name+"]").prop("checked"),value=value?1:0;break;case"textarea":value=form.find("textarea[name=i_"+name+"]").val(),value=null==value?"":value;break;default:value=form.find("input[name=i_"+name+"]").val(),value=null==value?"":value}return value}function set_property_field_value(form,type,name,value,multiple){switch(type){case"select":1==multiple?(value="string"==typeof value?value.split(","):value,name+="[]",form.find('select[name="i_'+name+'"]').val(value).trigger("change")):form.find('select[name="i_'+name+'"]').val(value);break;case"checkbox":value=1==value||"yes"==value,form.find("input[name=i_"+name+"]").prop("checked",value);break;case"textarea":value=value?decodeHtml(value):value,form.find("textarea[name=i_"+name+"]").val(value);break;case"colorpicker":var bg_color=value?{backgroundColor:value}:{};form.find("input[name=i_"+name+"]").val(value),form.find("."+name+"_preview").css(bg_color);break;default:value=value?decodeHtml(value):value,form.find("input[name=i_"+name+"]").val(value)}}function setup_form_wizard(){$(".pp_nav_links > li").click(function(){var index=$(this).data("index");open_tab($(this).closest(".thpladmin-modal-mask"),$(this),index),active_tab=index})}function get_popup(elm){return $(elm).closest(".thpladmin-modal-mask")}function get_active_tab(popup){return popup.find("ul.pp_nav_links").find("li.active")}function get_next_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.nextAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function get_prev_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.prevAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function form_wizard_open(popup){active_tab=0,popup.find("ul.pp_nav_links li").first().click(),popup.css("display","block")}function form_wizard_close(elm){get_popup(elm).css("display","none"),active_tab=0}function form_wizard_next(elm){active_tab=get_next_tab_index(elm),move_to(elm,active_tab)}function form_wizard_previous(elm){active_tab=get_prev_tab_index(elm),move_to(elm,active_tab)}function form_wizard_start(elm){active_tab=0,move_to(elm,active_tab)}function move_to(elm,index){var popup=get_popup(elm);open_tab(popup,popup.find('*[data-index="'+index+'"]'),index)}function open_tab(popup,link,index){var panel=popup.find(".data_panel_"+index);close_all_data_panel(popup),link.addClass("active"),panel.css("display","block"),enable_disable_btns(popup,link)}function close_all_data_panel(popup){popup.find(".pp_nav_links > li").removeClass("active"),popup.find(".data-panel").css("display","none")}function enable_disable_tab(popup,index,disable){var link=popup.find('*[data-index="'+index+'"]'),panel=popup.find(".data_panel_"+index);disable?(link.addClass("disabled"),panel.find(":input").attr("disabled",!0)):(link.removeClass("disabled"),panel.find(":input").attr("disabled",!1))}function form_wizard_enable_tab(popup,index){enable_disable_tab(popup,index,0)}function form_wizard_disable_tab(popup,index){enable_disable_tab(popup,index,1)}function form_wizard_enable_all_tabs(popup){popup.find(".pp_nav_links > li").removeClass("disabled")}function enable_disable_btns(popup,link){var nextBtn=popup.find(".next-btn"),prevBtn=popup.find(".prev-btn");link.hasClass("first")?(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!0)):link.hasClass("last")?(nextBtn.prop("disabled",!0),prevBtn.prop("disabled",!1)):(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!1))}var _wp$i18n=wp.i18n,active_tab=(_wp$i18n.__,_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,0);return{escapeHTML:escapeHTML,decodeHtml:decodeHtml,isHtmlIdValid:isHtmlIdValid,isValidHexColor:isValidHexColor,is_option_field:is_option_field,setup_tiptip_tooltips:setup_tiptip_tooltips,setupEnhancedMultiSelect:setup_enhanced_multi_select,setupEnhancedMultiSelectWithValue:setup_enhanced_multi_select_with_value,setupColorPicker:setup_color_picker,setup_color_pick_preview:setup_color_pick_preview,setupSortableTable:setup_sortable_table,get_property_field_value:get_property_field_value,set_property_field_value:set_property_field_value,setup_form_wizard:setup_form_wizard,form_wizard_open:form_wizard_open,form_wizard_close:form_wizard_close,form_wizard_next:form_wizard_next,form_wizard_previous:form_wizard_previous,form_wizard_start:form_wizard_start,form_wizard_enable_tab:form_wizard_enable_tab,form_wizard_disable_tab:form_wizard_disable_tab,form_wizard_enable_all_tabs:form_wizard_enable_all_tabs}}(window.jQuery,window,document),thwcfd_settings_field=function($,window,document){"use strict";function open_new_field_form(sname){open_field_form("new",!1,sname)}function open_edit_field_form(elm,rowId){open_field_form("edit",elm,!1)}function open_copy_field_form(elm,rowId){open_field_form("copy",elm,!1)}function open_field_form(type,elm,sname){var popup=$("#thwcfd_field_form_pp");populate_field_form(popup,$("#thwcfd_field_form"),type,elm,sname),thwcfd_base.form_wizard_open(popup)}function populate_field_form(popup,form,action,elm,sname){var title="edit"===action?__("Edit Field","woo-checkout-field-editor-pro"):__("New Field","woo-checkout-field-editor-pro");if(popup.find(".wizard-title").text(title),form.find(".err_msgs").html(""),form.find("input[name=f_action]").val(action),"new"===action)"billing"!=sname&&"shipping"!=sname&&"additional"!=sname||(sname+="_"),clear_field_form_general(form),form.find("select[name=i_type]").change(),thwcfd_base.set_property_field_value(form,"text","name",sname,0),thwcfd_base.set_property_field_value(form,"text","class","form-row-wide",0);else{var row=$(elm).closest("tr"),props_json=row.find(".f_props").val(),props=JSON.parse(props_json);populate_field_form_general(action,form,props),form.find("select[name=i_type]").change(),populate_field_form_props(form,row,props)}}function clear_field_form_general(form){thwcfd_base.set_property_field_value(form,"hidden","autocomplete","",0),thwcfd_base.set_property_field_value(form,"hidden","priority","",0),thwcfd_base.set_property_field_value(form,"hidden","custom","",0),thwcfd_base.set_property_field_value(form,"hidden","oname","",0),thwcfd_base.set_property_field_value(form,"hidden","otype","",0),thwcfd_base.set_property_field_value(form,"select","type","text",0),thwcfd_base.set_property_field_value(form,"text","name","",0)}function populate_field_form_general(action,form,props){var autocomplete=props.autocomplete?props.autocomplete:"",priority=props.priority?props.priority:"",custom=props.custom?props.custom:"",type=props.type?props.type:"text",name=props.name?props.name:"";"copy"===action&&(name=""),thwcfd_base.set_property_field_value(form,"hidden","autocomplete",autocomplete,0),thwcfd_base.set_property_field_value(form,"hidden","priority",priority,0),thwcfd_base.set_property_field_value(form,"hidden","custom",custom,0),thwcfd_base.set_property_field_value(form,"hidden","oname",name,0),thwcfd_base.set_property_field_value(form,"hidden","otype",type,0),thwcfd_base.set_property_field_value(form,"select","type",type,0),thwcfd_base.set_property_field_value(form,"text","name",name,0)}function populate_field_form_props(form,row,props){var ftype=props.type,custom=props.custom?props.custom:"";$.each(FIELD_FORM_PROPS,function(name,field){if("name"==name||"type"==name)return!0;var type=field.type,value=props&&props[name]?props[name]:"";"textarea"==ftype&&"default"==name&&(type="textarea"),thwcfd_base.set_property_field_value(form,type,name,value,field.multiple),"select"==type?(name=1==field.multiple?name+"[]":name,1!=field.multiple&&1!=field.change||form.find('select[name="i_'+name+'"]').trigger("change")):"checkbox"==type&&1==field.change&&form.find('input[name="i_'+name+'"]').trigger("change")});var optionsJson=row.find(".f_options").val();populate_options_list(form,optionsJson),1==custom?(form.find("input[name=i_name]").prop("disabled",!1),form.find("select[name=i_type]").prop("disabled",!1),form.find("input[name=i_show_in_email]").prop("disabled",!1),form.find("input[name=i_show_in_order]").prop("disabled",!1)):(thwcfd_base.set_property_field_value(form,"checkbox","show_in_email",!0,0),thwcfd_base.set_property_field_value(form,"checkbox","show_in_order",!0,0),form.find("input[name=i_name]").prop("disabled",!0),form.find("select[name=i_type]").prop("disabled",!0),form.find("input[name=i_show_in_email]").prop("disabled",!0),form.find("input[name=i_show_in_order]").prop("disabled",!0),form.find("input[name=i_label]").focus())}function field_type_change_listner(elm){var popup=$("#thwcfd_field_form_pp"),form=$(elm).closest("form"),type=$(elm).val();type=null==type?"text":type,form.find(".thwcfd_field_form_tab_general_placeholder").html($("#thwcfd_field_form_id_"+type).html()),enable_all_tabs_and_fields(popup,form),type in FIELDS_TO_HIDE&&$.each(FIELDS_TO_HIDE[type],function(index,name){if(FIELD_FORM_PROPS[name]){var f_props=FIELD_FORM_PROPS[name];disable_hide_field(form,f_props.type,name)}}),thwcfd_base.setupEnhancedMultiSelect(form),thwcfd_base.setupColorPicker(form),thwcfd_base.setupSortableTable(form,".thwcfd-option-list","100")}function enable_all_tabs_and_fields(popup,form){thwcfd_base.form_wizard_enable_all_tabs(popup),form.find(":input").attr("disabled",!1),form.find("tr").removeClass("disabled hide")}function enable_disable_field(form,type,name,enabled,hide){var elm=null;switch(type){case"select":elm=form.find('select[name="i_'+name+'"]'),0==elm.length&&(elm=form.find('select[name="i_'+name+'[]"]'));break;case"textarea":elm=form.find("textarea[name=i_"+name+"]"),0==elm.length&&(elm=form.find('textarea[name="i_'+name+'[]"]'));break;default:elm=form.find("input[name=i_"+name+"]"),0==elm.length&&(elm=form.find('input[name="i_'+name+'[]"]'))}if(elm&&elm.length){var rowClass=hide?"disabled hide":"disabled";enabled?(elm.attr("disabled",!1),elm.closest("tr.form_field_"+name).removeClass("disabled hide")):(elm.attr("disabled",!0),elm.closest("tr.form_field_"+name).addClass(rowClass))}}function disable_hide_field(form,type,name){enable_disable_field(form,type,name,!1,!0)}function save_field(elm){var popup=$("#thwcfd_field_form_pp"),form=$("#thwcfd_field_form");validate_field_form(form,popup)&&(prepare_field_form(form),form.submit())}function validate_field_form(form,popup){var err_msgs="",fname=thwcfd_base.get_property_field_value(form,"text","name"),ftype=thwcfd_base.get_property_field_value(form,"select","type"),fotype=(thwcfd_base.get_property_field_value(form,"text","label"),thwcfd_base.get_property_field_value(form,"hidden","otype")),fvalue=thwcfd_base.get_property_field_value(form,"text","default"),option_values=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get();if(""==ftype&&-1==$.inArray(fotype,SPECIAL_FIELD_TYPES)?err_msgs="Type is required":""==fname?err_msgs="Name is required":thwcfd_base.isHtmlIdValid(fname)||(err_msgs=MSG_INVALID_NAME),fvalue&&option_values.length>0&&("select"==ftype||"radio"==ftype||"multiselect"==ftype||"checkboxgroup"==ftype))if("select"==ftype||"radio"==ftype)option_values.includes(fvalue)||(err_msgs=__("Enter default value given in the options.","woo-checkout-field-editor-pro"));else if("multiselect"==ftype||"checkboxgroup"==ftype)for(var value_array=fvalue.split(", "),i=0;i<value_array.length;i++){var value=value_array[i];value&&!option_values.includes(value)&&(err_msgs=__("Enter default values given in the options.","woo-checkout-field-editor-pro"))}return fvalue&&"number"==ftype&&!1===/^-?\d+$/.test(fvalue)&&(err_msgs=__("Default value must be a number.","woo-checkout-field-editor-pro")),""==err_msgs||(form.find(".err_msgs").html(err_msgs),thwcfd_base.form_wizard_start(popup),!1)}function prepare_field_form(form){var options_json=get_options(form);thwcfd_base.set_property_field_value(form,"hidden","options_json",options_json,0)}function get_options(form){for(var optionsKey=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get(),optionsText=form.find("input[name='i_options_text[]']").map(function(){return $(this).val()}).get(),optionsSize=optionsText.length,optionsArr=[],i=0;i<optionsSize;i++){var optionDetails={};optionDetails.key=optionsKey[i],optionDetails.text=optionsText[i],optionsArr.push(optionDetails)}var optionsJson=optionsArr.length>0?JSON.stringify(optionsArr):"";return optionsJson=encodeURIComponent(optionsJson)}function populate_options_list(form,optionsJson){var optionsHtml="";if(optionsJson)try{optionsJson=decodeURIComponent(optionsJson);var optionsList=$.parseJSON(optionsJson);optionsList&&jQuery.each(optionsList,function(){optionsHtml+=prepare_option_row_html(this)})}catch(err){console.log(err)}var optionsTable=form.find(".thwcfd-option-list tbody");optionsHtml?optionsTable.html(optionsHtml):optionsTable.html(prepare_option_row_html(null))}function prepare_option_row_html(option){var key="",text="";option&&(key=option.key?option.key:"",text=option.text?option.text:"");var html="<tr>";return html+='<td class="key"><input type="text" name="i_options_key[]" value="'+key+'" placeholder="'+__("Option Value","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="'+__("Option Text","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="action-cell">',html+='<a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="'+__("Add new option","woo-checkout-field-editor-pro")+'">+</a>',html+='<a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="'+__("Remove option","woo-checkout-field-editor-pro")+'">x</a>',html+='<span class="btn btn-tiny sort ui-sortable-handle"></span></td>',html+="</tr>"}function add_new_option_row(elm){var ptable=$(elm).closest("table");ptable.find("tbody tr").size()>0?ptable.find("tbody tr:last").after(prepare_option_row_html(null)):ptable.find("tbody").append(prepare_option_row_html(null))}function remove_option_row(elm){var ptable=$(elm).closest("table");$(elm).closest("tr").remove(),0==ptable.find("tbody tr").size()&&ptable.find("tbody").append(prepare_option_row_html(null))}var _wp$i18n=wp.i18n,__=_wp$i18n.__,MSG_INVALID_NAME=(_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,__('NAME/ID must begin with a lowercase letter ([a-z]) or underscores ("_") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores ("_")',"woo-checkout-field-editor-pro")),SPECIAL_FIELD_TYPES=["country","state","city"],FIELD_FORM_PROPS={name:{name:"name",type:"text"},type:{name:"type",type:"select"},label:{name:"label",type:"text"},default:{name:"default",type:"text"},placeholder:{name:"placeholder",type:"text"},class:{name:"class",type:"text"},validate:{name:"validate",type:"select",multiple:1},title_type:{name:"title_type",type:"select"},checked:{name:"checked",type:"checkbox"},required:{name:"required",type:"checkbox"},enabled:{name:"enabled",type:"checkbox"},show_in_email:{name:"show_in_email",type:"checkbox"},show_in_order:{name:"show_in_order",type:"checkbox"}},FIELDS_TO_HIDE={radio:["placeholder","validate"],select:["validate"],password:["default"]};return{openNewFieldForm:open_new_field_form,openEditFieldForm:open_edit_field_form,openCopyFieldForm:open_copy_field_form,fieldTypeChangeListner:field_type_change_listner,addNewOptionRow:add_new_option_row,removeOptionRow:remove_option_row,save_field:save_field}}(window.jQuery,window,document),thwcfd_settings=function($,window,document){"use strict";function select_all_fields(elm){var checkAll=$(elm).prop("checked");$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]").prop("checked",checkAll)}function remove_selected_fields(){$("#thwcfd_checkout_fields tbody tr").removeClass("strikeout"),$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");row.hasClass("strikeout")||row.addClass("strikeout"),row.find(".f_deleted").val(1)})}function enable_disable_selected_fields(enabled){$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");0==enabled?row.hasClass("thpladmin-disabled")||row.addClass("thpladmin-disabled"):row.removeClass("thpladmin-disabled"),row.find(".td_enabled").html(1==enabled?'<span class="dashicons dashicons-yes tips" data-tip="'+__("Yes","woo-checkout-field-editor-pro")+'"></span>':"-"),row.find(".f_enabled").val(enabled)})}var _wp$i18n=wp.i18n,__=_wp$i18n.__;_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx;return $(function(){var settings_form=$("#thwcfd_checkout_fields_form");thwcfd_base.setupSortableTable(settings_form,"#thwcfd_checkout_fields","0"),thwcfd_base.setup_tiptip_tooltips(),thwcfd_base.setup_form_wizard()}),$(document).keypress(function(e){!$("#thwcfd_field_form_pp").is(":visible")||13!=e.keycode&&13!=e.which||(e.preventDefault(),thwcfdSaveField(this))}),{selectAllFields:select_all_fields,removeSelectedFields:remove_selected_fields,enableDisableSelectedFields:enable_disable_selected_fields}}(window.jQuery,window,document);
admin/class-thwcfd-admin-form-field.php CHANGED
@@ -38,12 +38,18 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
38
  public function get_field_types(){
39
  return array(
40
  'text' => __('Text', 'woo-checkout-field-editor-pro'),
 
 
41
  'password' => __('Password', 'woo-checkout-field-editor-pro'),
42
  'email' => __('Email', 'woo-checkout-field-editor-pro'),
43
  'tel' => __('Phone', 'woo-checkout-field-editor-pro'),
44
- 'select' => __('Select', 'woo-checkout-field-editor-pro'),
45
  'textarea' => __('Textarea', 'woo-checkout-field-editor-pro'),
46
  'radio' => __('Radio', 'woo-checkout-field-editor-pro'),
 
 
 
 
 
47
  );
48
  }
49
 
@@ -63,6 +69,15 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
63
  'half_left' => __('Half width left', 'woo-checkout-field-editor-pro'),
64
  'half_right' => __('Half width right', 'woo-checkout-field-editor-pro'),
65
  );
 
 
 
 
 
 
 
 
 
66
 
67
  return array(
68
  'type' => array('type'=>'select', 'name'=>'type', 'label'=>__('Type', 'woo-checkout-field-editor-pro'), 'required'=>1, 'options'=>$field_types,
@@ -75,8 +90,11 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
75
  'class' => array('type'=>'text', 'name'=>'class', 'label'=>__('Class', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Separate classes with comma', 'woo-checkout-field-editor-pro')),
76
  'validate' => array('type'=>'multiselect', 'name'=>'validate', 'label'=>__('Validation', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Select validations', 'woo-checkout-field-editor-pro'), 'options'=>$validations, 'multiple'=>1),
77
  // 'disp_style' => array('type'=>'select', 'name'=>'disp_style', 'label'=>'Field Display', 'options'=>$display_style),
 
 
78
 
79
  'required' => array('type'=>'checkbox', 'name'=>'required', 'label'=>__('Required', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
 
80
  //'clear' => array('type'=>'checkbox', 'name'=>'clear', 'label'=>'Clear Row', 'value'=>'1', 'checked'=>1),
81
  'enabled' => array('type'=>'checkbox', 'name'=>'enabled', 'label'=>__('Enabled', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
82
 
@@ -224,12 +242,18 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
224
 
225
  private function output_form_fragments(){
226
  $this->render_form_field_inputtext();
 
227
  $this->render_form_field_password();
228
  $this->render_form_field_tel();
229
  $this->render_form_field_email();
230
  $this->render_form_field_textarea();
231
- $this->render_form_field_select();
232
  $this->render_form_field_radio();
 
 
 
 
 
 
233
  $this->render_form_field_default();
234
  }
235
 
@@ -252,6 +276,24 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
252
  <?php
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  private function render_form_field_password(){
256
  ?>
257
  <table id="thwcfd_field_form_id_password" class="thwcfd_field_form_table" width="100%" style="display:none;">
@@ -352,6 +394,27 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
352
  </table>
353
  <?php
354
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
  private function render_form_field_radio(){
357
  ?>
@@ -374,6 +437,73 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
374
  </table>
375
  <?php
376
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
  private function render_form_field_default(){
379
  ?>
38
  public function get_field_types(){
39
  return array(
40
  'text' => __('Text', 'woo-checkout-field-editor-pro'),
41
+ 'number' => __('Number', 'woo-checkout-field-editor-pro'),
42
+ 'hidden' => __('Hidden', 'woo-checkout-field-editor-pro'),
43
  'password' => __('Password', 'woo-checkout-field-editor-pro'),
44
  'email' => __('Email', 'woo-checkout-field-editor-pro'),
45
  'tel' => __('Phone', 'woo-checkout-field-editor-pro'),
 
46
  'textarea' => __('Textarea', 'woo-checkout-field-editor-pro'),
47
  'radio' => __('Radio', 'woo-checkout-field-editor-pro'),
48
+ 'select' => __('Select', 'woo-checkout-field-editor-pro'),
49
+ 'multiselect' => __('Multiselect', 'woo-checkout-field-editor-pro'),
50
+ 'checkbox' => __('Checkbox', 'woo-checkout-field-editor-pro'),
51
+ 'checkboxgroup' => __('Checkbox Group', 'woo-checkout-field-editor-pro'),
52
+ 'heading' => __('Heading', 'woo-checkout-field-editor-pro'),
53
  );
54
  }
55
 
69
  'half_left' => __('Half width left', 'woo-checkout-field-editor-pro'),
70
  'half_right' => __('Half width right', 'woo-checkout-field-editor-pro'),
71
  );
72
+
73
+ $html_text_tags = array(
74
+ 'h1' => 'H1',
75
+ 'h2' => 'H2',
76
+ 'h3' => 'H3',
77
+ 'h4' => 'H4',
78
+ 'h5' => 'H5',
79
+ 'h6' => 'H6',
80
+ );
81
 
82
  return array(
83
  'type' => array('type'=>'select', 'name'=>'type', 'label'=>__('Type', 'woo-checkout-field-editor-pro'), 'required'=>1, 'options'=>$field_types,
90
  'class' => array('type'=>'text', 'name'=>'class', 'label'=>__('Class', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Separate classes with comma', 'woo-checkout-field-editor-pro')),
91
  'validate' => array('type'=>'multiselect', 'name'=>'validate', 'label'=>__('Validation', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Select validations', 'woo-checkout-field-editor-pro'), 'options'=>$validations, 'multiple'=>1),
92
  // 'disp_style' => array('type'=>'select', 'name'=>'disp_style', 'label'=>'Field Display', 'options'=>$display_style),
93
+ // 'title' => array('type'=>'text', 'name'=>'title', 'label'=>'Label'),
94
+ 'title_type' => array('type'=>'select', 'name'=>'title_type', 'label'=>'Title Type', 'value'=>'h3', 'options'=>$html_text_tags),
95
 
96
  'required' => array('type'=>'checkbox', 'name'=>'required', 'label'=>__('Required', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
97
+ 'checked' => array('type'=>'checkbox', 'name'=>'checked', 'label'=>__(' Checked by default', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>0),
98
  //'clear' => array('type'=>'checkbox', 'name'=>'clear', 'label'=>'Clear Row', 'value'=>'1', 'checked'=>1),
99
  'enabled' => array('type'=>'checkbox', 'name'=>'enabled', 'label'=>__('Enabled', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
100
 
242
 
243
  private function output_form_fragments(){
244
  $this->render_form_field_inputtext();
245
+ $this->render_form_field_number();
246
  $this->render_form_field_password();
247
  $this->render_form_field_tel();
248
  $this->render_form_field_email();
249
  $this->render_form_field_textarea();
 
250
  $this->render_form_field_radio();
251
+ $this->render_form_field_select();
252
+ $this->render_form_field_multiselect();
253
+ $this->render_form_field_checkbox();
254
+ $this->render_form_field_checkboxgroup();
255
+ $this->render_form_field_hidden();
256
+ $this->render_form_field_heading();
257
  $this->render_form_field_default();
258
  }
259
 
276
  <?php
277
  }
278
 
279
+ private function render_form_field_number(){
280
+ ?>
281
+ <table id="thwcfd_field_form_id_number" class="thwcfd_pp_table" style="display:none;">
282
+ <?php
283
+ $this->render_form_elm_row($this->field_props['label']);
284
+ $this->render_form_elm_row($this->field_props['placeholder']);
285
+ $this->render_form_elm_row($this->field_props['default']);
286
+ $this->render_form_elm_row($this->field_props['class']);
287
+
288
+ $this->render_form_elm_row_cb($this->field_props['required']);
289
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
290
+ $this->render_form_elm_row_cb($this->field_props['show_in_email']);
291
+ $this->render_form_elm_row_cb($this->field_props['show_in_order']);
292
+ ?>
293
+ </table>
294
+ <?php
295
+ }
296
+
297
  private function render_form_field_password(){
298
  ?>
299
  <table id="thwcfd_field_form_id_password" class="thwcfd_field_form_table" width="100%" style="display:none;">
394
  </table>
395
  <?php
396
  }
397
+
398
+ private function render_form_field_multiselect(){
399
+ ?>
400
+ <table id="thwcfd_field_form_id_multiselect" class="thwcfd_field_form_table" width="100%" style="display:none;">
401
+ <?php
402
+ $this->render_form_elm_row($this->field_props['label']);
403
+ $this->render_form_elm_row($this->field_props['placeholder']);
404
+ $this->render_form_elm_row($this->field_props['default']);
405
+ $this->render_form_elm_row($this->field_props['class']);
406
+
407
+ $this->render_form_elm_row_cb($this->field_props['required']);
408
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
409
+ $this->render_form_elm_row_cb($this->field_props['show_in_email']);
410
+ $this->render_form_elm_row_cb($this->field_props['show_in_order']);
411
+
412
+ $this->render_form_fragment_h_spacing();
413
+ $this->render_form_fragment_options();
414
+ ?>
415
+ </table>
416
+ <?php
417
+ }
418
 
419
  private function render_form_field_radio(){
420
  ?>
437
  </table>
438
  <?php
439
  }
440
+
441
+ private function render_form_field_checkbox(){
442
+ ?>
443
+ <table id="thwcfd_field_form_id_checkbox" class="thwcfd_field_form_table" width="100%" style="display:none;">
444
+ <?php
445
+ $this->render_form_elm_row($this->field_props['label']);
446
+ $this->render_form_elm_row($this->field_props['class']);
447
+
448
+ $this->render_form_elm_row_cb($this->field_props['checked']);
449
+ $this->render_form_elm_row_cb($this->field_props['required']);
450
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
451
+ $this->render_form_elm_row_cb($this->field_props['show_in_email']);
452
+ $this->render_form_elm_row_cb($this->field_props['show_in_order']);
453
+ ?>
454
+ </table>
455
+ <?php
456
+ }
457
+
458
+ private function render_form_field_checkboxgroup(){
459
+ ?>
460
+ <table id="thwcfd_field_form_id_checkboxgroup" class="thwcfd_field_form_table" width="100%" style="display:none;">
461
+ <?php
462
+ $this->render_form_elm_row($this->field_props['label']);
463
+ $this->render_form_elm_row($this->field_props['default']);
464
+ $this->render_form_elm_row($this->field_props['class']);
465
+
466
+ $this->render_form_elm_row_cb($this->field_props['required']);
467
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
468
+ $this->render_form_elm_row_cb($this->field_props['show_in_email']);
469
+ $this->render_form_elm_row_cb($this->field_props['show_in_order']);
470
+
471
+ $this->render_form_fragment_h_spacing();
472
+ $this->render_form_fragment_options();
473
+ ?>
474
+ </table>
475
+ <?php
476
+ }
477
+
478
+ private function render_form_field_hidden(){
479
+ ?>
480
+ <table id="thwcfd_field_form_id_hidden" class="thwcfd_field_form_table" width="100%" style="display:none;">
481
+ <?php
482
+ $this->render_form_elm_row($this->field_props['label']);
483
+ $this->render_form_elm_row($this->field_props['default']);
484
+ $this->render_form_elm_row($this->field_props['class']);
485
+
486
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
487
+ $this->render_form_elm_row_cb($this->field_props['show_in_email']);
488
+ $this->render_form_elm_row_cb($this->field_props['show_in_order']);
489
+ ?>
490
+ </table>
491
+ <?php
492
+ }
493
+
494
+ private function render_form_field_heading(){
495
+ ?>
496
+ <table id="thwcfd_field_form_id_heading" class="thwcfd_field_form_table" width="100%" style="display:none;">
497
+ <?php
498
+ $this->render_form_elm_row($this->field_props['label']);
499
+ $this->render_form_elm_row($this->field_props['title_type']);
500
+ $this->render_form_elm_row($this->field_props['class']);
501
+
502
+ $this->render_form_elm_row_cb($this->field_props['enabled']);
503
+ ?>
504
+ </table>
505
+ <?php
506
+ }
507
 
508
  private function render_form_field_default(){
509
  ?>
admin/class-thwcfd-admin-settings-general.php CHANGED
@@ -163,7 +163,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
163
  //$options_json = isset($field['options_json']) && $field['options_json'] ? htmlspecialchars($field['options_json']) : '';
164
 
165
  $options_json = '';
166
- if($type === 'select' || $type === 'radio'){
167
  $options = isset($field['options']) ? $field['options'] : '';
168
  $options_json = THWCFD_Utils::prepare_options_json($options);
169
  }
@@ -366,16 +366,26 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
366
  $field['name'] = isset($posted['i_oname']) ? sanitize_key($posted['i_oname']) : '';
367
  }
368
 
369
- if($type === 'select'){
370
  $field['validate'] = '';
371
 
372
  }else if($type === 'radio'){
373
  $field['validate'] = '';
374
  $field['placeholder'] = '';
375
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
 
378
- if($type === 'select' || $type === 'radio'){
379
  $options_json = isset($posted['i_options_json']) ? trim(stripslashes($posted['i_options_json'])) : '';
380
  $options_arr = THWCFD_Utils::prepare_options_array($options_json, $type);
381
 
@@ -405,6 +415,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
405
  $field['priority'] = isset($posted['i_priority']) ? absint($posted['i_priority']) : '';
406
  //$field['custom'] = isset($posted['i_custom']) ? $posted['i_custom'] : '';
407
  $field['custom'] = isset($posted['i_custom']) && $posted['i_custom'] ? 1 : 0;
 
408
  return $field;
409
  }
410
 
163
  //$options_json = isset($field['options_json']) && $field['options_json'] ? htmlspecialchars($field['options_json']) : '';
164
 
165
  $options_json = '';
166
+ if($type === 'select' || $type === 'radio' || $type === 'checkboxgroup' || $type === 'multiselect'){
167
  $options = isset($field['options']) ? $field['options'] : '';
168
  $options_json = THWCFD_Utils::prepare_options_json($options);
169
  }
366
  $field['name'] = isset($posted['i_oname']) ? sanitize_key($posted['i_oname']) : '';
367
  }
368
 
369
+ if($type === 'select' || $type === 'multiselect'){
370
  $field['validate'] = '';
371
 
372
  }else if($type === 'radio'){
373
  $field['validate'] = '';
374
  $field['placeholder'] = '';
375
 
376
+ }else if($type === 'number'){
377
+ $field['validate'] = array('number');
378
+
379
+ }else if($type === 'checkbox'){
380
+ if(isset($posted['i_checked'])){
381
+ $field['default'] = 1;
382
+ }else{
383
+ $field['default'] = '';
384
+ }
385
+
386
  }
387
 
388
+ if($type === 'select' || $type === 'radio' || $type === 'checkboxgroup' || $type === 'multiselect'){
389
  $options_json = isset($posted['i_options_json']) ? trim(stripslashes($posted['i_options_json'])) : '';
390
  $options_arr = THWCFD_Utils::prepare_options_array($options_json, $type);
391
 
415
  $field['priority'] = isset($posted['i_priority']) ? absint($posted['i_priority']) : '';
416
  //$field['custom'] = isset($posted['i_custom']) ? $posted['i_custom'] : '';
417
  $field['custom'] = isset($posted['i_custom']) && $posted['i_custom'] ? 1 : 0;
418
+
419
  return $field;
420
  }
421
 
admin/class-thwcfd-admin.php CHANGED
@@ -70,49 +70,6 @@ class THWCFD_Admin {
70
  return $links;
71
  }
72
 
73
- private function output_review_request_link() {
74
- $is_dismissed = get_transient('thwcfd_review_request_notice_dismissed');
75
- if($is_dismissed){
76
- return;
77
- }
78
-
79
- $is_skipped = get_transient('thwcfd_skip_review_request_notice');
80
- if($is_skipped){
81
- return;
82
- }
83
-
84
- $thwcfd_since = get_option('thwcfd_since');
85
- if(!$thwcfd_since){
86
- $now = time();
87
- update_option('thwcfd_since', $now, 'no');
88
- }else{
89
- $now = time();
90
- $diff_seconds = $now - $thwcfd_since;
91
-
92
- if($diff_seconds > apply_filters('thwcfd_show_review_request_notice_after', 10 * DAY_IN_SECONDS)){
93
- $this->render_review_request_notice();
94
- }
95
- }
96
- //If you find this plugin useful please show your support and rate it ★★★★★ on WordPress.org - much appreciated! :)
97
- }
98
-
99
- private function render_review_request_notice(){
100
- ?>
101
- <div id="thwcfd_review_request_notice" class="notice notice-info is-dismissible thpladmin-notice" data-nonce="<?php echo wp_create_nonce( 'thwcfd_review_request_notice'); ?>" data-action="dismiss_thwcfd_review_request_notice" style="display:none">
102
- <h3><?php _e('Just wanted to say thank you for using Checkout Field Editor plugin in your store.', 'woo-checkout-field-editor-pro'); ?></h3>
103
- <p><?php _e('We hope you had a great experience. Please leave us with your feedback to serve best to you and others. Cheers!', 'woo-checkout-field-editor-pro'); ?></p>
104
- <p class="action-row">
105
- <button type="button" class="button button-primary" onclick="window.open('https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews?rate=5#new-post', '_blank')"><?php _e('Review Now', 'woo-checkout-field-editor-pro'); ?></button>
106
- <button type="button" class="button" onclick="thwcfdHideReviewRequestNotice(this)"><?php _e('Remind Me Later', 'woo-checkout-field-editor-pro'); ?></button>
107
- <span class="logo"><a target="_blank" href="https://www.themehigh.com">
108
- <img src="<?php echo esc_url(THWCFD_ASSETS_URL_ADMIN .'css/logo.svg'); ?>" />
109
- </a></span>
110
-
111
- </p>
112
- </div>
113
- <?php
114
- }
115
-
116
  public function get_current_tab(){
117
  return isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : 'fields';
118
  }
@@ -120,7 +77,6 @@ class THWCFD_Admin {
120
  public function output_settings(){
121
  echo '<div class="wrap">';
122
  echo '<h2></h2>';
123
- $this->output_review_request_link();
124
 
125
  $tab = $this->get_current_tab();
126
 
@@ -142,22 +98,136 @@ class THWCFD_Admin {
142
  echo '</div>';
143
  }
144
 
145
- public function dismiss_thwcfd_review_request_notice(){
146
- $nonse = isset($_REQUEST['thwcfd_security_review_notice']) ? $_REQUEST['thwcfd_security_review_notice'] : false;
147
  $capability = THWCFD_Utils::wcfd_capability();
148
- if(!wp_verify_nonce($nonse, 'thwcfd_review_request_notice') || !current_user_can($capability)){
149
  die();
150
  }
151
- set_transient('thwcfd_review_request_notice_dismissed', true, apply_filters('thwcfd_dismissed_review_request_notice_lifespan', 1 * YEAR_IN_SECONDS));
152
  }
153
 
154
- public function skip_thwcfd_review_request_notice(){
155
- $nonse = isset($_REQUEST['thwcfd_security_review_notice']) ? $_REQUEST['thwcfd_security_review_notice'] : false;
156
  $capability = THWCFD_Utils::wcfd_capability();
157
- if(!wp_verify_nonce($nonse, 'thwcfd_review_request_notice') || !current_user_can($capability)){
158
  die();
159
  }
160
- set_transient('thwcfd_skip_review_request_notice', true, apply_filters('thwcfd_skip_review_request_notice_lifespan', 1 * DAY_IN_SECONDS));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  }
162
 
163
  }
70
  return $links;
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  public function get_current_tab(){
74
  return isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : 'fields';
75
  }
77
  public function output_settings(){
78
  echo '<div class="wrap">';
79
  echo '<h2></h2>';
 
80
 
81
  $tab = $this->get_current_tab();
82
 
98
  echo '</div>';
99
  }
100
 
101
+ public function hide_thwcfd_admin_notice(){
102
+ $nonse = isset($_REQUEST['thwcfd_notice_security']) ? $_REQUEST['thwcfd_notice_security'] : false;
103
  $capability = THWCFD_Utils::wcfd_capability();
104
+ if(!wp_verify_nonce($nonse, 'thwcfd_notice_security') || !current_user_can($capability)){
105
  die();
106
  }
107
+ set_transient('thwcfd_hide_admin_notice', true, apply_filters('thwcfd_hide_admin_notice_lifespan', 3 * MONTH_IN_SECONDS));
108
  }
109
 
110
+ public function skip_thwcfd_admin_notice(){
111
+ $nonse = isset($_REQUEST['thwcfd_notice_security']) ? $_REQUEST['thwcfd_notice_security'] : false;
112
  $capability = THWCFD_Utils::wcfd_capability();
113
+ if(!wp_verify_nonce($nonse, 'thwcfd_notice_security') || !current_user_can($capability)){
114
  die();
115
  }
116
+ set_transient('thwcfd_skip_admin_notice', true, apply_filters('thwcfd_skip_admin_notice_lifespan', 7 * DAY_IN_SECONDS));
117
+ }
118
+
119
+ public function dismissable_admin_notice(){
120
+
121
+ $thwcfd_since = get_option('thwcfd_since');
122
+ if(!$thwcfd_since){
123
+ $now = time();
124
+ update_option('thwcfd_since', $now, 'no');
125
+ }
126
+
127
+ if(!apply_filters('thwcfd_show_dismissable_admin_notice', true)){
128
+ return;
129
+ }
130
+
131
+ $is_hidden = get_transient('thwcfd_hide_admin_notice');
132
+ if($is_hidden){
133
+ return;
134
+ }
135
+
136
+ $is_skipped = get_transient('thwcfd_skip_admin_notice');
137
+ if($is_skipped){
138
+ return;
139
+ }
140
+
141
+ // $now = time();
142
+ // $diff_seconds = $now - $thwcfd_since;
143
+
144
+ // if($diff_seconds < apply_filters('thwcfd_show_admin_notice_after', 10 * DAY_IN_SECONDS)){
145
+ // return;
146
+ // }
147
+
148
+ ?>
149
+ <div class="notice notice-info thpladmin-notice is-dismissible" data-nonce="<?php echo wp_create_nonce( 'thwcfd_notice_security'); ?>">
150
+ <h3><?php _e('We heard you!', 'woo-checkout-field-editor-pro'); ?></h3>
151
+ <p><?php _e('The free version of Checkout Field Editor for WooCommerce plugin is now loaded with more field types and we would love to know how you feel about the improvements we made just for you. Help us to serve you and others best by simply leaving a genuine review.', 'woo-checkout-field-editor-pro'); ?></p>
152
+ <p class="action-row">
153
+ <a href="#" onclick="window.open('https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews?rate=5#new-post', '_blank')" style="margin-right:16px; text-decoration: none"><span class="dashicons dashicons-external"></span> <?php _e("Yes, today", 'woo-checkout-field-editor-pro'); ?></a>
154
+
155
+ <a href="#" onclick="thwcfdSkipAdminNotice(event, this)" style="margin-right:16px; text-decoration: none"><span class="dashicons dashicons-calendar-alt"></span> <?php _e('Maybe later', 'woo-checkout-field-editor-pro'); ?></a>
156
+
157
+ <a href="#" onclick="thwcfdHideAdminNotice(event, this)" style="margin-right:16px; text-decoration: none"><span class="dashicons dashicons-no"></span> <?php _e("Nah, Never", 'woo-checkout-field-editor-pro'); ?></a>
158
+
159
+ <span class="logo" style="float: right"><a target="_blank" href="https://www.themehigh.com">
160
+ <img src="<?php echo esc_url(THWCFD_ASSETS_URL_ADMIN .'css/logo.svg'); ?>" style="height:18px;margin-top:4px;"/>
161
+ </a></span>
162
+ </p>
163
+ </div>
164
+ <?php
165
+ }
166
+
167
+ function admin_notice_js_snippet(){
168
+ if(!apply_filters('thwcfd_dismissable_admin_notice_javascript', true)){
169
+ return;
170
+ }
171
+ ?>
172
+ <script>
173
+ var thwcfd_dismissable_notice = (function($, window, document) {
174
+ 'use strict';
175
+
176
+ $( document ).on( 'click', '.thpladmin-notice .notice-dismiss', function() {
177
+ var wrapper = $(this).closest('div.thpladmin-notice');
178
+ var nonce = wrapper.data("nonce");
179
+ var data = {
180
+ thwcfd_notice_security: nonce,
181
+ action: 'hide_thwcfd_admin_notice',
182
+ };
183
+ $.post( ajaxurl, data, function() {
184
+
185
+ });
186
+ });
187
+
188
+ function skip_admin_notice(e, elm){
189
+ e.preventDefault();
190
+ var wrapper = $(elm).closest('div.thpladmin-notice');
191
+ var nonce = wrapper.data("nonce");
192
+ var data = {
193
+ thwcfd_notice_security: nonce,
194
+ action: 'skip_thwcfd_admin_notice',
195
+ };
196
+ $.post( ajaxurl, data, function() {
197
+
198
+ });
199
+ $(wrapper).hide(20);
200
+ }
201
+
202
+ function hide_admin_notice(e, elm){
203
+ e.preventDefault();
204
+ var wrapper = $(elm).closest('div.thpladmin-notice');
205
+ var nonce = wrapper.data("nonce");
206
+ var data = {
207
+ thwcfd_notice_security: nonce,
208
+ action: 'hide_thwcfd_admin_notice',
209
+ };
210
+ $.post( ajaxurl, data, function() {
211
+
212
+ });
213
+ $(wrapper).hide(20);
214
+ }
215
+
216
+ return {
217
+ skipAdminNotice : skip_admin_notice,
218
+ hideAdminNotice : hide_admin_notice,
219
+ };
220
+ }(window.jQuery, window, document));
221
+
222
+ function thwcfdSkipAdminNotice(e, elm){
223
+ thwcfd_dismissable_notice.skipAdminNotice(e, elm);
224
+ }
225
+
226
+ function thwcfdHideAdminNotice(e, elm){
227
+ thwcfd_dismissable_notice.hideAdminNotice(e, elm);
228
+ }
229
+ </script>
230
+ <?php
231
  }
232
 
233
  }
checkout-form-designer.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: Checkout Field Editor for WooCommerce
4
  * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields).
5
  * Author: ThemeHigh
6
- * Version: 1.5.1
7
  * Author URI: https://www.themehigh.com
8
  * Plugin URI: https://www.themehigh.com
9
  * Text Domain: woo-checkout-field-editor-pro
10
  * Domain Path: /languages
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 5.9.0
13
  */
14
 
15
  if(!defined( 'ABSPATH' )) exit;
@@ -25,7 +25,7 @@ if (!function_exists('is_woocommerce_active')){
25
  }
26
 
27
  if(is_woocommerce_active()) {
28
- define('THWCFD_VERSION', '1.5.1');
29
  !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ ));
30
  !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ ));
31
  !defined('THWCFD_URL') && define('THWCFD_URL', plugins_url( '/', __FILE__ ));
3
  * Plugin Name: Checkout Field Editor for WooCommerce
4
  * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields).
5
  * Author: ThemeHigh
6
+ * Version: 1.5.2
7
  * Author URI: https://www.themehigh.com
8
  * Plugin URI: https://www.themehigh.com
9
  * Text Domain: woo-checkout-field-editor-pro
10
  * Domain Path: /languages
11
  * WC requires at least: 3.0.0
12
+ * WC tested up to: 6.0.0
13
  */
14
 
15
  if(!defined( 'ABSPATH' )) exit;
25
  }
26
 
27
  if(is_woocommerce_active()) {
28
+ define('THWCFD_VERSION', '1.5.2');
29
  !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ ));
30
  !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ ));
31
  !defined('THWCFD_URL') && define('THWCFD_URL', plugins_url( '/', __FILE__ ));
includes/class-thwcfd.php CHANGED
@@ -68,8 +68,11 @@ class THWCFD {
68
  add_filter('woocommerce_screen_ids', array($plugin_admin, 'add_screen_id'));
69
  add_filter('plugin_action_links_'.THWCFD_BASE_NAME, array($plugin_admin, 'plugin_action_links'));
70
  //add_filter('plugin_row_meta', array($plugin_admin, 'plugin_row_meta'), 10, 2);
71
- add_action('wp_ajax_dismiss_thwcfd_review_request_notice', array($plugin_admin, 'dismiss_thwcfd_review_request_notice'));
72
- add_action('wp_ajax_skip_thwcfd_review_request_notice', array($plugin_admin, 'skip_thwcfd_review_request_notice'));
 
 
 
73
 
74
  $themehigh_plugins = new THWCFD_Admin_Settings_Themehigh_Plugins();
75
  add_action('wp_ajax_th_activate_plugin', array($themehigh_plugins, 'activate_themehigh_plugins'));
68
  add_filter('woocommerce_screen_ids', array($plugin_admin, 'add_screen_id'));
69
  add_filter('plugin_action_links_'.THWCFD_BASE_NAME, array($plugin_admin, 'plugin_action_links'));
70
  //add_filter('plugin_row_meta', array($plugin_admin, 'plugin_row_meta'), 10, 2);
71
+ add_action('wp_ajax_hide_thwcfd_admin_notice', array($plugin_admin, 'hide_thwcfd_admin_notice'));
72
+ add_action('wp_ajax_skip_thwcfd_admin_notice', array($plugin_admin, 'skip_thwcfd_admin_notice'));
73
+
74
+ add_action('admin_notices', array($plugin_admin, 'dismissable_admin_notice'));
75
+ add_action('admin_footer', array($plugin_admin, 'admin_notice_js_snippet'), 9999);
76
 
77
  $themehigh_plugins = new THWCFD_Admin_Settings_Themehigh_Plugins();
78
  add_action('wp_ajax_th_activate_plugin', array($themehigh_plugins, 'activate_themehigh_plugins'));
includes/utils/class-thwcfd-utils.php CHANGED
@@ -245,6 +245,25 @@ class THWCFD_Utils {
245
  if(isset($options[$value]) && !empty($options[$value])){
246
  $value = $options[$value];
247
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  }
249
 
250
  return $value;
245
  if(isset($options[$value]) && !empty($options[$value])){
246
  $value = $options[$value];
247
  }
248
+ }elseif($type === 'checkboxgroup' || $type === 'multiselect'){
249
+ $options = isset($field['options']) ? $field['options'] : array();
250
+
251
+ $value_arr = explode(',', $value);
252
+ //THWCFD_Utils
253
+ if(is_array($value_arr)){
254
+ $new_value = array();
255
+ foreach($value_arr as $single_value){
256
+ if(isset($options[$single_value]) && !empty($options[$single_value])){
257
+ $new_value[] = $options[$single_value];
258
+ }else{
259
+ $new_value[] = $single_value;
260
+ }
261
+ }
262
+ $value = implode(', ', $new_value);
263
+ }elseif(isset($options[$value]) && !empty($options[$value])){
264
+ $value = $options[$value];
265
+ }
266
+
267
  }
268
 
269
  return $value;
languages/woo-checkout-field-editor-pro.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Checkout Field Editor for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Checkout Field Editor for WooCommerce 1.4.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-09-21T17:14:59+05:30\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: woo-checkout-field-editor-pro\n"
@@ -36,166 +36,191 @@ msgid "Text"
36
  msgstr ""
37
 
38
  #: admin/class-thwcfd-admin-form-field.php:41
39
- msgid "Password"
 
40
  msgstr ""
41
 
42
  #: admin/class-thwcfd-admin-form-field.php:42
43
- #: admin/class-thwcfd-admin-form-field.php:54
44
- msgid "Email"
45
  msgstr ""
46
 
47
  #: admin/class-thwcfd-admin-form-field.php:43
48
- #: admin/class-thwcfd-admin-form-field.php:55
49
- msgid "Phone"
50
  msgstr ""
51
 
52
  #: admin/class-thwcfd-admin-form-field.php:44
53
- msgid "Select"
 
54
  msgstr ""
55
 
56
  #: admin/class-thwcfd-admin-form-field.php:45
57
- msgid "Textarea"
 
58
  msgstr ""
59
 
60
  #: admin/class-thwcfd-admin-form-field.php:46
 
 
 
 
61
  msgid "Radio"
62
  msgstr ""
63
 
64
- #: admin/class-thwcfd-admin-form-field.php:56
65
- msgid "Postcode"
66
  msgstr ""
67
 
68
- #: admin/class-thwcfd-admin-form-field.php:57
69
- msgid "State"
70
  msgstr ""
71
 
72
- #: admin/class-thwcfd-admin-form-field.php:58
73
- msgid "Number"
 
 
 
 
 
 
 
 
74
  msgstr ""
75
 
76
  #: admin/class-thwcfd-admin-form-field.php:62
77
- msgid "Full width"
78
  msgstr ""
79
 
80
  #: admin/class-thwcfd-admin-form-field.php:63
 
 
 
 
 
 
 
 
81
  msgid "Half width left"
82
  msgstr ""
83
 
84
- #: admin/class-thwcfd-admin-form-field.php:64
85
  msgid "Half width right"
86
  msgstr ""
87
 
88
- #: admin/class-thwcfd-admin-form-field.php:68
89
- #: admin/class-thwcfd-admin-settings-general.php:88
90
  msgid "Type"
91
  msgstr ""
92
 
93
- #: admin/class-thwcfd-admin-form-field.php:70
94
- #: admin/class-thwcfd-admin-settings-general.php:87
95
  msgid "Name"
96
  msgstr ""
97
 
98
- #: admin/class-thwcfd-admin-form-field.php:71
99
- #: admin/class-thwcfd-admin-settings-general.php:89
100
  msgid "Label"
101
  msgstr ""
102
 
103
- #: admin/class-thwcfd-admin-form-field.php:72
104
  msgid "Default Value"
105
  msgstr ""
106
 
107
- #: admin/class-thwcfd-admin-form-field.php:73
108
- #: admin/class-thwcfd-admin-settings-general.php:90
109
  msgid "Placeholder"
110
  msgstr ""
111
 
112
- #: admin/class-thwcfd-admin-form-field.php:75
113
  msgid "Class"
114
  msgstr ""
115
 
116
- #: admin/class-thwcfd-admin-form-field.php:75
117
  msgid "Separate classes with comma"
118
  msgstr ""
119
 
120
- #: admin/class-thwcfd-admin-form-field.php:76
121
  msgid "Validation"
122
  msgstr ""
123
 
124
- #: admin/class-thwcfd-admin-form-field.php:76
125
  msgid "Select validations"
126
  msgstr ""
127
 
128
- #: admin/class-thwcfd-admin-form-field.php:79
129
- #: admin/class-thwcfd-admin-settings-general.php:92
130
  msgid "Required"
131
  msgstr ""
132
 
133
- #: admin/class-thwcfd-admin-form-field.php:81
134
- #: admin/class-thwcfd-admin-settings-general.php:93
 
 
 
 
135
  msgid "Enabled"
136
  msgstr ""
137
 
138
- #: admin/class-thwcfd-admin-form-field.php:83
139
  msgid "Display in Emails"
140
  msgstr ""
141
 
142
- #: admin/class-thwcfd-admin-form-field.php:84
143
  msgid "Display in Order Detail Pages"
144
  msgstr ""
145
 
146
- #: admin/class-thwcfd-admin-form-field.php:125
147
  msgid "Save Field"
148
  msgstr ""
149
 
150
- #: admin/class-thwcfd-admin-form-field.php:128
151
  msgid "Basic Info"
152
  msgstr ""
153
 
154
- #: admin/class-thwcfd-admin-form-field.php:160
155
  msgid "Save & Close"
156
  msgstr ""
157
 
158
- #: admin/class-thwcfd-admin-form-field.php:163
159
  msgid "Next"
160
  msgstr ""
161
 
162
- #: admin/class-thwcfd-admin-form-field.php:166
163
  msgid "Back"
164
  msgstr ""
165
 
166
- #: admin/class-thwcfd-admin-form-field.php:180
167
  msgid "Basic Details"
168
  msgstr ""
169
 
170
- #: admin/class-thwcfd-admin-form-field.php:194
171
  msgid "Display Settings"
172
  msgstr ""
173
 
174
- #: admin/class-thwcfd-admin-form-field.php:400
175
  msgid "Options"
176
  msgstr ""
177
 
178
- #: admin/class-thwcfd-admin-form-field.php:408
179
- #: admin/assets/js/inc/thwcfd-admin-field.js:389
180
- #: admin/assets/js/thwcfd-admin.js:789
181
  msgid "Option Value"
182
  msgstr ""
183
 
184
- #: admin/class-thwcfd-admin-form-field.php:409
185
- #: admin/assets/js/inc/thwcfd-admin-field.js:390
186
- #: admin/assets/js/thwcfd-admin.js:790
187
  msgid "Option Text"
188
  msgstr ""
189
 
190
- #: admin/class-thwcfd-admin-form-field.php:411
191
- #: admin/assets/js/inc/thwcfd-admin-field.js:392
192
- #: admin/assets/js/thwcfd-admin.js:792
193
  msgid "Add new option"
194
  msgstr ""
195
 
196
- #: admin/class-thwcfd-admin-form-field.php:411
197
- #: admin/assets/js/inc/thwcfd-admin-field.js:393
198
- #: admin/assets/js/thwcfd-admin.js:793
199
  msgid "Remove option"
200
  msgstr ""
201
 
@@ -224,14 +249,14 @@ msgid "Settings successfully reset."
224
  msgstr ""
225
 
226
  #: admin/class-thwcfd-admin-settings-advanced.php:127
227
- #: admin/class-thwcfd-admin-settings-general.php:252
228
- #: admin/class-thwcfd-admin-settings-general.php:312
229
  msgid "Your changes were saved."
230
  msgstr ""
231
 
232
  #: admin/class-thwcfd-admin-settings-advanced.php:129
233
- #: admin/class-thwcfd-admin-settings-general.php:254
234
- #: admin/class-thwcfd-admin-settings-general.php:314
235
  msgid "Your changes were not saved due to an error (or you made none!)."
236
  msgstr ""
237
 
@@ -254,68 +279,81 @@ msgstr ""
254
  msgid "Premium Features"
255
  msgstr ""
256
 
257
- #: admin/class-thwcfd-admin-settings-general.php:36
258
- msgid "Billing Fields"
 
259
  msgstr ""
260
 
261
  #: admin/class-thwcfd-admin-settings-general.php:37
262
- msgid "Shipping Fields"
263
  msgstr ""
264
 
265
  #: admin/class-thwcfd-admin-settings-general.php:38
 
 
 
 
266
  msgid "Additional Fields"
267
  msgstr ""
268
 
269
- #: admin/class-thwcfd-admin-settings-general.php:74
270
  msgid "Checkout fields successfully reset"
271
  msgstr ""
272
 
273
- #: admin/class-thwcfd-admin-settings-general.php:91
274
  msgid "Validations"
275
  msgstr ""
276
 
277
- #: admin/class-thwcfd-admin-settings-general.php:94
278
- #: admin/class-thwcfd-admin-settings-general.php:190
279
  msgid "Edit"
280
  msgstr ""
281
 
282
- #: admin/class-thwcfd-admin-settings-general.php:101
283
  msgid "Add field"
284
  msgstr ""
285
 
286
- #: admin/class-thwcfd-admin-settings-general.php:102
287
  msgid "Remove"
288
  msgstr ""
289
 
290
- #: admin/class-thwcfd-admin-settings-general.php:103
291
  msgid "Enable"
292
  msgstr ""
293
 
294
- #: admin/class-thwcfd-admin-settings-general.php:104
295
  msgid "Disable"
296
  msgstr ""
297
 
298
- #: admin/class-thwcfd-admin-settings-general.php:107
299
  msgid "Save changes"
300
  msgstr ""
301
 
302
- #: admin/class-thwcfd-admin-settings-general.php:108
303
  msgid "Reset to default fields"
304
  msgstr ""
305
 
306
- #: admin/class-thwcfd-admin-settings-general.php:109
307
  msgid "Are you sure you want to reset to default fields? all your changes will be deleted."
308
  msgstr ""
309
 
310
- #: admin/class-thwcfd-admin-settings-general.php:257
311
- #: admin/class-thwcfd-admin-settings-general.php:317
312
  msgid "Your changes were not saved due to an error."
313
  msgstr ""
314
 
315
- #: admin/class-thwcfd-admin-settings-general.php:272
316
  msgid "Your changes were not saved due to no fields found."
317
  msgstr ""
318
 
 
 
 
 
 
 
 
 
319
  #: admin/class-thwcfd-admin.php:55
320
  msgid "WooCommerce Checkout Field Editor"
321
  msgstr ""
@@ -352,31 +390,41 @@ msgstr ""
352
  msgid "Remind Me Later"
353
  msgstr ""
354
 
355
- #: public/class-thwcfd-public-checkout.php:355
356
  msgid "<strong>%s</strong> is not a valid number."
357
  msgstr ""
358
 
359
  #: admin/assets/js/inc/thwcfd-admin-field.js:10
360
- #: admin/assets/js/thwcfd-admin.js:410
361
  msgid "NAME/ID must begin with a lowercase letter ([a-z]) or underscores (\"_\") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores (\"_\")"
362
  msgstr ""
363
 
364
- #: admin/assets/js/inc/thwcfd-admin-field.js:59
365
- #: admin/assets/js/thwcfd-admin.js:459
366
  msgid "Edit Field"
367
  msgstr ""
368
 
369
- #: admin/assets/js/inc/thwcfd-admin-field.js:59
370
- #: admin/assets/js/thwcfd-admin.js:459
371
  msgid "New Field"
372
  msgstr ""
373
 
374
- #: admin/assets/js/inc/thwcfd-admin-field.js:310
375
- #: admin/assets/js/thwcfd-admin.js:710
376
- msgid "Enter a value given in the options."
 
 
 
 
 
 
 
 
 
 
377
  msgstr ""
378
 
379
  #: admin/assets/js/inc/thwcfd-admin.js:74
380
- #: admin/assets/js/thwcfd-admin.js:935
381
  msgid "Yes"
382
  msgstr ""
2
  # This file is distributed under the same license as the Checkout Field Editor for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Checkout Field Editor for WooCommerce 1.5.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-12-17T19:23:44+05:30\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: woo-checkout-field-editor-pro\n"
36
  msgstr ""
37
 
38
  #: admin/class-thwcfd-admin-form-field.php:41
39
+ #: admin/class-thwcfd-admin-form-field.php:64
40
+ msgid "Number"
41
  msgstr ""
42
 
43
  #: admin/class-thwcfd-admin-form-field.php:42
44
+ msgid "Hidden"
 
45
  msgstr ""
46
 
47
  #: admin/class-thwcfd-admin-form-field.php:43
48
+ msgid "Password"
 
49
  msgstr ""
50
 
51
  #: admin/class-thwcfd-admin-form-field.php:44
52
+ #: admin/class-thwcfd-admin-form-field.php:60
53
+ msgid "Email"
54
  msgstr ""
55
 
56
  #: admin/class-thwcfd-admin-form-field.php:45
57
+ #: admin/class-thwcfd-admin-form-field.php:61
58
+ msgid "Phone"
59
  msgstr ""
60
 
61
  #: admin/class-thwcfd-admin-form-field.php:46
62
+ msgid "Textarea"
63
+ msgstr ""
64
+
65
+ #: admin/class-thwcfd-admin-form-field.php:47
66
  msgid "Radio"
67
  msgstr ""
68
 
69
+ #: admin/class-thwcfd-admin-form-field.php:48
70
+ msgid "Select"
71
  msgstr ""
72
 
73
+ #: admin/class-thwcfd-admin-form-field.php:49
74
+ msgid "Multiselect"
75
  msgstr ""
76
 
77
+ #: admin/class-thwcfd-admin-form-field.php:50
78
+ msgid "Checkbox"
79
+ msgstr ""
80
+
81
+ #: admin/class-thwcfd-admin-form-field.php:51
82
+ msgid "Checkbox Group"
83
+ msgstr ""
84
+
85
+ #: admin/class-thwcfd-admin-form-field.php:52
86
+ msgid "Heading"
87
  msgstr ""
88
 
89
  #: admin/class-thwcfd-admin-form-field.php:62
90
+ msgid "Postcode"
91
  msgstr ""
92
 
93
  #: admin/class-thwcfd-admin-form-field.php:63
94
+ msgid "State"
95
+ msgstr ""
96
+
97
+ #: admin/class-thwcfd-admin-form-field.php:68
98
+ msgid "Full width"
99
+ msgstr ""
100
+
101
+ #: admin/class-thwcfd-admin-form-field.php:69
102
  msgid "Half width left"
103
  msgstr ""
104
 
105
+ #: admin/class-thwcfd-admin-form-field.php:70
106
  msgid "Half width right"
107
  msgstr ""
108
 
109
+ #: admin/class-thwcfd-admin-form-field.php:83
110
+ #: admin/class-thwcfd-admin-settings-general.php:89
111
  msgid "Type"
112
  msgstr ""
113
 
114
+ #: admin/class-thwcfd-admin-form-field.php:85
115
+ #: admin/class-thwcfd-admin-settings-general.php:88
116
  msgid "Name"
117
  msgstr ""
118
 
119
+ #: admin/class-thwcfd-admin-form-field.php:86
120
+ #: admin/class-thwcfd-admin-settings-general.php:90
121
  msgid "Label"
122
  msgstr ""
123
 
124
+ #: admin/class-thwcfd-admin-form-field.php:87
125
  msgid "Default Value"
126
  msgstr ""
127
 
128
+ #: admin/class-thwcfd-admin-form-field.php:88
129
+ #: admin/class-thwcfd-admin-settings-general.php:91
130
  msgid "Placeholder"
131
  msgstr ""
132
 
133
+ #: admin/class-thwcfd-admin-form-field.php:90
134
  msgid "Class"
135
  msgstr ""
136
 
137
+ #: admin/class-thwcfd-admin-form-field.php:90
138
  msgid "Separate classes with comma"
139
  msgstr ""
140
 
141
+ #: admin/class-thwcfd-admin-form-field.php:91
142
  msgid "Validation"
143
  msgstr ""
144
 
145
+ #: admin/class-thwcfd-admin-form-field.php:91
146
  msgid "Select validations"
147
  msgstr ""
148
 
149
+ #: admin/class-thwcfd-admin-form-field.php:96
150
+ #: admin/class-thwcfd-admin-settings-general.php:93
151
  msgid "Required"
152
  msgstr ""
153
 
154
+ #: admin/class-thwcfd-admin-form-field.php:97
155
+ msgid " Checked by default"
156
+ msgstr ""
157
+
158
+ #: admin/class-thwcfd-admin-form-field.php:99
159
+ #: admin/class-thwcfd-admin-settings-general.php:94
160
  msgid "Enabled"
161
  msgstr ""
162
 
163
+ #: admin/class-thwcfd-admin-form-field.php:101
164
  msgid "Display in Emails"
165
  msgstr ""
166
 
167
+ #: admin/class-thwcfd-admin-form-field.php:102
168
  msgid "Display in Order Detail Pages"
169
  msgstr ""
170
 
171
+ #: admin/class-thwcfd-admin-form-field.php:143
172
  msgid "Save Field"
173
  msgstr ""
174
 
175
+ #: admin/class-thwcfd-admin-form-field.php:146
176
  msgid "Basic Info"
177
  msgstr ""
178
 
179
+ #: admin/class-thwcfd-admin-form-field.php:178
180
  msgid "Save & Close"
181
  msgstr ""
182
 
183
+ #: admin/class-thwcfd-admin-form-field.php:181
184
  msgid "Next"
185
  msgstr ""
186
 
187
+ #: admin/class-thwcfd-admin-form-field.php:184
188
  msgid "Back"
189
  msgstr ""
190
 
191
+ #: admin/class-thwcfd-admin-form-field.php:198
192
  msgid "Basic Details"
193
  msgstr ""
194
 
195
+ #: admin/class-thwcfd-admin-form-field.php:212
196
  msgid "Display Settings"
197
  msgstr ""
198
 
199
+ #: admin/class-thwcfd-admin-form-field.php:530
200
  msgid "Options"
201
  msgstr ""
202
 
203
+ #: admin/class-thwcfd-admin-form-field.php:538
204
+ #: admin/assets/js/inc/thwcfd-admin-field.js:409
205
+ #: admin/assets/js/thwcfd-admin.js:924
206
  msgid "Option Value"
207
  msgstr ""
208
 
209
+ #: admin/class-thwcfd-admin-form-field.php:539
210
+ #: admin/assets/js/inc/thwcfd-admin-field.js:410
211
+ #: admin/assets/js/thwcfd-admin.js:925
212
  msgid "Option Text"
213
  msgstr ""
214
 
215
+ #: admin/class-thwcfd-admin-form-field.php:541
216
+ #: admin/assets/js/inc/thwcfd-admin-field.js:412
217
+ #: admin/assets/js/thwcfd-admin.js:927
218
  msgid "Add new option"
219
  msgstr ""
220
 
221
+ #: admin/class-thwcfd-admin-form-field.php:541
222
+ #: admin/assets/js/inc/thwcfd-admin-field.js:413
223
+ #: admin/assets/js/thwcfd-admin.js:928
224
  msgid "Remove option"
225
  msgstr ""
226
 
249
  msgstr ""
250
 
251
  #: admin/class-thwcfd-admin-settings-advanced.php:127
252
+ #: admin/class-thwcfd-admin-settings-general.php:254
253
+ #: admin/class-thwcfd-admin-settings-general.php:314
254
  msgid "Your changes were saved."
255
  msgstr ""
256
 
257
  #: admin/class-thwcfd-admin-settings-advanced.php:129
258
+ #: admin/class-thwcfd-admin-settings-general.php:256
259
+ #: admin/class-thwcfd-admin-settings-general.php:316
260
  msgid "Your changes were not saved due to an error (or you made none!)."
261
  msgstr ""
262
 
279
  msgid "Premium Features"
280
  msgstr ""
281
 
282
+ #: admin/class-thwcfd-admin-settings-general.php:34
283
+ #: admin/class-thwcfd-admin-settings.php:27
284
+ msgid "Other Free Plugins"
285
  msgstr ""
286
 
287
  #: admin/class-thwcfd-admin-settings-general.php:37
288
+ msgid "Billing Fields"
289
  msgstr ""
290
 
291
  #: admin/class-thwcfd-admin-settings-general.php:38
292
+ msgid "Shipping Fields"
293
+ msgstr ""
294
+
295
+ #: admin/class-thwcfd-admin-settings-general.php:39
296
  msgid "Additional Fields"
297
  msgstr ""
298
 
299
+ #: admin/class-thwcfd-admin-settings-general.php:75
300
  msgid "Checkout fields successfully reset"
301
  msgstr ""
302
 
303
+ #: admin/class-thwcfd-admin-settings-general.php:92
304
  msgid "Validations"
305
  msgstr ""
306
 
307
+ #: admin/class-thwcfd-admin-settings-general.php:95
308
+ #: admin/class-thwcfd-admin-settings-general.php:191
309
  msgid "Edit"
310
  msgstr ""
311
 
312
+ #: admin/class-thwcfd-admin-settings-general.php:102
313
  msgid "Add field"
314
  msgstr ""
315
 
316
+ #: admin/class-thwcfd-admin-settings-general.php:103
317
  msgid "Remove"
318
  msgstr ""
319
 
320
+ #: admin/class-thwcfd-admin-settings-general.php:104
321
  msgid "Enable"
322
  msgstr ""
323
 
324
+ #: admin/class-thwcfd-admin-settings-general.php:105
325
  msgid "Disable"
326
  msgstr ""
327
 
328
+ #: admin/class-thwcfd-admin-settings-general.php:108
329
  msgid "Save changes"
330
  msgstr ""
331
 
332
+ #: admin/class-thwcfd-admin-settings-general.php:109
333
  msgid "Reset to default fields"
334
  msgstr ""
335
 
336
+ #: admin/class-thwcfd-admin-settings-general.php:110
337
  msgid "Are you sure you want to reset to default fields? all your changes will be deleted."
338
  msgstr ""
339
 
340
+ #: admin/class-thwcfd-admin-settings-general.php:259
341
+ #: admin/class-thwcfd-admin-settings-general.php:319
342
  msgid "Your changes were not saved due to an error."
343
  msgstr ""
344
 
345
+ #: admin/class-thwcfd-admin-settings-general.php:274
346
  msgid "Your changes were not saved due to no fields found."
347
  msgstr ""
348
 
349
+ #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:138
350
+ msgid "Compatible Plugins"
351
+ msgstr ""
352
+
353
+ #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:176
354
+ msgid "Other Plugins"
355
+ msgstr ""
356
+
357
  #: admin/class-thwcfd-admin.php:55
358
  msgid "WooCommerce Checkout Field Editor"
359
  msgstr ""
390
  msgid "Remind Me Later"
391
  msgstr ""
392
 
393
+ #: public/class-thwcfd-public-checkout.php:361
394
  msgid "<strong>%s</strong> is not a valid number."
395
  msgstr ""
396
 
397
  #: admin/assets/js/inc/thwcfd-admin-field.js:10
398
+ #: admin/assets/js/thwcfd-admin.js:525
399
  msgid "NAME/ID must begin with a lowercase letter ([a-z]) or underscores (\"_\") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores (\"_\")"
400
  msgstr ""
401
 
402
+ #: admin/assets/js/inc/thwcfd-admin-field.js:63
403
+ #: admin/assets/js/thwcfd-admin.js:578
404
  msgid "Edit Field"
405
  msgstr ""
406
 
407
+ #: admin/assets/js/inc/thwcfd-admin-field.js:63
408
+ #: admin/assets/js/thwcfd-admin.js:578
409
  msgid "New Field"
410
  msgstr ""
411
 
412
+ #: admin/assets/js/inc/thwcfd-admin-field.js:315
413
+ #: admin/assets/js/thwcfd-admin.js:830
414
+ msgid "Enter default value given in the options."
415
+ msgstr ""
416
+
417
+ #: admin/assets/js/inc/thwcfd-admin-field.js:322
418
+ #: admin/assets/js/thwcfd-admin.js:837
419
+ msgid "Enter default values given in the options."
420
+ msgstr ""
421
+
422
+ #: admin/assets/js/inc/thwcfd-admin-field.js:329
423
+ #: admin/assets/js/thwcfd-admin.js:844
424
+ msgid "Default value must be a number."
425
  msgstr ""
426
 
427
  #: admin/assets/js/inc/thwcfd-admin.js:74
428
+ #: admin/assets/js/thwcfd-admin.js:1070
429
  msgid "Yes"
430
  msgstr ""
public/class-thwcfd-public-checkout.php CHANGED
@@ -56,6 +56,12 @@ class THWCFD_Public_Checkout {
56
 
57
  add_filter('woocommerce_email_order_meta_fields', array($this, 'display_custom_fields_in_emails'), 10, 3);
58
  add_action('woocommerce_order_details_after_order_table', array($this, 'order_details_after_customer_details'), 20, 1);
 
 
 
 
 
 
59
  }
60
 
61
  /**
@@ -292,22 +298,22 @@ class THWCFD_Public_Checkout {
292
  $options_arr = THWCFD_Utils::prepare_field_options($new_field['options']);
293
  $options = array();
294
  foreach($options_arr as $key => $value) {
295
- $options[$key] = THWCFD_Utils::t($value);
296
  }
297
  $new_field['options'] = $options;
298
  }
299
  }
300
 
301
- if($type === 'select' && apply_filters('thwcfd_enable_select2_for_select_fields', true)){
302
  $new_field['input_class'][] = 'thwcfd-enhanced-select';
303
  }
304
 
305
  if(isset($new_field['label'])){
306
- $new_field['label'] = THWCFD_Utils::t($new_field['label']);
307
  }
308
 
309
  if(isset($new_field['placeholder'])){
310
- $new_field['placeholder'] = THWCFD_Utils::t($new_field['placeholder']);
311
  }
312
 
313
  $fields[$name] = $new_field;
@@ -389,7 +395,7 @@ class THWCFD_Public_Checkout {
389
 
390
  foreach($fields as $name => $field){
391
  if(THWCFD_Utils::is_active_custom_field($field) && isset($posted[$name]) && !THWCFD_Utils::is_wc_handle_custom_field($field)){
392
-
393
  $type = isset($field['type']) ? $field['type'] : 'text';
394
 
395
  if($type == 'textarea'){
@@ -400,12 +406,29 @@ class THWCFD_Public_Checkout {
400
  $options = isset($field['options']) ? $field['options'] : array();
401
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
402
  $value = array_key_exists($value, $options) ? $value : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  }else{
404
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
405
  }
406
 
407
  if($value){
408
- update_post_meta($order_id, $name, $value);
409
  }
410
  }
411
  }
@@ -467,17 +490,14 @@ class THWCFD_Public_Checkout {
467
  public function order_details_after_customer_details($order){
468
  $order_id = THWCFD_Utils::get_order_id($order);
469
  $fields = THWCFD_Utils::get_checkout_fields($order);
470
-
471
  if(is_array($fields) && !empty($fields)){
472
  $fields_html = '';
473
  // Loop through all custom fields to see if it should be added
474
- foreach($fields as $key => $field){
475
  if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
476
  $value = get_post_meta( $order_id, $key, true );
477
-
478
  if($value){
479
  $label = isset($field['label']) && $field['label'] ? $field['label'] : $key;
480
-
481
  //$label = esc_attr($label);
482
  $label = wp_kses_post(__($label, 'woo-checkout-field-editor-pro'));
483
  //$value = wptexturize($value);
@@ -522,6 +542,157 @@ class THWCFD_Public_Checkout {
522
  /*****************************************
523
  ----- Display Field Values - END --------
524
  *****************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  }
526
 
527
  endif;
56
 
57
  add_filter('woocommerce_email_order_meta_fields', array($this, 'display_custom_fields_in_emails'), 10, 3);
58
  add_action('woocommerce_order_details_after_order_table', array($this, 'order_details_after_customer_details'), 20, 1);
59
+
60
+ add_filter('woocommerce_form_field_checkboxgroup', array($this, 'woo_form_field'), 10, 4);
61
+ add_filter('woocommerce_form_field_multiselect', array($this, 'woo_form_field'), 10, 4);
62
+ add_filter('woocommerce_form_field_hidden', array($this, 'woo_form_field_hidden'), 10, 4);
63
+ add_filter('woocommerce_form_field_heading', array($this, 'woo_form_field_heading'), 10, 4);
64
+
65
  }
66
 
67
  /**
298
  $options_arr = THWCFD_Utils::prepare_field_options($new_field['options']);
299
  $options = array();
300
  foreach($options_arr as $key => $value) {
301
+ $options[$key] = __($value, 'woo-checkout-field-editor-pro');
302
  }
303
  $new_field['options'] = $options;
304
  }
305
  }
306
 
307
+ if(($type === 'select' || $type === 'multiselect') && apply_filters('thwcfd_enable_select2_for_select_fields', true)){
308
  $new_field['input_class'][] = 'thwcfd-enhanced-select';
309
  }
310
 
311
  if(isset($new_field['label'])){
312
+ $new_field['label'] = __($new_field['label'], 'woo-checkout-field-editor-pro');
313
  }
314
 
315
  if(isset($new_field['placeholder'])){
316
+ $new_field['placeholder'] = __($new_field['placeholder'], 'woo-checkout-field-editor-pro');
317
  }
318
 
319
  $fields[$name] = $new_field;
395
 
396
  foreach($fields as $name => $field){
397
  if(THWCFD_Utils::is_active_custom_field($field) && isset($posted[$name]) && !THWCFD_Utils::is_wc_handle_custom_field($field)){
398
+ $value = null;
399
  $type = isset($field['type']) ? $field['type'] : 'text';
400
 
401
  if($type == 'textarea'){
406
  $options = isset($field['options']) ? $field['options'] : array();
407
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
408
  $value = array_key_exists($value, $options) ? $value : '';
409
+ }else if($type == 'checkboxgroup' || $type == 'multiselect'){
410
+ $options = isset($field['options']) ? $field['options'] : array();
411
+ $submitted_options = isset($posted[$name]) ? $posted[$name] : array();
412
+ if(! is_array($submitted_options)){
413
+ $submitted_options = explode(", ", $submitted_options);
414
+ }
415
+ $options_key = array_keys($options);
416
+ if(!empty($submitted_options)){
417
+ foreach($submitted_options as $key => $single_option){
418
+ if(!in_array ($single_option, $options_key)){
419
+ unset ($submitted_options[$key]);
420
+ }
421
+ }
422
+ }
423
+ if(!empty($submitted_options)){
424
+ $value = implode(",", $submitted_options);
425
+ }
426
  }else{
427
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
428
  }
429
 
430
  if($value){
431
+ $result = update_post_meta($order_id, $name, $value);
432
  }
433
  }
434
  }
490
  public function order_details_after_customer_details($order){
491
  $order_id = THWCFD_Utils::get_order_id($order);
492
  $fields = THWCFD_Utils::get_checkout_fields($order);
 
493
  if(is_array($fields) && !empty($fields)){
494
  $fields_html = '';
495
  // Loop through all custom fields to see if it should be added
496
+ foreach($fields as $key => $field){
497
  if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
498
  $value = get_post_meta( $order_id, $key, true );
 
499
  if($value){
500
  $label = isset($field['label']) && $field['label'] ? $field['label'] : $key;
 
501
  //$label = esc_attr($label);
502
  $label = wp_kses_post(__($label, 'woo-checkout-field-editor-pro'));
503
  //$value = wptexturize($value);
542
  /*****************************************
543
  ----- Display Field Values - END --------
544
  *****************************************/
545
+
546
+
547
+ public function woo_form_field($field, $key, $args, $value = null){
548
+
549
+ $field = '';
550
+
551
+ if ( $args['required'] ) {
552
+ $args['class'][] = 'validate-required';
553
+ $required = '&nbsp;<abbr class="required" title="' . esc_attr__( 'required', 'woocommerce' ) . '">*</abbr>';
554
+ } else {
555
+ $required = '&nbsp;<span class="optional">(' . esc_html__( 'optional', 'woocommerce' ) . ')</span>';
556
+ }
557
+
558
+ if (is_string($args['label_class'])) {
559
+ $args['label_class'] = array($args['label_class']);
560
+ }
561
+
562
+ if(is_null($value)){
563
+ $value = $args['default'];
564
+ }
565
+
566
+ // Custom attribute handling.
567
+ $custom_attributes = array();
568
+ $args['custom_attributes'] = array_filter((array) $args['custom_attributes'], 'strlen');
569
+
570
+ if ($args['maxlength']) {
571
+ $args['custom_attributes']['maxlength'] = absint($args['maxlength']);
572
+ }
573
+
574
+ if (!empty($args['autocomplete'])) {
575
+ $args['custom_attributes']['autocomplete'] = $args['autocomplete'];
576
+ }
577
+
578
+ if (true === $args['autofocus']) {
579
+ $args['custom_attributes']['autofocus'] = 'autofocus';
580
+ }
581
+
582
+ if ($args['description']) {
583
+ $args['custom_attributes']['aria-describedby'] = $args['id'] . '-description';
584
+ }
585
+
586
+ if (!empty($args['custom_attributes']) && is_array($args['custom_attributes'])) {
587
+ foreach ($args['custom_attributes'] as $attribute => $attribute_value) {
588
+ $custom_attributes[] = esc_attr($attribute) . '="' . esc_attr($attribute_value) . '"';
589
+ }
590
+ }
591
+
592
+ if (!empty($args['validate'])) {
593
+ foreach ($args['validate'] as $validate) {
594
+ $args['class'][] = 'validate-' . $validate;
595
+ }
596
+ }
597
+
598
+ //$field = '';
599
+ $label_id = $args['id'];
600
+ $sort = $args['priority'] ? $args['priority'] : '';
601
+ $field_container = '<p class="form-row %1$s" id="%2$s" data-priority="' . esc_attr($sort) . '">%3$s</p>';
602
+ switch ($args['type']) {
603
+
604
+ case 'multiselect':
605
+
606
+ $field = '';
607
+
608
+ $value = is_array($value) ? $value : array_map('trim', (array) explode(',', $value));
609
+
610
+ if (!empty($args['options'])) {
611
+ $field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . esc_attr(implode(' ', $custom_attributes)) . ' data-placeholder="' . esc_html__($args['placeholder'], 'woo-checkout-field-editor-pro') . '" >';
612
+ foreach ($args['options'] as $option_key => $option_text) {
613
+ $field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_key, $value), 1, false) . '>' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</option>';
614
+ }
615
+ $field .= ' </select>';
616
+ }
617
+
618
+ break;
619
+
620
+ case 'checkboxgroup':
621
+
622
+ $field = '';
623
+
624
+ $value = is_array($value) ? $value : array_map('trim', (array) explode(',', $value));
625
+
626
+ if (!empty($args['options'])) {
627
+
628
+ $field .= ' <span class="woocommerce-multicheckbox-wrapper" ' . esc_attr(implode(' ', $custom_attributes)) . '>';
629
+
630
+ foreach ($args['options'] as $option_key => $option_text) {
631
+ $field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_key, $value), 1, false) . ' /> ' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</label>';
632
+ }
633
+
634
+ $field .= '</span>';
635
+ }
636
+
637
+ break;
638
+
639
+ case 'file':
640
+
641
+ $field = '';
642
+
643
+ break;
644
+ }
645
+
646
+ if (!empty($field)) {
647
+ $field_html = '';
648
+
649
+ if ($args['label'] && 'checkbox' !== $args['type']) {
650
+ $field_html .= '<label for="' . esc_attr($label_id) . '" class="' . esc_attr(implode(' ', $args['label_class'])) . '">' . esc_html__($args['label'], 'woo-checkout-field-editor-pro') . $required . '</label>';
651
+ }
652
+
653
+ $field_html .= '<span class="woocommerce-input-wrapper">' . $field;
654
+
655
+ if ($args['description']) {
656
+ $field_html .= '<span class="description" id="' . esc_attr($args['id']) . '-description" aria-hidden="true">' . wp_kses_post($args['description']) . '</span>';
657
+ }
658
+
659
+ $field_html .= '</span>';
660
+
661
+ $container_class = esc_attr(implode(' ', $args['class']));
662
+ $container_id = esc_attr($args['id']) . '_field';
663
+ $field = sprintf($field_container, $container_class, $container_id, $field_html);
664
+ }
665
+
666
+ return $field;
667
+ }
668
+
669
+ public function woo_form_field_hidden($field, $key, $args, $value){
670
+ if(is_null($value) || (is_string($value) && $value === '')){
671
+ $value = $args['default'];
672
+ }
673
+
674
+ $field = '<input type="hidden" id="'. esc_attr($key) .'" name="'. esc_attr($key) .'" value="'. esc_attr( $value ) .'" class="'.esc_attr(implode(' ', $args['class'])).'" />';
675
+ return $field;
676
+ }
677
+
678
+ public function woo_form_field_heading($field, $key, $args, $value = null){
679
+ $args['class'][] = 'thwcfd-field-wrapper thwcfd-field-heading';
680
+
681
+ $heading_html = '';
682
+ $field = '';
683
+
684
+ if(isset($args['label']) && !empty($args['label'])){
685
+ $title_type = isset($args['title_type']) && !empty($args['title_type']) ? $args['title_type'] : 'label';
686
+
687
+ $heading_html .= '<'. esc_attr($title_type) .' class="'. esc_attr(implode(' ', $args['label_class'])) .'" >'. esc_html__($args['label'], 'woo-checkout-field-editor-pro') .'</'. $title_type .'>';
688
+ }
689
+
690
+ if(!empty($heading_html)){
691
+ $field .= '<div class="form-row '.esc_attr(implode(' ', $args['class'])).'" id="'.esc_attr($key).'_field" data-name="'.esc_attr($key).'" >'. $heading_html .'</div>';
692
+ }
693
+ return $field;
694
+ }
695
+
696
  }
697
 
698
  endif;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 1.5.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -14,7 +14,7 @@ Checkout Field Editor (Checkout Manager) for WooCommerce - The best WooCommerce
14
  == Description ==
15
 
16
  = Checkout Field Editor for WooCommerce =
17
- WooCommerce Checkout Field Editor (Checkout Manager) Plugin lets you add 7 different types of custom checkout fields to your Checkout page, blended with a simple and user-friendly interface.
18
 
19
  It enables you to edit the default checkout fields of your WooCommerce platform, add new custom fields in the three sections (namely Billing, Shipping and Additional), edit, hide, or delete the default fields, change labels, rearrange checkout fields, validate the checkout fields, add custom css classes etc.
20
 
@@ -25,18 +25,24 @@ https://www.youtube.com/watch?v=_iKMe5lGIIM
25
  --------------------------------------------
26
 
27
  = Key Features =
28
- = ☞ Custom Checkout field(s) =
29
- Add additional fields to your Checkout page using the Checkout Manager plugin. You can add seven different types of checkout fields in your WooCommerce checkout page and collect more information from the end-user. The various field types it supports include:
30
 
31
- * Text
 
 
32
  * Password
33
  * Email
34
  * Phone
35
- * Select
36
- * Textarea
37
  * Radio
 
 
 
 
 
 
38
 
39
- = ☞ Edit field(s) =
40
  Edit the custom fields as per the varying business requirements, including the default ones.
41
 
42
  = ☞ Delete Field(s) =
@@ -60,9 +66,12 @@ Validate the custom checkout fields (including the default ones), and never miss
60
  = ☞ Override Address Fields =
61
  By default, WooCommerce will change the address format based on the countries. Using this plugin, you can prevent the override address field properties and use the values set using the Checkout Manager plugin.
62
 
63
- = ☞ Reset to default fields =
64
  Using this plugin, you can reset to the original state with the default fields on a single click.
65
 
 
 
 
66
  == 💎💎 Upgrade to Premium Version Now! ==
67
  The premium version of WooCommerce Checkout Field Editor (Checkout Manager) Plugin lets you add 17 different types of custom checkout fields and sections to your Checkout page, and make the best out of your Checkout form.
68
 
@@ -249,6 +258,10 @@ Yes. There is a button 'reset to default fields' to go back to the WooCommerce d
249
  9. Locale override settings
250
 
251
  == Changelog ==
 
 
 
 
252
  = 1.5.1 =
253
  * Added WooCommerce 5.9.0 compatibility.
254
 
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 1.5.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
14
  == Description ==
15
 
16
  = Checkout Field Editor for WooCommerce =
17
+ WooCommerce Checkout Field Editor (Checkout Manager) Plugin lets you add 13 different types of custom checkout fields to your Checkout page, blended with a simple and user-friendly interface.
18
 
19
  It enables you to edit the default checkout fields of your WooCommerce platform, add new custom fields in the three sections (namely Billing, Shipping and Additional), edit, hide, or delete the default fields, change labels, rearrange checkout fields, validate the checkout fields, add custom css classes etc.
20
 
25
  --------------------------------------------
26
 
27
  = Key Features =
28
+ = ☞ Custom Checkout Field(s) =
29
+ Add additional fields to your Checkout page using the Checkout Manager plugin. You can add thirteen different types of checkout fields in your WooCommerce checkout page and collect more information from the end-user. The various field types it supports include:
30
 
31
+ * Text
32
+ * Number
33
+ * Hidden
34
  * Password
35
  * Email
36
  * Phone
 
 
37
  * Radio
38
+ * Textarea
39
+ * Select
40
+ * Multi Select
41
+ * Checkbox
42
+ * Checkbox Group
43
+ * Heading
44
 
45
+ = ☞ Edit Field(s) =
46
  Edit the custom fields as per the varying business requirements, including the default ones.
47
 
48
  = ☞ Delete Field(s) =
66
  = ☞ Override Address Fields =
67
  By default, WooCommerce will change the address format based on the countries. Using this plugin, you can prevent the override address field properties and use the values set using the Checkout Manager plugin.
68
 
69
+ = ☞ Reset to Default Fields =
70
  Using this plugin, you can reset to the original state with the default fields on a single click.
71
 
72
+ = ☞ Translate Ready to Other Language =
73
+ The Checkout Field Editor plugin lets you translate to other languages as it is compatible with WPML, Polylang & Loco Translate translation plugins. To translate dynamic strings, use Polylang or WPML plugin.
74
+
75
  == 💎💎 Upgrade to Premium Version Now! ==
76
  The premium version of WooCommerce Checkout Field Editor (Checkout Manager) Plugin lets you add 17 different types of custom checkout fields and sections to your Checkout page, and make the best out of your Checkout form.
77
 
258
  9. Locale override settings
259
 
260
  == Changelog ==
261
+ = 1.5.2 =
262
+ * Added WooCommerce 6.0.0 compatibility.
263
+ * Added Number, Hidden, Multi-Select, Checkbox, Checkbox Group and Heading as new field types.
264
+
265
  = 1.5.1 =
266
  * Added WooCommerce 5.9.0 compatibility.
267