WooCommerce Checkout Field Editor (Manager) Pro - Version 1.7.0

Version Description

  • Added WooCommerce 6.7 compatibility
  • Added default value property for checkbox field.
  • Added an option to backup plugin settings.
Download this release

Release Info

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

Code changes from version 1.6.1 to 1.7.0

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}.thwcfd-review-wrapper{padding:15px 28px 26px 10px;margin-top:35px}.thwcfd-review-image{float:left}.thwcfd-review-content{padding-right:180px}.thwcfd-review-content p{padding-bottom:14px}.thwcfd-notice-action{padding:8px 18px 8px 18px;background:#fff;color:var(--primary-bg-color);border-radius:5px;border:1px solid var(--primary-bg-color)}.thwcfd-notice-action.thwcfd-yes{background-color:var(--primary-bg-color);color:#fff}.thwcfd-notice-action:hover:not(.thwcfd-yes){background-color:#f2f5f6}.thwcfd-notice-action.thwcfd-yes:hover{opacity:.9}.thwcfd-notice-action .dashicons{display:none}.thwcfd-themehigh-logo{position:absolute;right:20px;top:calc(50% - 13px)}.thwcfd-notice-action{background-repeat:no-repeat;padding-left:40px;background-position:18px 8px}.thwcfd-yes{background-image:url(tick.svg)}.thwcfd-remind{background-image:url(reminder.svg)}.thwcfd-dismiss{background-image:url(close.svg)}.thwcfd-done{background-image:url(done.svg)}.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}
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/images/wp-plugins/order-delivery.gif ADDED
Binary file
admin/assets/js/thwcfd-admin.js CHANGED
@@ -1052,17 +1052,6 @@ var thwcfd_settings = (function($, window, document) {
1052
  });
1053
  }
1054
 
1055
- $( document ).on( 'click', '.thpladmin-notice .notice-dismiss', function() {
1056
- var wrapper = $(this).closest('div.thpladmin-notice');
1057
- var nonce = wrapper.data("nonce");
1058
- var data = {
1059
- thwcfd_review_nonce: nonce,
1060
- action: 'hide_thwcfd_admin_notice',
1061
- };
1062
- $.post( ajaxurl, data, function() {
1063
-
1064
- });
1065
- });
1066
  return {
1067
  selectAllFields : select_all_fields,
1068
  removeSelectedFields : remove_selected_fields,
1052
  });
1053
  }
1054
 
 
 
 
 
 
 
 
 
 
 
 
1055
  return {
1056
  selectAllFields : select_all_fields,
1057
  removeSelectedFields : remove_selected_fields,
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(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))}),$(document).on("click",".thpladmin-notice .notice-dismiss",function(){var wrapper=$(this).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),data={thwcfd_review_nonce:nonce,action:"hide_thwcfd_admin_notice"};$.post(ajaxurl,data,function(){})}),{selectAllFields:select_all_fields,removeSelectedFields:remove_selected_fields,enableDisableSelectedFields:enable_disable_selected_fields}}(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
@@ -459,6 +459,7 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
459
  <?php
460
  $this->render_form_elm_row($this->field_props['label']);
461
  $this->render_form_elm_row($this->field_props['class']);
 
462
 
463
  $this->render_form_elm_row_cb($this->field_props['checked']);
464
  $this->render_form_elm_row_cb($this->field_props['required']);
459
  <?php
460
  $this->render_form_elm_row($this->field_props['label']);
461
  $this->render_form_elm_row($this->field_props['class']);
462
+ $this->render_form_elm_row($this->field_props['default']);
463
 
464
  $this->render_form_elm_row_cb($this->field_props['checked']);
465
  $this->render_form_elm_row_cb($this->field_props['required']);
admin/class-thwcfd-admin-settings-advanced.php CHANGED
@@ -20,6 +20,7 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
20
  private $settings_fields = NULL;
21
  private $cell_props = array();
22
  private $cell_props_CB = array();
 
23
 
24
  public function __construct() {
25
  parent::__construct();
@@ -43,6 +44,13 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
43
  'label_cell_th' => true
44
  );
45
 
 
 
 
 
 
 
 
46
  $this->cell_props_CB = array(
47
  'label_props' => 'style="margin-right: 40px;"',
48
  );
@@ -136,8 +144,12 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
136
 
137
  if(isset($_POST['save_settings']))
138
  $this->save_settings();
 
 
 
139
 
140
  $this->render_plugin_settings();
 
141
  }
142
 
143
  private function render_plugin_settings(){
@@ -172,6 +184,121 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
172
  $this->render_form_elm_row_cb($this->settings_fields['enable_required_override'], $settings, true);
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  public function render_form_elm_row_title($title=''){
176
  ?>
177
  <tr>
@@ -180,6 +307,21 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
180
  <?php
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  private function render_form_elm_row_cb($field, $settings=false, $merge_cells=false){
184
  $name = $field['name'];
185
  if(is_array($settings) && isset($settings[$name])){
@@ -211,4 +353,5 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
211
  }
212
  }
213
 
 
214
  endif;
20
  private $settings_fields = NULL;
21
  private $cell_props = array();
22
  private $cell_props_CB = array();
23
+ private $cell_props_TA = array();
24
 
25
  public function __construct() {
26
  parent::__construct();
44
  'label_cell_th' => true
45
  );
46
 
47
+ $this->cell_props_TA = array(
48
+ 'label_cell_props' => 'class="label"',
49
+ 'input_cell_props' => 'class="field"',
50
+ 'rows' => 10,
51
+ 'cols' => 100,
52
+ );
53
+
54
  $this->cell_props_CB = array(
55
  'label_props' => 'style="margin-right: 40px;"',
56
  );
144
 
145
  if(isset($_POST['save_settings']))
146
  $this->save_settings();
147
+
148
+ if(isset($_POST['save_plugin_settings']))
149
+ $result = $this->save_plugin_settings();
150
 
151
  $this->render_plugin_settings();
152
+ $this->render_import_export_settings();
153
  }
154
 
155
  private function render_plugin_settings(){
184
  $this->render_form_elm_row_cb($this->settings_fields['enable_required_override'], $settings, true);
185
  }
186
 
187
+ /************************************************
188
+ *-------- IMPORT & EXPORT SETTINGS - START -----
189
+ ************************************************/
190
+ public function prepare_plugin_settings(){
191
+ $settings_billing = get_option(THWCFD_Utils::OPTION_KEY_BILLING_FIELDS);
192
+ $settings_shipping = get_option(THWCFD_Utils::OPTION_KEY_SHIPPING_FIELDS);
193
+ $settings_additional = get_option(THWCFD_Utils::OPTION_KEY_ADDITIONAL_FIELDS);
194
+ $settings_advanced = get_option(THWCFD_Utils::OPTION_KEY_ADVANCED_SETTINGS);
195
+
196
+ $plugin_settings = array(
197
+ 'option_key_billing_fields' => $settings_billing,
198
+ 'option_key_shipping_fields' => $settings_shipping,
199
+ 'option_key_additional_fields' => $settings_additional,
200
+ 'option_key_advanced_settings' => $settings_advanced,
201
+ );
202
+ return base64_encode(serialize($plugin_settings));
203
+ }
204
+
205
+ public function render_import_export_settings(){
206
+ /*
207
+ if(isset($_POST['save_plugin_settings']))
208
+ $result = $this->save_plugin_settings();
209
+ */
210
+
211
+ if(isset($_POST['import_settings'])){
212
+ }
213
+
214
+ $plugin_settings = $this->prepare_plugin_settings();
215
+ if(isset($_POST['export_settings']))
216
+ echo $this->export_settings($plugin_settings);
217
+
218
+ $imp_exp_fields = array(
219
+ 'section_import_export' => array('title'=>__('Backup and Import Settings', 'woo-checkout-field-editor'), 'type'=>'separator', 'colspan'=>'3'),
220
+ 'settings_data' => array(
221
+ 'name'=>'settings_data', 'label'=>__('Plugin Settings Data', 'woo-checkout-field-editor'), 'type'=>'textarea', 'value' => $plugin_settings,
222
+ 'sub_label'=>__('You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Settings".', 'woo-checkout-field-editor'),
223
+ ),
224
+ );
225
+ ?>
226
+ <div style="padding-left: 30px;">
227
+ <form id="import_export_settings_form" method="post" action="" class="clear">
228
+ <table class="thwcfd-settings-table">
229
+ <tbody>
230
+ <?php
231
+ $this->render_form_elm_row_title('Backup and Import Settings');
232
+ $this->render_form_elm_row_ta($imp_exp_fields['settings_data']);
233
+ ?>
234
+ </tbody>
235
+ <tfoot>
236
+ <tr valign="top">
237
+ <td colspan="2">&nbsp;</td>
238
+ <td class="submit">
239
+ <input type="submit" name="save_plugin_settings" class="btn btn-small btn-primary" value="<?php _e('Import Settings', 'woo-checkout-field-editor'); ?>">
240
+ <?php wp_nonce_field( 'import_wcfd_settings', 'import_wcfd_nonce' ); ?>
241
+ </td>
242
+ </tr>
243
+ </tfoot>
244
+ </table>
245
+ </form>
246
+ </div>
247
+ <?php
248
+ }
249
+
250
+ public function save_plugin_settings(){
251
+
252
+ check_admin_referer( 'import_wcfd_settings', 'import_wcfd_nonce' );
253
+
254
+ $capability = THWCFD_Utils::wcfd_capability();
255
+ if(!current_user_can($capability)){
256
+ wp_die();
257
+ }
258
+
259
+ if(isset($_POST['i_settings_data']) && !empty($_POST['i_settings_data'])) {
260
+ $settings_data_encoded = sanitize_textarea_field(wp_unslash($_POST['i_settings_data']));
261
+ $base64_decoded = base64_decode($settings_data_encoded);
262
+
263
+ if(!is_serialized($base64_decoded)){
264
+ $this->print_notices(__('The entered import settings data is invalid. Please try again with valid data.', 'woo-extra-product-options'), 'error', false);
265
+ return false;
266
+ }
267
+
268
+ $settings = unserialize($base64_decoded);
269
+
270
+ if($settings){
271
+ foreach($settings as $key => $value){
272
+ if($key === 'option_key_billing_fields'){
273
+ $result = update_option(THWCFD_Utils::OPTION_KEY_BILLING_FIELDS, $value);
274
+ }
275
+ if($key === 'option_key_shipping_fields'){
276
+ $result1 = update_option(THWCFD_Utils::OPTION_KEY_SHIPPING_FIELDS, $value);
277
+ }
278
+ if($key === 'option_key_additional_fields'){
279
+ $result2 = update_option(THWCFD_Utils::OPTION_KEY_ADDITIONAL_FIELDS, $value);
280
+ }
281
+ if($key === 'option_key_advanced_settings'){
282
+ $result3 = $this->save_advanced_settings($value);
283
+ }
284
+ }
285
+ }
286
+
287
+ if($result || $result1 || $result2 || $result3){
288
+ $this->print_notices(__('Your Settings Updated.', 'woo-checkout-field-editor-pro'), 'updated', false);
289
+ return true;
290
+ }else{
291
+ $this->print_notices(__('Your changes were not saved due to an error (or you made none!).', 'woo-checkout-field-editor-pro'), 'error', false);
292
+ return false;
293
+ }
294
+ }
295
+ }
296
+
297
+ /**********************************************
298
+ *-------- IMPORT & EXPORT SETTINGS - END -----
299
+ **********************************************/
300
+
301
+
302
  public function render_form_elm_row_title($title=''){
303
  ?>
304
  <tr>
307
  <?php
308
  }
309
 
310
+ private function render_form_elm_row_ta($field, $settings=false){
311
+ if(isset($field['name'])){
312
+ $name = $field['name'];
313
+ }
314
+ if(is_array($settings) && isset($settings[$name])){
315
+ $field['value'] = $settings[$name];
316
+ }
317
+
318
+ ?>
319
+ <tr valign="top">
320
+ <?php $this->render_form_field_element($field, $this->cell_props_TA); ?>
321
+ </tr>
322
+ <?php
323
+ }
324
+
325
  private function render_form_elm_row_cb($field, $settings=false, $merge_cells=false){
326
  $name = $field['name'];
327
  if(is_array($settings) && isset($settings[$name])){
353
  }
354
  }
355
 
356
+
357
  endif;
admin/class-thwcfd-admin-settings-general.php CHANGED
@@ -377,8 +377,8 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
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
  }
377
  $field['validate'] = array('number');
378
 
379
  }else if($type === 'checkbox'){
380
+ if(isset($posted['i_default'])){
381
+ $field['default'] = sanitize_text_field($posted['i_default']);
382
  }else{
383
  $field['default'] = '';
384
  }
admin/class-thwcfd-admin-settings-pro.php CHANGED
@@ -44,9 +44,10 @@ class THWCFD_Admin_Settings_Pro extends THWCFD_Admin_Settings{
44
  <h2>Key Features of WooCommerce Checkout Field Editor Pro</h2>
45
  <p><b>Checkout Field Editor For WooCommerce</b> plugin comes with several advanced features that let you create an organized checkout page. With these premium features, bring your checkout page to its next level.</p>
46
  <ul class="feature-list star-list">
47
- <li>17 Custom Checkout Field Types</li>
48
  <li>Custom section which can be placed at 15 different positions on the checkout page</li>
49
  <li>Display fields conditionally</li>
 
50
  <li>Display sections conditionally</li>
51
  <li>Price fields with a set of price types</li>
52
  <li>Custom validations</li>
@@ -86,10 +87,17 @@ class THWCFD_Admin_Settings_Pro extends THWCFD_Admin_Settings{
86
  <li>Checkbox</li>
87
  <li>Checkbox Group</li>
88
  <li>Date picker</li>
 
 
89
  <li>Time picker</li>
 
 
 
90
  <li>File Upload</li>
91
  <li>Heading</li>
 
92
  <li>Label</li>
 
93
  </ul>
94
  </div>
95
  <div class="th-flexbox-child th-nice-box">
@@ -125,7 +133,10 @@ class THWCFD_Admin_Settings_Pro extends THWCFD_Admin_Settings{
125
  <li>User Roles</li>
126
  <li>Product</li>
127
  <li>Product Variation</li>
 
128
  <li>Product Category</li>
 
 
129
  <li>Based on other field values</li>
130
  </ul>
131
  </div>
44
  <h2>Key Features of WooCommerce Checkout Field Editor Pro</h2>
45
  <p><b>Checkout Field Editor For WooCommerce</b> plugin comes with several advanced features that let you create an organized checkout page. With these premium features, bring your checkout page to its next level.</p>
46
  <ul class="feature-list star-list">
47
+ <li>24 Custom Checkout Field Types</li>
48
  <li>Custom section which can be placed at 15 different positions on the checkout page</li>
49
  <li>Display fields conditionally</li>
50
+ <li>Address autofill suggestion</li>
51
  <li>Display sections conditionally</li>
52
  <li>Price fields with a set of price types</li>
53
  <li>Custom validations</li>
87
  <li>Checkbox</li>
88
  <li>Checkbox Group</li>
89
  <li>Date picker</li>
90
+ <li>Datetime local</li>
91
+ <li>Date</li>
92
  <li>Time picker</li>
93
+ <li>Time</li>
94
+ <li>Month</li>
95
+ <li>Week</li>
96
  <li>File Upload</li>
97
  <li>Heading</li>
98
+ <li>Paragraph</li>
99
  <li>Label</li>
100
+ <li>URL</li>
101
  </ul>
102
  </div>
103
  <div class="th-flexbox-child th-nice-box">
133
  <li>User Roles</li>
134
  <li>Product</li>
135
  <li>Product Variation</li>
136
+ <li>Product type</li>
137
  <li>Product Category</li>
138
+ <li>Shipping Class</li>
139
+ <li>Shipping Weight</li>
140
  <li>Based on other field values</li>
141
  </ul>
142
  </div>
admin/class-thwcfd-admin-settings-themehigh-plugins.php CHANGED
@@ -80,6 +80,14 @@ class THWCFD_Admin_Settings_Themehigh_Plugins extends THWCFD_Admin_Settings{
80
  'file' => 'themehigh-multiple-addresses.php',
81
  'featured' => true,
82
  ),
 
 
 
 
 
 
 
 
83
  array(
84
  'title' => 'Variation Swatches for WooCommerce',
85
  'image' => 'variation-swatches.png',
80
  'file' => 'themehigh-multiple-addresses.php',
81
  'featured' => true,
82
  ),
83
+ array(
84
+ 'title' => 'Order Delivery Date And Time',
85
+ 'image' => 'order-delivery.gif',
86
+ 'content' => "Order Delivery | Pickup Date and Time Planner allows you to plan your store's delivery and pickup, as well as pre-set specific days and holidays.",
87
+ 'slug' => 'order-delivery-date-and-time',
88
+ 'file' => 'order-delivery-date-and-time.php',
89
+ 'featured' => true,
90
+ ),
91
  array(
92
  'title' => 'Variation Swatches for WooCommerce',
93
  'image' => 'variation-swatches.png',
admin/class-thwcfd-admin-settings.php CHANGED
@@ -174,7 +174,7 @@ abstract class THWCFD_Admin_Settings{
174
  }
175
  ?>
176
  </td>
177
- <?php $this->render_form_fragment_tooltip($tooltip); ?>
178
  <td <?php echo $input_cell_props ?> ><?php echo $field_html; ?></td>
179
  <?php
180
  }else{
174
  }
175
  ?>
176
  </td>
177
+ <?php $this->render_form_element_tooltip($tooltip); ?>
178
  <td <?php echo $input_cell_props ?> ><?php echo $field_html; ?></td>
179
  <?php
180
  }else{
admin/class-thwcfd-admin.php CHANGED
@@ -34,7 +34,7 @@ class THWCFD_Admin {
34
  $suffix = $debug_mode ? '' : '.min';
35
 
36
  $this->enqueue_styles($suffix);
37
- $this->enqueue_scripts($suffix);
38
  }
39
  }
40
 
@@ -139,9 +139,9 @@ class THWCFD_Admin {
139
  }
140
 
141
  $current_screen = get_current_screen();
142
- if($current_screen->id !== 'woocommerce_page_checkout_form_designer'){
143
- return;
144
- }
145
 
146
  $thwcfd_reviewed = get_user_meta( get_current_user_id(), 'thwcfd_reviewed', true );
147
  if($thwcfd_reviewed){
@@ -149,8 +149,8 @@ class THWCFD_Admin {
149
  }
150
 
151
  $now = time();
152
- $dismiss_life = apply_filters('thwcfd_dismissed_review_request_notice_lifespan', 3 * MONTH_IN_SECONDS);
153
- $reminder_life = apply_filters('thwcfd_skip_review_request_notice_lifespan', 1 * DAY_IN_SECONDS);
154
 
155
  $is_dismissed = get_user_meta( get_current_user_id(), 'thwcfd_review_dismissed', true );
156
  $dismisal_time = get_user_meta( get_current_user_id(), 'thwcfd_review_dismissed_time', true );
@@ -176,7 +176,95 @@ class THWCFD_Admin {
176
  update_option('thwcfd_since', $now, 'no' );
177
  }
178
 
179
- $this->render_review_request_notice();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  private function render_review_request_notice(){
34
  $suffix = $debug_mode ? '' : '.min';
35
 
36
  $this->enqueue_styles($suffix);
37
+ $this->enqueue_scripts($suffix);
38
  }
39
  }
40
 
139
  }
140
 
141
  $current_screen = get_current_screen();
142
+ // if($current_screen->id !== 'woocommerce_page_checkout_form_designer'){
143
+ // return;
144
+ // }
145
 
146
  $thwcfd_reviewed = get_user_meta( get_current_user_id(), 'thwcfd_reviewed', true );
147
  if($thwcfd_reviewed){
149
  }
150
 
151
  $now = time();
152
+ $dismiss_life = apply_filters('thwcfd_dismissed_review_request_notice_lifespan', 6 * MONTH_IN_SECONDS);
153
+ $reminder_life = apply_filters('thwcfd_skip_review_request_notice_lifespan', 7 * DAY_IN_SECONDS);
154
 
155
  $is_dismissed = get_user_meta( get_current_user_id(), 'thwcfd_review_dismissed', true );
156
  $dismisal_time = get_user_meta( get_current_user_id(), 'thwcfd_review_dismissed_time', true );
176
  update_option('thwcfd_since', $now, 'no' );
177
  }
178
 
179
+ $render_time = apply_filters('thwcfd_show_review_banner_render_time' , 7 * DAY_IN_SECONDS);
180
+ $render_time = $thwcfd_since + $render_time;
181
+ if($now > $render_time ){
182
+ $this->render_review_request_notice();
183
+ }
184
+
185
+ }
186
+
187
+ public function review_banner_custom_css(){
188
+
189
+ ?>
190
+ <style>
191
+ .thwcfd-review-wrapper {
192
+ padding: 15px 28px 26px 10px !important;
193
+ margin-top: 35px;
194
+ }
195
+ .thwcfd-review-image {
196
+ float: left;
197
+ }
198
+ .thwcfd-review-content {
199
+ padding-right: 180px;
200
+ }
201
+ .thwcfd-review-content p {
202
+ padding-bottom: 14px;
203
+ }
204
+ .thwcfd-notice-action{
205
+ padding: 8px 18px 8px 18px;
206
+ background: #fff;
207
+ color: var(--primary-bg-color);
208
+ border-radius: 5px;
209
+ border: 1px solid var(--primary-bg-color);
210
+ }
211
+ .thwcfd-notice-action.thwcfd-yes {
212
+ background-color: #2271b1;
213
+ color: #fff;
214
+ }
215
+ .thwcfd-notice-action:hover:not(.thwcfd-yes) {
216
+ background-color: #f2f5f6;
217
+ }
218
+ .thwcfd-notice-action.thwcfd-yes:hover {
219
+ opacity: .9;
220
+ }
221
+ .thwcfd-notice-action .dashicons{
222
+ display: none;
223
+ }
224
+ .thwcfd-themehigh-logo {
225
+ position: absolute;
226
+ right: 20px;
227
+ top: calc(50% - 13px);
228
+ }
229
+ .thwcfd-notice-action {
230
+ background-repeat: no-repeat;
231
+ padding-left: 40px;
232
+ background-position: 18px 8px;
233
+ }
234
+ .thwcfd-yes{
235
+ background-image: url(<?php echo THWCFD_URL; ?>admin/assets/css/tick.svg);
236
+ }
237
+ .thwcfd-remind{
238
+ background-image: url(<?php echo THWCFD_URL; ?>admin/assets/css/reminder.svg);
239
+ }
240
+ .thwcfd-dismiss{
241
+ background-image: url(<?php echo THWCFD_URL; ?>admin/assets/css/close.svg);
242
+ }
243
+ .thwcfd-done{
244
+ background-image: url(<?php echo THWCFD_URL; ?>admin/assets/css/done.svg);
245
+ }
246
+ </style>
247
+ <?php
248
+ }
249
+
250
+ public function review_banner_custom_js(){
251
+ ?>
252
+ <script type="text/javascript">
253
+ (function($, window, document) {
254
+ $( document ).on( 'click', '.thpladmin-notice .notice-dismiss', function() {
255
+ var wrapper = $(this).closest('div.thpladmin-notice');
256
+ var nonce = wrapper.data("nonce");
257
+ var data = {
258
+ thwcfd_review_nonce: nonce,
259
+ action: 'hide_thwcfd_admin_notice',
260
+ };
261
+ $.post( ajaxurl, data, function() {
262
+
263
+ });
264
+ });
265
+ }(window.jQuery, window, document));
266
+ </script>
267
+ <?php
268
  }
269
 
270
  private function render_review_request_notice(){
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.6.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: 6.5
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.6.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.7.0
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.7
13
  */
14
 
15
  if(!defined( 'ABSPATH' )) exit;
25
  }
26
 
27
  if(is_woocommerce_active()) {
28
+ define('THWCFD_VERSION', '1.7.0');
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
@@ -65,6 +65,8 @@ class THWCFD {
65
 
66
  add_action('admin_enqueue_scripts', array($plugin_admin, 'enqueue_styles_and_scripts'));
67
  add_action('admin_menu', array($plugin_admin, 'admin_menu'));
 
 
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_action( 'admin_init', array( $plugin_admin, 'wcfd_notice_actions' ), 20 );
65
 
66
  add_action('admin_enqueue_scripts', array($plugin_admin, 'enqueue_styles_and_scripts'));
67
  add_action('admin_menu', array($plugin_admin, 'admin_menu'));
68
+ add_action('admin_head', array($plugin_admin,'review_banner_custom_css'));
69
+ add_action('admin_footer', array($plugin_admin,'review_banner_custom_js'));
70
  add_filter('woocommerce_screen_ids', array($plugin_admin, 'add_screen_id'));
71
  add_filter('plugin_action_links_'.THWCFD_BASE_NAME, array($plugin_admin, 'plugin_action_links'));
72
  add_action( 'admin_init', array( $plugin_admin, 'wcfd_notice_actions' ), 20 );
includes/utils/class-thwcfd-utils.php CHANGED
@@ -14,6 +14,9 @@ if(!class_exists('THWCFD_Utils')):
14
 
15
  class THWCFD_Utils {
16
  const OPTION_KEY_ADVANCED_SETTINGS = 'thwcfd_advanced_settings';
 
 
 
17
 
18
  public function __construct() {
19
 
14
 
15
  class THWCFD_Utils {
16
  const OPTION_KEY_ADVANCED_SETTINGS = 'thwcfd_advanced_settings';
17
+ const OPTION_KEY_BILLING_FIELDS = 'wc_fields_billing';
18
+ const OPTION_KEY_SHIPPING_FIELDS = 'wc_fields_shipping';
19
+ const OPTION_KEY_ADDITIONAL_FIELDS = 'wc_fields_additional';
20
 
21
  public function __construct() {
22
 
public/class-thwcfd-public-checkout.php CHANGED
@@ -58,6 +58,7 @@ class THWCFD_Public_Checkout {
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_datetime_local', array($this, 'woo_form_field'), 10, 4);
62
  add_filter('woocommerce_form_field_date', array($this, 'woo_form_field'), 10, 4);
63
  add_filter('woocommerce_form_field_time', array($this, 'woo_form_field'), 10, 4);
@@ -433,10 +434,16 @@ class THWCFD_Public_Checkout {
433
  if(!empty($submitted_options)){
434
  $value = implode(",", $submitted_options);
435
  }
436
- }else{
437
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
 
 
 
 
 
 
 
438
  }
439
-
440
  if($value){
441
  $result = update_post_meta($order_id, $name, $value);
442
  }
@@ -555,7 +562,6 @@ class THWCFD_Public_Checkout {
555
 
556
 
557
  public function woo_form_field($field, $key, $args, $value = null){
558
-
559
  $field = '';
560
 
561
  if ( $args['required'] ) {
@@ -628,6 +634,20 @@ class THWCFD_Public_Checkout {
628
 
629
  break;
630
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  case 'checkboxgroup':
632
 
633
  $field = '';
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_checkbox', array($this, 'woo_form_field'), 10, 4);
62
  add_filter('woocommerce_form_field_datetime_local', array($this, 'woo_form_field'), 10, 4);
63
  add_filter('woocommerce_form_field_date', array($this, 'woo_form_field'), 10, 4);
64
  add_filter('woocommerce_form_field_time', array($this, 'woo_form_field'), 10, 4);
434
  if(!empty($submitted_options)){
435
  $value = implode(",", $submitted_options);
436
  }
437
+ }else if($type == 'checkbox'){
438
  $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
439
+ if($value){
440
+ $value = !empty($field['default']) ? $field['default'] : $value;
441
+ }else{
442
+ $value = apply_filters('thwcfd_checkbox_field_off_value', $value , $name);
443
+ }
444
+ }else{
445
+ $value = isset($posted[$name]) ? sanitize_text_field($posted[$name]) : '';
446
  }
 
447
  if($value){
448
  $result = update_post_meta($order_id, $name, $value);
449
  }
562
 
563
 
564
  public function woo_form_field($field, $key, $args, $value = null){
 
565
  $field = '';
566
 
567
  if ( $args['required'] ) {
634
 
635
  break;
636
 
637
+ case 'checkbox' :
638
+
639
+ $field = '';
640
+ if($args['checked']){
641
+ $value = 1;
642
+ }else{
643
+ $value = 0;
644
+ }
645
+ $default_value = !empty($args['default']) ? esc_attr($args['default']) : 1;
646
+
647
+ $field .= '<label class="checkbox ' . implode( ' ', $args['label_class'] ) . '" ' . implode( ' ', $custom_attributes ) . '>
648
+ <input type="' . esc_attr( $args['type'] ) . '" class="input-checkbox ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="'.$default_value.'" ' . checked( $value, 1, false ) . ' /> ' . $args['label'] . $required . '</label>';
649
+ break;
650
+
651
  case 'checkboxgroup':
652
 
653
  $field = '';
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: 6.0
7
  Requires PHP: 5.6
8
- Stable tag: 1.6.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -70,9 +70,6 @@ Showcase or hide the custom checkout fields in the Order Details Page or in your
70
  = ☞ Validate the Checkout Fields =
71
  Validate the custom checkout fields (including the default ones), and never miss any valuable information from the user.
72
 
73
- = ☞ Add fields and sections into multistep layouts =
74
- Add the fields and sections into any steps you created using the multistep checkout for WooCommerce plugin. [Multistep Checkout for WooCommerce](https://wordpress.org/plugins/woo-multistep-checkout/) plugin lets you split the checkout process into multiple steps so that the user is guided through the checkout until the payment is made.
75
-
76
  = ☞ Override Address Fields =
77
  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.
78
 
@@ -275,6 +272,11 @@ Yes. There is a button 'reset to default fields' to go back to the WooCommerce d
275
  9. Locale override settings
276
 
277
  == Changelog ==
 
 
 
 
 
278
  = 1.6.1 =
279
  * Added Wordpress 6.0 compatability.
280
  * Added WooCommerce 6.5 compatability.
5
  Requires at least: 4.9
6
  Tested up to: 6.0
7
  Requires PHP: 5.6
8
+ Stable tag: 1.7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
70
  = ☞ Validate the Checkout Fields =
71
  Validate the custom checkout fields (including the default ones), and never miss any valuable information from the user.
72
 
 
 
 
73
  = ☞ Override Address Fields =
74
  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.
75
 
272
  9. Locale override settings
273
 
274
  == Changelog ==
275
+ = 1.7.0 =
276
+ * Added WooCommerce 6.7 compatibility
277
+ * Added default value property for checkbox field.
278
+ * Added an option to backup plugin settings.
279
+
280
  = 1.6.1 =
281
  * Added Wordpress 6.0 compatability.
282
  * Added WooCommerce 6.5 compatability.