WooCommerce Checkout Field Editor (Manager) Pro - Version 1.5.0

Version Description

  • Improved the pot file.
  • Added compatibility with Loco Translate plugin.
  • Added WPML compatibility for dynamic strings.
  • Added WooCommerce 5.8.0 compatibility.
Download this release

Release Info

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

Code changes from version 1.4.9 to 1.5.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}.thpladmin_fields_table tr.strikeout td{background:rgba(255,0,0,.4)!important;opacity:.6;text-decoration:line-through}.thpladmin_fields_table tr.thpladmin-disabled td{opacity:.4}.thpladmin_fields_table tr.thpladmin-disabled td.td_select{opacity:1}.thpladmin_fields_table .td_actions{width:90px}.thpladmin_fields_table .td_enabled{width:80px}.thpladmin_fields_table .td_clear{width:65px}.thpladmin_fields_table .td_required{width:85px}.thpladmin_fields_table .td_select{width:45px}.thpladmin_fields_table .td_type{width:150px}.thpladmin_fields_table .td_validate{text-transform:capitalize}.thpladmin_fields_table th.status{white-space:nowrap}.thpladmin_fields_table .dashicons{line-height:inherit}.thpladmin_fields_table .td_actions .dashicons{background-color:#f7f7f7;border:1px solid #ccc;border-radius:3px;padding:0 2px 2px 2px;box-shadow:0 1px 0 #ccc;webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.thpladmin_fields_table .td_actions .dashicons.disabled{color:#ccc;border:1px solid #e9e9e9;cursor:default}.thpladmin_fields_table .td_actions .dashicons-edit{cursor:pointer}.thpladmin_fields_table .td_actions .dashicons-admin-page{cursor:pointer}.thpladmin-sections .dashicons{cursor:pointer}.thpladmin-sections .dashicons-no{color:#ff4c4c}.thpladmin-notice .logo{float:right}.thpladmin-notice .logo img{height:18px;margin-top:12px}@media only screen and (min-width:45em){ul.feature-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}.th-nice-box{border:1px solid #c3c4c7;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%);background:#fff;margin:1.5rem 0 .75rem 0;padding:2rem}ul.feature-list li:before{content:"\f147";display:inline-block;-webkit-font-smoothing:antialiased;color:#2271b1;margin-right:10px;word-wrap:break-word;font-family:dashicons;font-weight:700}ul.star-list li:before{content:"\f155";color:#f90}.th-flexbox{display:flex;flex-wrap:wrap;justify-content:space-between}.th-flexbox-child{width:100%;height:auto;box-sizing:border-box}@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}.thpladmin-notice .logo{float:right}.thpladmin-notice .logo img{height:18px;margin-top:12px}@media only screen and (min-width:45em){ul.feature-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}.th-nice-box{border:1px solid #c3c4c7;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%);background:#fff;margin:1.5rem 0 .75rem 0;padding:2rem}ul.feature-list li:before{content:"\f147";display:inline-block;-webkit-font-smoothing:antialiased;color:#2271b1;margin-right:10px;word-wrap:break-word;font-family:dashicons;font-weight:700}ul.star-list li:before{content:"\f155";color:#f90}.th-flexbox{display:flex;flex-wrap:wrap;justify-content:space-between}.th-title-box{display:flex;align-items:center}.th-title-box img{width:54px;height:54px;margin-right:1.2em;border-radius:6px}.th-title-box h3{flex:1}.th-title-box h3 a{color:#1d2327}.th-title-box h3 a:hover{opacity:.8}.th-flexbox-child{width:100%;height:auto;box-sizing:border-box}.th-plugins-wrapper{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;grid-gap:20px}.th-plugins-wrapper.featured{grid-template-columns:1fr 1fr 1fr;grid-gap:20px;margin-bottom:4em}.th-plugins-child{width:100%;height:auto;box-sizing:border-box;padding:5%;border-radius:2%;border:1px solid #fff;background:#fff;transition:box-shadow .5s;transition:border .5s}.th-plugins-child:hover{border:1px solid #e0e0e0;box-shadow:0 2px 2px rgb(0 0 0 / 4%),0 4px 4px rgb(0 0 0 / 4%),0 8px 8px rgb(0 0 0 / 4%),0 16px 16px rgb(0 0 0 / 4%)}.th-plugin-action.updating-message::before{display:inline-block;content:"\f111";font:400 19px/1 dashicons;margin:0 5px 0 -2px;vertical-align:middle;animation:rotation 2s infinite linear}@media only screen and (min-width:45em){.th-flexbox-child{width:49%}}:root{--primary-bg-color:#007cba;--primary-text-color:#0071a1;--primary-border-color:#0071a1;--primary-alt-bg-color:#f3f5f6;--primary-alt-text-color:#0071a1;--primary-alt-border-color:#0071a1}*{box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}ol,ul{margin-top:0;margin-bottom:10px}:after,:before{box-sizing:border-box}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{cursor:pointer;color:#337ab7;text-decoration:none;background-color:transparent}.btn-link,a{color:#528ff0}.wp-core-ui select{line-height:2;border-color:#e2e2e2}.pull-right{float:right!important}.ml-30{margin-left:30px!important}.mt-10{margin-top:10px!important}.mt-20{margin-top:20px!important}.p-0{padding:0!important}.ph-5{padding-left:5px!important;padding-right:5px!important}.pv-2{padding-top:2px!important;padding-bottom:2px!important}.thwcfd-wrap div.thwcfd-notice{margin:10px 20px 0 2px}.thwcfd-wrap input[type=number],.thwcfd-wrap input[type=text],.thwcfd-wrap select,.thwcfd-wrap textarea{color:#32373c;line-height:1;min-height:30px;height:36px;width:auto;background-color:#fff;border:1px solid #e2e2e2;border-radius:2px;overflow:hidden;font-size:14px;padding:0 12px;box-shadow:0 0 0 transparent}.thwcfd-wrap textarea{height:auto;overflow:auto;padding:2px 6px;line-height:1.5;resize:vertical}.thwcfd-wrap input[type=number]:disabled,.thwcfd-wrap input[type=text]:disabled,.thwcfd-wrap select:disabled,.thwcfd-wrap textarea:disabled{color:#a0a5aa;border-color:#ddd;background-color:#f7f7f7}.thwcfd-wrap input[type=number]:disabled::placeholder,.thwcfd-wrap input[type=text]:disabled::placeholder,.thwcfd-wrap select:disabled::placeholder,.thwcfd-wrap textarea:disabled::placeholder{color:#a0a5aa}.thwcfd-wrap .btn{display:inline-block;background-image:none;font-size:14px;font-weight:400;text-align:center;vertical-align:middle;white-space:nowrap;cursor:pointer;touch-action:manipulation;line-height:1;border-width:1px;border-style:solid;border-radius:2px;outline:0;margin:0;padding:12px 20px;box-sizing:border-box;-webkit-appearance:none;-webkit-box-sizing:border-box;transition:.1s;-webkit-transition:.1s;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn:hover{opacity:.9}.thwcfd-wrap .btn-small{font-size:13px;padding:8px 10px;border-radius:2px}.thwcfd-wrap .btn-tiny{font-size:13px;padding:5px 5px;border-radius:2px}.thwcfd-wrap .btn-primary{color:#fff;background-color:var(--primary-bg-color);border-color:var(--primary-border-color)}.thwcfd-wrap .btn-primary-alt{color:var(--primary-alt-text-color);background-color:var(--primary-alt-bg-color);border-color:var(--primary-alt-border-color)}.thwcfd-wrap .btn-danger{color:#fff;background-color:#f44336;border-color:#c3352b}.thwcfd-wrap .btn:disabled,.thwcfd-wrap .btn[disabled]{color:#cbcbcb;border-color:#cbcbcb;background-color:#fcfcfc;cursor:default}.thwcfd-checkbox{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.thwcfd-checkbox .cb-input,.thwcfd-radio .rb-input{display:block;height:0;margin:0;opacity:0;line-height:normal;box-sizing:border-box;overflow:hidden}.thwcfd-checkbox .cb-el{width:16px;margin-top:2px;margin-right:8px;height:16px;background:#fff;border-radius:2px;float:left;transition:.3s;cursor:pointer;border:1px solid #ccc}.thwcfd-checkbox .cb-el::after{content:'';display:block;width:6px;height:11px;opacity:0;transition:.2s;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) scale(1.5);margin:0 0 0 4px}.thwcfd-checkbox .cb-label{font-size:14px;cursor:pointer;white-space:normal;display:inline-block;font-weight:400;vertical-align:middle}.thwcfd-checkbox :checked+.cb-el{background:#528ff0;border-color:#528ff0}.thwcfd-checkbox :checked+.cb-el::after{opacity:1;transform:rotate(45deg)}.thwcfd-input-wrap{font-weight:400;display:block;margin:24px 0 8px;position:relative}.thwcfd-input-wrap .label{float:left;width:172px;text-align:right;margin-bottom:4px;font-weight:700;position:relative}.thwcfd-input-wrap.required .label::after{content:'*';font-size:12px;position:absolute;margin-left:1px;top:0;color:#f05050}.thwcfd-input-wrap .content{margin-left:190px;position:relative}.thwcfd-input-wrap.small .iel-wrapper{width:260px}.thwcfd-input-wrap .thwcfd-inputtext,.thwcfd-input-wrap .thwcfd-select{width:100%}.thpladmin-modal-mask{position:fixed;background-color:rgba(17,30,60,.6);top:0;left:0;width:100%;height:100%;z-index:9999;overflow:scroll;transition:opacity 250ms ease-in-out}.thpladmin-modal-mask{display:none}.thpladmin-modal .modal-container{position:absolute;background:#fff;border-radius:2px;overflow:hidden;left:50%;top:50%;transform:translate(-50%,-50%);width:90%;max-width:960px;min-height:560px;height:80vh;max-height:640px;animation:appear-down 250ms ease-in-out}.thpladmin-modal .modal-close{position:absolute;color:#58666e;font-size:30px;padding:9px 12px 11px;right:8px;top:8px;line-height:20px;cursor:pointer;z-index:10;user-select:none}.thpladmin-modal .form-wizard{max-width:1024px;height:80vh;max-height:640px;min-height:560px;background:#fafafa;position:relative}.thpladmin-modal .wizard aside{padding:24px 0;width:240px;background:#fff;position:absolute;height:100%;border-right:1px solid #eee}.thpladmin-modal .wizard aside p,.thpladmin-modal .wizard aside side-title{padding:0 24px}.thpladmin-modal .wizard aside side-title{font-size:18px;font-weight:700;display:block;margin-bottom:16px}.thpladmin-modal .wizard aside ul{margin:30px 0;padding:0}.thpladmin-modal .wizard aside li{cursor:pointer;list-style:none;padding:10px 24px;margin:4px 0;color:var(--primary-text-color);position:relative}.thpladmin-modal .wizard aside li.text-primary{color:var(--primary-text-color)}.thpladmin-modal .wizard aside li.active{background:var(--primary-bg-color);color:#fff}.thpladmin-modal .wizard aside li.disabled{display:none}.thpladmin-modal .wizard aside li .dashicons{margin-right:6px;line-height:18px;vertical-align:middle}.thpladmin-modal .wizard aside li.active .dashicons::before{color:#fff}.thpladmin-modal .wizard aside li i.i-chevron-right{font-style:normal;color:#fff;position:absolute;right:8px;font-family:dashicons;opacity:0;top:50%;transform:translate(-4px,-50%);transition:.35s}.thpladmin-modal .wizard aside li.active i.i-chevron-right{opacity:1}.thpladmin-modal .form-wizard main{left:0;right:0;padding:30px;position:absolute;bottom:80px;top:0;overflow:auto}.thpladmin-modal .wizard aside~footer,.thpladmin-modal .wizard aside~main{left:240px}.thpladmin-modal .form-wizard main.main-full{bottom:0}.thpladmin-modal .form-wizard main-title{text-transform:uppercase;display:block;font-weight:600;margin-bottom:12px;font-size:14px!important}.thpladmin-modal .form-wizard .sub-title{text-transform:uppercase;font-weight:600;font-size:14px!important}.thpladmin-modal .form-wizard .device-mobile{display:none}.thpladmin-modal .form-wizard .device-desktop{display:inline}.thpladmin-modal .form-wizard footer{left:0;padding:10px 20px;right:0;background:#f6f6f6;border-top:1px solid #e0e0e0;bottom:0;position:absolute;text-align:right;z-index:99999999}.thpladmin-modal .form-wizard footer .Loader{float:left;opacity:0;transition:1s opacity;margin-top:4px;line-height:27px}.thpladmin-modal .form-wizard footer .btn-toolbar>.btn{margin-left:5px}.thpladmin-modal .form-wizard .form{margin-top:0;padding-bottom:0}.thpladmin-modal .form-wizard .data-panel-content{margin-top:30px;padding-bottom:90px}.thwcfd_pp_table{width:100%}.thwcfd_pp_table tr.disabled td.label,.thwcfd_pp_table tr.disabled td.tip{opacity:.5}.thwcfd_pp_table tr.disabled.hide{display:none}.thwcfd_pp_table td{padding:5px 10px}.thwcfd_pp_table.compact td{padding:3px 10px}.thwcfd_pp_table td.h-separator{padding:20px 0!important}.thwcfd_pp_table td.h-separator span{display:block;height:2px;border-top:1px dashed #e6e6e6}.thwcfd_pp_table td.label{width:25%;text-align:right;padding-right:0;font-weight:700}.thwcfd_pp_table td.tip{width:16px;text-align:center;padding:0}.thwcfd_pp_table td.field{padding-left:0}.thwcfd_pp_table input[type=number],.thwcfd_pp_table input[type=text],.thwcfd_pp_table select{width:260px}.thwcfd_pp_table input[type=text].thwcfd-color{width:223px;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.thwcfd_pp_table .thpladmin-colorpickpreview{padding:9.5px 15px 8.5px 20px;border:1px solid #e2e2e2;border-radius:2px 0 0 2px;border-right:1;background-color:#fff}.product_page_th_extra_product_options_pro .select2-container .select2-selection{border-radius:2px;border:1px solid #e2e2e2;min-height:36px;padding:0 4px}.thpladmin-options-table{width:100%;margin-bottom:30px}.thpladmin-options-table input[type=text],.thpladmin-options-table select{width:100%;padding:0 6px}.thpladmin-options-table td{padding:2px 0 2px 4px}.thpladmin-options-table td.price{width:70px}.thpladmin-options-table td.price-type{width:110px}.thpladmin-options-table td.action-cell{width:100px}.thpladmin-options-table td.action-cell .btn{margin-left:6px;padding:1px 5px 2px 5px;font-size:18px;line-height:1}.thpladmin-options-table td.action-cell span.sort{cursor:move;font-size:18px;padding:0 1px 1px 1px;border-color:#999}.thpladmin-options-table td.action-cell span.sort::before{content:'\f333';content:'\f228';font-family:Dashicons;text-align:center;vertical-align:middle;line-height:1;color:#999}.thwcfd_tooltip{float:right;display:inline;position:relative;font-size:12px;height:100%;z-index:99999999}.thwcfd_tooltip img{padding:0;vertical-align:middle;cursor:help;border:medium none;height:16px;width:16px}.thwcfd_tooltip:hover:after{background:#333;background:#000;border-radius:5px;bottom:26px;color:#fff;content:attr(title);left:-100px;padding:10px 15px;position:absolute;z-index:9998;width:350px}.thwcfd_tooltip:hover:before{border:solid;border-color:#000 transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";left:50%;position:absolute;z-index:9999}.thwcfd-settings-table{width:100%}.thwcfd-settings-table td{padding:5px 0}.thwcfd-settings-table td.section-title{padding:30px 0 5px 0;text-align:left;font-weight:700;text-transform:capitalize;border-bottom:1px dashed #cecece}.thwcfd-settings-table td.label{width:22%;text-align:left;padding-right:0;font-weight:400}.thwcfd-settings-table td.label span{display:block}.thwcfd-settings-table td.label .description{font-size:.9em}.thwcfd-settings-table td.tip{width:16px;text-align:center;padding:0}.thwcfd-settings-table td.field{padding-left:0}.thwcfd-settings-table textarea{width:90%;font-size:.9em}.iris-picker{z-index:100;display:none;position:absolute!important;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.iris-picker .ui-slider{border:0!important;margin:0!important;width:auto!important;height:auto!important;background:0 0!important}.iris-picker .ui-slider .ui-slider-handle{margin-bottom:0!important}.thpladmin-colorpickpreview{padding:7px 10px 7px 20px;border:1px solid #7e8993;border-radius:4px;border-right:1;background-color:#fff;border-top-right-radius:0;border-bottom-right-radius:0}.thwcfd-wrap .thpladmin-colorpick{border-left:0!important;margin-left:0!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.select2-drop-mask{z-index:99999998!important}.select2-drop{z-index:99999999!important}.select2-container{z-index:99999999!important}.select2-container .select2-search--inline .select2-search__field{margin-top:0!important;margin-bottom:0!important;border:0!important}.select2-container .select2-search__field{min-width:0!important;background-image:none!important}.select2-results .select2-results__group{margin:0!important;padding:4px!important}.select2-results .select2-results__option{margin:0!important;padding:4px 4px 4px 8px!important;font-size:.9em}.thwcfd-wrap .select2-container .select2-selection{border-radius:2px!important;border:1px solid #e2e2e2!important;min-height:36px!important;padding:0 4px!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding:0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li{font-size:.8em!important;margin:4px 4px 0 0!important}.thwcfd-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li.select2-search{margin:0!important;height:26px!important;width:auto!important}
admin/assets/images/wp-plugins/advanced-faq-manager.png ADDED
Binary file
admin/assets/images/wp-plugins/checkout-field-editor.png ADDED
Binary file
admin/assets/images/wp-plugins/discount-and-dynamic-pricing.png ADDED
Binary file
admin/assets/images/wp-plugins/email-customizer.png ADDED
Binary file
admin/assets/images/wp-plugins/extra-product-options.png ADDED
Binary file
admin/assets/images/wp-plugins/job-manager.png ADDED
Binary file
admin/assets/images/wp-plugins/multiple-addresses.png ADDED
Binary file
admin/assets/images/wp-plugins/multistep-checkout.png ADDED
Binary file
admin/assets/images/wp-plugins/product-feature-request.png ADDED
Binary file
admin/assets/images/wp-plugins/variation-swatches.png ADDED
Binary file
admin/assets/images/wp-plugins/wishlist-compare.png ADDED
Binary file
admin/assets/js/thwcfd-admin.js CHANGED
@@ -1,6 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  var thwcfd_base = (function($, window, document) {
2
  'use strict';
3
 
 
 
 
 
 
 
4
  function escapeHTML(html) {
5
  var fn = function(tag) {
6
  var charsToReplace = {
@@ -392,11 +513,16 @@ function thwcfdWizardNext(elm){
392
  function thwcfdWizardPrevious(elm){
393
  thwcfd_base.form_wizard_previous(elm);
394
  }
395
-
396
  var thwcfd_settings_field = (function($, window, document) {
397
  'use strict';
398
 
399
- var MSG_INVALID_NAME = 'NAME/ID must begin with a lowercase letter ([a-z]) or underscores ("_") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores ("_")';
 
 
 
 
 
 
400
  var SPECIAL_FIELD_TYPES = ["country", "state", "city"];
401
 
402
  var FIELD_FORM_PROPS = {
@@ -445,7 +571,7 @@ var thwcfd_settings_field = (function($, window, document) {
445
  }
446
 
447
  function populate_field_form(popup, form, action, elm, sname){
448
- var title = action === 'edit' ? 'Edit Field' : 'New Field';
449
  popup.find('.wizard-title').text(title);
450
 
451
  form.find('.err_msgs').html('');
@@ -696,9 +822,9 @@ var thwcfd_settings_field = (function($, window, document) {
696
 
697
  if(option_values.length>0 && fvalue !='' && (ftype == 'select' || ftype == 'radio') ){
698
  if(!(option_values.includes(fvalue))){
699
- err_msgs = 'Only default value that given as an option value is allowed';
700
  }
701
- }
702
 
703
  if(err_msgs != ''){
704
  form.find('.err_msgs').html(err_msgs);
@@ -775,11 +901,11 @@ var thwcfd_settings_field = (function($, window, document) {
775
  }
776
 
777
  var html = '<tr>';
778
- html += '<td class="key"><input type="text" name="i_options_key[]" value="'+key+'" placeholder="Option Value"></td>';
779
- html += '<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="Option Text"></td>';
780
  html += '<td class="action-cell">';
781
- html += '<a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="Add new option">+</a>';
782
- html += '<a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="Remove option">x</a>';
783
  html += '<span class="btn btn-tiny sort ui-sortable-handle"></span></td>';
784
  html += '</tr>';
785
 
@@ -850,6 +976,12 @@ function thwcfdSaveField(elm){
850
 
851
  var thwcfd_settings = (function($, window, document) {
852
  'use strict';
 
 
 
 
 
 
853
 
854
  $(function() {
855
  var settings_form = $('#thwcfd_checkout_fields_form');
@@ -876,7 +1008,7 @@ var thwcfd_settings = (function($, window, document) {
876
  $(document).ready(function(){
877
  setTimeout(function(){
878
  $("#thwcfd_review_request_notice").fadeIn(500);
879
- }, 2000);
880
  });
881
 
882
  $(document).keypress(function(e) {
@@ -915,7 +1047,7 @@ var thwcfd_settings = (function($, window, document) {
915
  }
916
 
917
  //row.find(".f_edit_btn").prop('disabled', enabled == 1 ? false : true);
918
- row.find(".td_enabled").html(enabled == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="Yes"></span>' : '-');
919
  row.find(".f_enabled").val(enabled);
920
  });
921
  }
1
+ ( function ( wp, $ ) {
2
+ 'use strict';
3
+
4
+ if ( ! wp ) {
5
+ return;
6
+ }
7
+
8
+ $( function () {
9
+ $( document ).on( 'click', '.th-plugin-action.install-now', function ( event ) {
10
+ const $button = $( event.target );
11
+
12
+ if ( $button.hasClass( 'activate-now' ) ) {
13
+ return true;
14
+ }
15
+
16
+ event.preventDefault();
17
+
18
+ if (
19
+ $button.hasClass( 'updating-message' ) ||
20
+ $button.hasClass( 'button-disabled' )
21
+ ) {
22
+ return;
23
+ }
24
+
25
+ if (
26
+ wp.updates.shouldRequestFilesystemCredentials &&
27
+ ! wp.updates.ajaxLocked
28
+ ) {
29
+ wp.updates.requestFilesystemCredentials( event );
30
+
31
+ $( document ).on( 'credential-modal-cancel', function () {
32
+ const $message = $( '.install-now.updating-message' );
33
+
34
+ $message
35
+ .removeClass( 'updating-message' )
36
+ .text( wp.updates.l10n.installNow );
37
+
38
+ wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
39
+ } );
40
+ }
41
+
42
+ wp.updates.installPlugin( {
43
+ slug: $button.data( 'slug' ),
44
+ } );
45
+ } );
46
+ } );
47
+ } )( window.wp, jQuery );
48
+
49
+
50
+
51
+ var thwcfd_plugins_list = (function($, window, document) {
52
+ 'use strict';
53
+
54
+ $( function () {
55
+ $( document ).on( 'click', '.th-plugin-action.activate-now', function ( event ) {
56
+
57
+ const $button = $( event.target );
58
+
59
+ event.preventDefault();
60
+
61
+ if (
62
+ $button.hasClass( 'updating-message' ) ||
63
+ $button.hasClass( 'button-disabled' )
64
+ ) {
65
+ return;
66
+ }
67
+
68
+ var url_string = $button.attr('href');
69
+ var url = new URL(url_string);
70
+ var file = url.searchParams.get("plugin");
71
+ var nonce = url.searchParams.get("_wpnonce");
72
+ var action = url.searchParams.get("action");
73
+
74
+ if(action == 'activate'){
75
+ action = 'th_activate_plugin';
76
+ }
77
+
78
+ if(file == null || nonce == null || action == null){
79
+ return;
80
+ }
81
+
82
+ var data = {
83
+ 'action': action,
84
+ 'file': file,
85
+ '_wpnonce': nonce,
86
+ };
87
+
88
+ jQuery.ajax({
89
+ type: "post",
90
+ dataType: "json",
91
+ url: ajaxurl,
92
+ data: data,
93
+ beforeSend: function(){
94
+ $button.addClass('updating-message');
95
+ $button.text('Activating');
96
+ },
97
+ success: function(data){
98
+ $button.removeClass('updating-message');
99
+ if(data == true){
100
+ $button.text('Activated');
101
+ $button.addClass('disabled');
102
+ }else{
103
+ $button.text('Failed');
104
+ $button.addClass('disabled');
105
+ }
106
+ },
107
+ error: function(xhr){
108
+ $button.text('Failed');
109
+ $button.addClass('disabled');
110
+ },
111
+ });
112
+ } );
113
+ } );
114
+
115
+ }(window.jQuery, window, document));
116
  var thwcfd_base = (function($, window, document) {
117
  'use strict';
118
 
119
+ var _wp$i18n = wp.i18n;
120
+ var __ = _wp$i18n.__;
121
+ var _x = _wp$i18n._x;
122
+ var _n = _wp$i18n._n;
123
+ var _nx = _wp$i18n._nx;
124
+
125
  function escapeHTML(html) {
126
  var fn = function(tag) {
127
  var charsToReplace = {
513
  function thwcfdWizardPrevious(elm){
514
  thwcfd_base.form_wizard_previous(elm);
515
  }
 
516
  var thwcfd_settings_field = (function($, window, document) {
517
  'use strict';
518
 
519
+ var _wp$i18n = wp.i18n;
520
+ var __ = _wp$i18n.__;
521
+ var _x = _wp$i18n._x;
522
+ var _n = _wp$i18n._n;
523
+ var _nx = _wp$i18n._nx;
524
+
525
+ var MSG_INVALID_NAME = __('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');
526
  var SPECIAL_FIELD_TYPES = ["country", "state", "city"];
527
 
528
  var FIELD_FORM_PROPS = {
571
  }
572
 
573
  function populate_field_form(popup, form, action, elm, sname){
574
+ var title = action === 'edit' ? __('Edit Field', 'woo-checkout-field-editor-pro') : __('New Field', 'woo-checkout-field-editor-pro');
575
  popup.find('.wizard-title').text(title);
576
 
577
  form.find('.err_msgs').html('');
822
 
823
  if(option_values.length>0 && fvalue !='' && (ftype == 'select' || ftype == 'radio') ){
824
  if(!(option_values.includes(fvalue))){
825
+ err_msgs = __('Enter a value given in the options.', 'woo-checkout-field-editor-pro');
826
  }
827
+ }
828
 
829
  if(err_msgs != ''){
830
  form.find('.err_msgs').html(err_msgs);
901
  }
902
 
903
  var html = '<tr>';
904
+ html += '<td class="key"><input type="text" name="i_options_key[]" value="'+key+'" placeholder="' + __('Option Value' , 'woo-checkout-field-editor-pro') + '"></td>';
905
+ html += '<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="' + __('Option Text', 'woo-checkout-field-editor-pro') + '"></td>';
906
  html += '<td class="action-cell">';
907
+ 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>';
908
+ 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>';
909
  html += '<span class="btn btn-tiny sort ui-sortable-handle"></span></td>';
910
  html += '</tr>';
911
 
976
 
977
  var thwcfd_settings = (function($, window, document) {
978
  'use strict';
979
+
980
+ var _wp$i18n = wp.i18n;
981
+ var __ = _wp$i18n.__;
982
+ var _x = _wp$i18n._x;
983
+ var _n = _wp$i18n._n;
984
+ var _nx = _wp$i18n._nx;
985
 
986
  $(function() {
987
  var settings_form = $('#thwcfd_checkout_fields_form');
1008
  $(document).ready(function(){
1009
  setTimeout(function(){
1010
  $("#thwcfd_review_request_notice").fadeIn(500);
1011
+ }, 160);
1012
  });
1013
 
1014
  $(document).keypress(function(e) {
1047
  }
1048
 
1049
  //row.find(".f_edit_btn").prop('disabled', enabled == 1 ? false : true);
1050
+ row.find(".td_enabled").html(enabled == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="'+ __('Yes', 'woo-checkout-field-editor-pro') +'"></span>' : '-');
1051
  row.find(".f_enabled").val(enabled);
1052
  });
1053
  }
admin/assets/js/thwcfd-admin.min.js CHANGED
@@ -1 +1 @@
1
- function thwcfdSetupEnhancedMultiSelectWithValue(elm){thwcfd_base.setupEnhancedMultiSelectWithValue(elm)}function thwcfdSetupSortableTable(parent,elm,left){thwcfd_base.setupSortableTable(parent,elm,left)}function thwcfdCloseModal(elm){thwcfd_base.form_wizard_close(elm)}function thwcfdWizardNext(elm){thwcfd_base.form_wizard_next(elm)}function thwcfdWizardPrevious(elm){thwcfd_base.form_wizard_previous(elm)}function thwcfdOpenNewFieldForm(sectionName){thwcfd_settings_field.openNewFieldForm(sectionName)}function thwcfdOpenEditFieldForm(elm,rowId){thwcfd_settings_field.openEditFieldForm(elm,rowId)}function thwcfdOpenCopyFieldForm(elm,rowId){thwcfd_settings_field.openCopyFieldForm(elm,rowId)}function thwcfdFieldTypeChangeListner(elm){thwcfd_settings_field.fieldTypeChangeListner(elm)}function thwcfdAddNewOptionRow(elm){thwcfd_settings_field.addNewOptionRow(elm)}function thwcfdRemoveOptionRow(elm){thwcfd_settings_field.removeOptionRow(elm)}function thwcfdSaveField(elm){thwcfd_settings_field.save_field(elm)}function thwcfdSelectAllCheckoutFields(elm){thwcfd_settings.selectAllFields(elm)}function thwcfdRemoveSelectedFields(){thwcfd_settings.removeSelectedFields()}function thwcfdEnableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(1)}function thwcfdDisableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(0)}function thwcfdHideReviewRequestNotice(elm){thwcfd_settings.hideReviewRequestNotice(elm)}var 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 active_tab=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":"New Field";if(popup.find(".wizard-title").text(title),form.find(".err_msgs").html(""),form.find("input[name=f_action]").val(action),"new"===action)"billing"!=sname&&"shipping"!=sname&&"additional"!=sname||(sname+="_"),clear_field_form_general(form),form.find("select[name=i_type]").change(),thwcfd_base.set_property_field_value(form,"text","name",sname,0),thwcfd_base.set_property_field_value(form,"text","class","form-row-wide",0);else{var row=$(elm).closest("tr"),props_json=row.find(".f_props").val(),props=JSON.parse(props_json);populate_field_form_general(action,form,props),form.find("select[name=i_type]").change(),populate_field_form_props(form,row,props)}}function clear_field_form_general(form){thwcfd_base.set_property_field_value(form,"hidden","autocomplete","",0),thwcfd_base.set_property_field_value(form,"hidden","priority","",0),thwcfd_base.set_property_field_value(form,"hidden","custom","",0),thwcfd_base.set_property_field_value(form,"hidden","oname","",0),thwcfd_base.set_property_field_value(form,"hidden","otype","",0),thwcfd_base.set_property_field_value(form,"select","type","text",0),thwcfd_base.set_property_field_value(form,"text","name","",0)}function populate_field_form_general(action,form,props){var autocomplete=props.autocomplete?props.autocomplete:"",priority=props.priority?props.priority:"",custom=props.custom?props.custom:"",type=props.type?props.type:"text",name=props.name?props.name:"";"copy"===action&&(name=""),thwcfd_base.set_property_field_value(form,"hidden","autocomplete",autocomplete,0),thwcfd_base.set_property_field_value(form,"hidden","priority",priority,0),thwcfd_base.set_property_field_value(form,"hidden","custom",custom,0),thwcfd_base.set_property_field_value(form,"hidden","oname",name,0),thwcfd_base.set_property_field_value(form,"hidden","otype",type,0),thwcfd_base.set_property_field_value(form,"select","type",type,0),thwcfd_base.set_property_field_value(form,"text","name",name,0)}function populate_field_form_props(form,row,props){var ftype=props.type,custom=props.custom?props.custom:"";$.each(FIELD_FORM_PROPS,function(name,field){if("name"==name||"type"==name)return!0;var type=field.type,value=props&&props[name]?props[name]:"";"textarea"==ftype&&"default"==name&&(type="textarea"),thwcfd_base.set_property_field_value(form,type,name,value,field.multiple),"select"==type?(name=1==field.multiple?name+"[]":name,1!=field.multiple&&1!=field.change||form.find('select[name="i_'+name+'"]').trigger("change")):"checkbox"==type&&1==field.change&&form.find('input[name="i_'+name+'"]').trigger("change")});var optionsJson=row.find(".f_options").val();populate_options_list(form,optionsJson),1==custom?(form.find("input[name=i_name]").prop("disabled",!1),form.find("select[name=i_type]").prop("disabled",!1),form.find("input[name=i_show_in_email]").prop("disabled",!1),form.find("input[name=i_show_in_order]").prop("disabled",!1)):(thwcfd_base.set_property_field_value(form,"checkbox","show_in_email",!0,0),thwcfd_base.set_property_field_value(form,"checkbox","show_in_order",!0,0),form.find("input[name=i_name]").prop("disabled",!0),form.find("select[name=i_type]").prop("disabled",!0),form.find("input[name=i_show_in_email]").prop("disabled",!0),form.find("input[name=i_show_in_order]").prop("disabled",!0),form.find("input[name=i_label]").focus())}function field_type_change_listner(elm){var popup=$("#thwcfd_field_form_pp"),form=$(elm).closest("form"),type=$(elm).val();type=null==type?"text":type,form.find(".thwcfd_field_form_tab_general_placeholder").html($("#thwcfd_field_form_id_"+type).html()),enable_all_tabs_and_fields(popup,form),type in FIELDS_TO_HIDE&&$.each(FIELDS_TO_HIDE[type],function(index,name){if(FIELD_FORM_PROPS[name]){var f_props=FIELD_FORM_PROPS[name];disable_hide_field(form,f_props.type,name)}}),thwcfd_base.setupEnhancedMultiSelect(form),thwcfd_base.setupColorPicker(form),thwcfd_base.setupSortableTable(form,".thwcfd-option-list","100")}function enable_all_tabs_and_fields(popup,form){thwcfd_base.form_wizard_enable_all_tabs(popup),form.find(":input").attr("disabled",!1),form.find("tr").removeClass("disabled hide")}function enable_disable_field(form,type,name,enabled,hide){var elm=null;switch(type){case"select":elm=form.find('select[name="i_'+name+'"]'),0==elm.length&&(elm=form.find('select[name="i_'+name+'[]"]'));break;case"textarea":elm=form.find("textarea[name=i_"+name+"]"),0==elm.length&&(elm=form.find('textarea[name="i_'+name+'[]"]'));break;default:elm=form.find("input[name=i_"+name+"]"),0==elm.length&&(elm=form.find('input[name="i_'+name+'[]"]'))}if(elm&&elm.length){var rowClass=hide?"disabled hide":"disabled";enabled?(elm.attr("disabled",!1),elm.closest("tr.form_field_"+name).removeClass("disabled hide")):(elm.attr("disabled",!0),elm.closest("tr.form_field_"+name).addClass(rowClass))}}function disable_hide_field(form,type,name){enable_disable_field(form,type,name,!1,!0)}function save_field(elm){var popup=$("#thwcfd_field_form_pp"),form=$("#thwcfd_field_form");validate_field_form(form,popup)&&(prepare_field_form(form),form.submit())}function validate_field_form(form,popup){var err_msgs="",fname=thwcfd_base.get_property_field_value(form,"text","name"),ftype=thwcfd_base.get_property_field_value(form,"select","type"),fotype=(thwcfd_base.get_property_field_value(form,"text","label"),thwcfd_base.get_property_field_value(form,"hidden","otype")),fvalue=thwcfd_base.get_property_field_value(form,"text","default"),option_values=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get();return""==ftype&&-1==$.inArray(fotype,SPECIAL_FIELD_TYPES)?err_msgs="Type is required":""==fname?err_msgs="Name is required":thwcfd_base.isHtmlIdValid(fname)||(err_msgs=MSG_INVALID_NAME),option_values.length>0&&""!=fvalue&&("select"==ftype||"radio"==ftype)&&(option_values.includes(fvalue)||(err_msgs="Only default value that given as an option value is allowed")),""==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"></td>',html+='<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="Option Text"></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">+</a>',html+='<a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="Remove option">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 MSG_INVALID_NAME='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 ("_")',SPECIAL_FIELD_TYPES=["country","state","city"],FIELD_FORM_PROPS={name:{name:"name",type:"text"},type:{name:"type",type:"select"},label:{name:"label",type:"text"},default:{name:"default",type:"text"},placeholder:{name:"placeholder",type:"text"},class:{name:"class",type:"text"},validate:{name:"validate",type:"select",multiple:1},required:{name:"required",type:"checkbox"},enabled:{name:"enabled",type:"checkbox"},show_in_email:{name:"show_in_email",type:"checkbox"},show_in_order:{name:"show_in_order",type:"checkbox"}},FIELDS_TO_HIDE={radio:["placeholder","validate"],select:["validate"],password:["default"]};return{openNewFieldForm:open_new_field_form,openEditFieldForm:open_edit_field_form,openCopyFieldForm:open_copy_field_form,fieldTypeChangeListner:field_type_change_listner,addNewOptionRow:add_new_option_row,removeOptionRow:remove_option_row,save_field:save_field}}(window.jQuery,window,document),thwcfd_settings=function($,window,document){"use strict";function select_all_fields(elm){var checkAll=$(elm).prop("checked");$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]").prop("checked",checkAll)}function remove_selected_fields(){$("#thwcfd_checkout_fields tbody tr").removeClass("strikeout"),$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");row.hasClass("strikeout")||row.addClass("strikeout"),row.find(".f_deleted").val(1)})}function enable_disable_selected_fields(enabled){$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");0==enabled?row.hasClass("thpladmin-disabled")||row.addClass("thpladmin-disabled"):row.removeClass("thpladmin-disabled"),row.find(".td_enabled").html(1==enabled?'<span class="dashicons dashicons-yes tips" data-tip="Yes"></span>':"-"),row.find(".f_enabled").val(enabled)})}function hide_review_request_notice(elm){var wrapper=$(elm).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),data={thwcfd_security_review_notice:nonce,action:"skip_thwcfd_review_request_notice"};$.post(ajaxurl,data,function(){}),$(wrapper).hide(50)}return $(function(){var settings_form=$("#thwcfd_checkout_fields_form");thwcfd_base.setupSortableTable(settings_form,"#thwcfd_checkout_fields","0"),thwcfd_base.setup_tiptip_tooltips(),thwcfd_base.setup_form_wizard()}),$(document).on("click",".thpladmin-notice .notice-dismiss",function(){var wrapper=$(this).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),action=wrapper.data("action"),data={thwcfd_security_review_notice:nonce,action:action};$.post(ajaxurl,data,function(){})}),$(document).ready(function(){setTimeout(function(){$("#thwcfd_review_request_notice").fadeIn(500)},2e3)}),$(document).keypress(function(e){!$("#thwcfd_field_form_pp").is(":visible")||13!=e.keycode&&13!=e.which||(e.preventDefault(),thwcfdSaveField(this))}),{selectAllFields:select_all_fields,removeSelectedFields:remove_selected_fields,enableDisableSelectedFields:enable_disable_selected_fields,hideReviewRequestNotice:hide_review_request_notice}}(window.jQuery,window,document);
1
+ function thwcfdSetupEnhancedMultiSelectWithValue(elm){thwcfd_base.setupEnhancedMultiSelectWithValue(elm)}function thwcfdSetupSortableTable(parent,elm,left){thwcfd_base.setupSortableTable(parent,elm,left)}function thwcfdCloseModal(elm){thwcfd_base.form_wizard_close(elm)}function thwcfdWizardNext(elm){thwcfd_base.form_wizard_next(elm)}function thwcfdWizardPrevious(elm){thwcfd_base.form_wizard_previous(elm)}function thwcfdOpenNewFieldForm(sectionName){thwcfd_settings_field.openNewFieldForm(sectionName)}function thwcfdOpenEditFieldForm(elm,rowId){thwcfd_settings_field.openEditFieldForm(elm,rowId)}function thwcfdOpenCopyFieldForm(elm,rowId){thwcfd_settings_field.openCopyFieldForm(elm,rowId)}function thwcfdFieldTypeChangeListner(elm){thwcfd_settings_field.fieldTypeChangeListner(elm)}function thwcfdAddNewOptionRow(elm){thwcfd_settings_field.addNewOptionRow(elm)}function thwcfdRemoveOptionRow(elm){thwcfd_settings_field.removeOptionRow(elm)}function thwcfdSaveField(elm){thwcfd_settings_field.save_field(elm)}function thwcfdSelectAllCheckoutFields(elm){thwcfd_settings.selectAllFields(elm)}function thwcfdRemoveSelectedFields(){thwcfd_settings.removeSelectedFields()}function thwcfdEnableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(1)}function thwcfdDisableSelectedFields(){thwcfd_settings.enableDisableSelectedFields(0)}function thwcfdHideReviewRequestNotice(elm){thwcfd_settings.hideReviewRequestNotice(elm)}!function(wp,$){"use strict";wp&&$(function(){$(document).on("click",".th-plugin-action.install-now",function(event){const $button=$(event.target);if($button.hasClass("activate-now"))return!0;event.preventDefault(),$button.hasClass("updating-message")||$button.hasClass("button-disabled")||(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(event),$(document).on("credential-modal-cancel",function(){$(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:$button.data("slug")}))})})}(window.wp,jQuery);var thwcfd_plugins_list=function($,window,document){"use strict";$(function(){$(document).on("click",".th-plugin-action.activate-now",function(event){const $button=$(event.target);if(event.preventDefault(),!$button.hasClass("updating-message")&&!$button.hasClass("button-disabled")){var url_string=$button.attr("href"),url=new URL(url_string),file=url.searchParams.get("plugin"),nonce=url.searchParams.get("_wpnonce"),action=url.searchParams.get("action");if("activate"==action&&(action="th_activate_plugin"),null!=file&&null!=nonce&&null!=action){var data={action:action,file:file,_wpnonce:nonce};jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:data,beforeSend:function(){$button.addClass("updating-message"),$button.text("Activating")},success:function(data){$button.removeClass("updating-message"),1==data?($button.text("Activated"),$button.addClass("disabled")):($button.text("Failed"),$button.addClass("disabled"))},error:function(xhr){$button.text("Failed"),$button.addClass("disabled")}})}}})})}(window.jQuery,window,document),thwcfd_base=function($,window,document){"use strict";function escapeHTML(html){var fn=function(tag){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;"}[tag]||tag};return html.replace(/[&<>"]/g,fn)}function decodeHtml(str){if(str&&"string"==typeof str){var map={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#039;":"'"};return str.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,function(m){return map[m]})}return str}function isHtmlIdValid(id){return/^[a-z\_]+[a-z0-9\_]*$/.test(id.trim())}function isValidHexColor(value){return!!preg_match("/^#[a-f0-9]{6}$/i",value)}function is_option_field(type){var result=!1;return"select"!=type&&"multiselect"!=type&&"radio"!=type&&"checkboxgroup"!=type||(result=!0),result}function setup_tiptip_tooltips(){var tiptip_args={attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200};$(".tips").tipTip(tiptip_args)}function setup_enhanced_multi_select(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){$(this).hasClass("enhanced")||$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced")})}function setup_enhanced_multi_select_with_value(parent){parent.find("select.thwcfd-enhanced-multi-select").each(function(){if(!$(this).hasClass("enhanced")){$(this).selectWoo({allowClear:!0,placeholder:$(this).data("placeholder")}).addClass("enhanced");var value=$(this).data("value");value=value.split(","),$(this).val(value),$(this).trigger("change")}})}function setup_color_picker(form){form.find(".thpladmin-colorpick").iris({change:function(event,ui){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:ui.color.toString()})},hide:!0,border:!0}).click(function(){$(".iris-picker").hide(),$(this).closest("td").find(".iris-picker").show()}),$("body").click(function(){$(".iris-picker").hide()}),$(".thpladmin-colorpick").click(function(event){event.stopPropagation()})}function setup_color_pick_preview(form){form.find(".thpladmin-colorpick").each(function(){$(this).parent().find(".thpladmin-colorpickpreview").css({backgroundColor:this.value})})}function prepare_field_order_indexes(elm){$(elm+" tbody tr").each(function(index,el){$("input.f_order",el).val(parseInt($(el).index(elm+" tbody tr")))})}function setup_sortable_table(parent,elm,left){parent.find(elm+" tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:".sort",scrollSensitivity:40,helper:function(e,ui){return ui.children().each(function(){$(this).width($(this).width())}),ui.css("left",left),ui}}),$(elm+" tbody").on("sortstart",function(event,ui){ui.item.css("background-color","#f6f6f6")}),$(elm+" tbody").on("sortstop",function(event,ui){ui.item.removeAttr("style"),prepare_field_order_indexes(elm)})}function get_property_field_value(form,type,name){var value="";switch(type){case"select":value=form.find("select[name=i_"+name+"]").val(),value=null==value?"":value;break;case"checkbox":value=form.find("input[name=i_"+name+"]").prop("checked"),value=value?1:0;break;case"textarea":value=form.find("textarea[name=i_"+name+"]").val(),value=null==value?"":value;break;default:value=form.find("input[name=i_"+name+"]").val(),value=null==value?"":value}return value}function set_property_field_value(form,type,name,value,multiple){switch(type){case"select":1==multiple?(value="string"==typeof value?value.split(","):value,name+="[]",form.find('select[name="i_'+name+'"]').val(value).trigger("change")):form.find('select[name="i_'+name+'"]').val(value);break;case"checkbox":value=1==value||"yes"==value,form.find("input[name=i_"+name+"]").prop("checked",value);break;case"textarea":value=value?decodeHtml(value):value,form.find("textarea[name=i_"+name+"]").val(value);break;case"colorpicker":var bg_color=value?{backgroundColor:value}:{};form.find("input[name=i_"+name+"]").val(value),form.find("."+name+"_preview").css(bg_color);break;default:value=value?decodeHtml(value):value,form.find("input[name=i_"+name+"]").val(value)}}function setup_form_wizard(){$(".pp_nav_links > li").click(function(){var index=$(this).data("index");open_tab($(this).closest(".thpladmin-modal-mask"),$(this),index),active_tab=index})}function get_popup(elm){return $(elm).closest(".thpladmin-modal-mask")}function get_active_tab(popup){return popup.find("ul.pp_nav_links").find("li.active")}function get_next_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.nextAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function get_prev_tab_index(elm){var popup=get_popup(elm),active=get_active_tab(popup),link=active.prevAll("li").not(".disabled").first();return link.length?link.data("index"):active_tab}function form_wizard_open(popup){active_tab=0,popup.find("ul.pp_nav_links li").first().click(),popup.css("display","block")}function form_wizard_close(elm){get_popup(elm).css("display","none"),active_tab=0}function form_wizard_next(elm){active_tab=get_next_tab_index(elm),move_to(elm,active_tab)}function form_wizard_previous(elm){active_tab=get_prev_tab_index(elm),move_to(elm,active_tab)}function form_wizard_start(elm){active_tab=0,move_to(elm,active_tab)}function move_to(elm,index){var popup=get_popup(elm);open_tab(popup,popup.find('*[data-index="'+index+'"]'),index)}function open_tab(popup,link,index){var panel=popup.find(".data_panel_"+index);close_all_data_panel(popup),link.addClass("active"),panel.css("display","block"),enable_disable_btns(popup,link)}function close_all_data_panel(popup){popup.find(".pp_nav_links > li").removeClass("active"),popup.find(".data-panel").css("display","none")}function enable_disable_tab(popup,index,disable){var link=popup.find('*[data-index="'+index+'"]'),panel=popup.find(".data_panel_"+index);disable?(link.addClass("disabled"),panel.find(":input").attr("disabled",!0)):(link.removeClass("disabled"),panel.find(":input").attr("disabled",!1))}function form_wizard_enable_tab(popup,index){enable_disable_tab(popup,index,0)}function form_wizard_disable_tab(popup,index){enable_disable_tab(popup,index,1)}function form_wizard_enable_all_tabs(popup){popup.find(".pp_nav_links > li").removeClass("disabled")}function enable_disable_btns(popup,link){var nextBtn=popup.find(".next-btn"),prevBtn=popup.find(".prev-btn");link.hasClass("first")?(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!0)):link.hasClass("last")?(nextBtn.prop("disabled",!0),prevBtn.prop("disabled",!1)):(nextBtn.prop("disabled",!1),prevBtn.prop("disabled",!1))}var _wp$i18n=wp.i18n,active_tab=(_wp$i18n.__,_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,0);return{escapeHTML:escapeHTML,decodeHtml:decodeHtml,isHtmlIdValid:isHtmlIdValid,isValidHexColor:isValidHexColor,is_option_field:is_option_field,setup_tiptip_tooltips:setup_tiptip_tooltips,setupEnhancedMultiSelect:setup_enhanced_multi_select,setupEnhancedMultiSelectWithValue:setup_enhanced_multi_select_with_value,setupColorPicker:setup_color_picker,setup_color_pick_preview:setup_color_pick_preview,setupSortableTable:setup_sortable_table,get_property_field_value:get_property_field_value,set_property_field_value:set_property_field_value,setup_form_wizard:setup_form_wizard,form_wizard_open:form_wizard_open,form_wizard_close:form_wizard_close,form_wizard_next:form_wizard_next,form_wizard_previous:form_wizard_previous,form_wizard_start:form_wizard_start,form_wizard_enable_tab:form_wizard_enable_tab,form_wizard_disable_tab:form_wizard_disable_tab,form_wizard_enable_all_tabs:form_wizard_enable_all_tabs}}(window.jQuery,window,document),thwcfd_settings_field=function($,window,document){"use strict";function open_new_field_form(sname){open_field_form("new",!1,sname)}function open_edit_field_form(elm,rowId){open_field_form("edit",elm,!1)}function open_copy_field_form(elm,rowId){open_field_form("copy",elm,!1)}function open_field_form(type,elm,sname){var popup=$("#thwcfd_field_form_pp");populate_field_form(popup,$("#thwcfd_field_form"),type,elm,sname),thwcfd_base.form_wizard_open(popup)}function populate_field_form(popup,form,action,elm,sname){var title="edit"===action?__("Edit Field","woo-checkout-field-editor-pro"):__("New Field","woo-checkout-field-editor-pro");if(popup.find(".wizard-title").text(title),form.find(".err_msgs").html(""),form.find("input[name=f_action]").val(action),"new"===action)"billing"!=sname&&"shipping"!=sname&&"additional"!=sname||(sname+="_"),clear_field_form_general(form),form.find("select[name=i_type]").change(),thwcfd_base.set_property_field_value(form,"text","name",sname,0),thwcfd_base.set_property_field_value(form,"text","class","form-row-wide",0);else{var row=$(elm).closest("tr"),props_json=row.find(".f_props").val(),props=JSON.parse(props_json);populate_field_form_general(action,form,props),form.find("select[name=i_type]").change(),populate_field_form_props(form,row,props)}}function clear_field_form_general(form){thwcfd_base.set_property_field_value(form,"hidden","autocomplete","",0),thwcfd_base.set_property_field_value(form,"hidden","priority","",0),thwcfd_base.set_property_field_value(form,"hidden","custom","",0),thwcfd_base.set_property_field_value(form,"hidden","oname","",0),thwcfd_base.set_property_field_value(form,"hidden","otype","",0),thwcfd_base.set_property_field_value(form,"select","type","text",0),thwcfd_base.set_property_field_value(form,"text","name","",0)}function populate_field_form_general(action,form,props){var autocomplete=props.autocomplete?props.autocomplete:"",priority=props.priority?props.priority:"",custom=props.custom?props.custom:"",type=props.type?props.type:"text",name=props.name?props.name:"";"copy"===action&&(name=""),thwcfd_base.set_property_field_value(form,"hidden","autocomplete",autocomplete,0),thwcfd_base.set_property_field_value(form,"hidden","priority",priority,0),thwcfd_base.set_property_field_value(form,"hidden","custom",custom,0),thwcfd_base.set_property_field_value(form,"hidden","oname",name,0),thwcfd_base.set_property_field_value(form,"hidden","otype",type,0),thwcfd_base.set_property_field_value(form,"select","type",type,0),thwcfd_base.set_property_field_value(form,"text","name",name,0)}function populate_field_form_props(form,row,props){var ftype=props.type,custom=props.custom?props.custom:"";$.each(FIELD_FORM_PROPS,function(name,field){if("name"==name||"type"==name)return!0;var type=field.type,value=props&&props[name]?props[name]:"";"textarea"==ftype&&"default"==name&&(type="textarea"),thwcfd_base.set_property_field_value(form,type,name,value,field.multiple),"select"==type?(name=1==field.multiple?name+"[]":name,1!=field.multiple&&1!=field.change||form.find('select[name="i_'+name+'"]').trigger("change")):"checkbox"==type&&1==field.change&&form.find('input[name="i_'+name+'"]').trigger("change")});var optionsJson=row.find(".f_options").val();populate_options_list(form,optionsJson),1==custom?(form.find("input[name=i_name]").prop("disabled",!1),form.find("select[name=i_type]").prop("disabled",!1),form.find("input[name=i_show_in_email]").prop("disabled",!1),form.find("input[name=i_show_in_order]").prop("disabled",!1)):(thwcfd_base.set_property_field_value(form,"checkbox","show_in_email",!0,0),thwcfd_base.set_property_field_value(form,"checkbox","show_in_order",!0,0),form.find("input[name=i_name]").prop("disabled",!0),form.find("select[name=i_type]").prop("disabled",!0),form.find("input[name=i_show_in_email]").prop("disabled",!0),form.find("input[name=i_show_in_order]").prop("disabled",!0),form.find("input[name=i_label]").focus())}function field_type_change_listner(elm){var popup=$("#thwcfd_field_form_pp"),form=$(elm).closest("form"),type=$(elm).val();type=null==type?"text":type,form.find(".thwcfd_field_form_tab_general_placeholder").html($("#thwcfd_field_form_id_"+type).html()),enable_all_tabs_and_fields(popup,form),type in FIELDS_TO_HIDE&&$.each(FIELDS_TO_HIDE[type],function(index,name){if(FIELD_FORM_PROPS[name]){var f_props=FIELD_FORM_PROPS[name];disable_hide_field(form,f_props.type,name)}}),thwcfd_base.setupEnhancedMultiSelect(form),thwcfd_base.setupColorPicker(form),thwcfd_base.setupSortableTable(form,".thwcfd-option-list","100")}function enable_all_tabs_and_fields(popup,form){thwcfd_base.form_wizard_enable_all_tabs(popup),form.find(":input").attr("disabled",!1),form.find("tr").removeClass("disabled hide")}function enable_disable_field(form,type,name,enabled,hide){var elm=null;switch(type){case"select":elm=form.find('select[name="i_'+name+'"]'),0==elm.length&&(elm=form.find('select[name="i_'+name+'[]"]'));break;case"textarea":elm=form.find("textarea[name=i_"+name+"]"),0==elm.length&&(elm=form.find('textarea[name="i_'+name+'[]"]'));break;default:elm=form.find("input[name=i_"+name+"]"),0==elm.length&&(elm=form.find('input[name="i_'+name+'[]"]'))}if(elm&&elm.length){var rowClass=hide?"disabled hide":"disabled";enabled?(elm.attr("disabled",!1),elm.closest("tr.form_field_"+name).removeClass("disabled hide")):(elm.attr("disabled",!0),elm.closest("tr.form_field_"+name).addClass(rowClass))}}function disable_hide_field(form,type,name){enable_disable_field(form,type,name,!1,!0)}function save_field(elm){var popup=$("#thwcfd_field_form_pp"),form=$("#thwcfd_field_form");validate_field_form(form,popup)&&(prepare_field_form(form),form.submit())}function validate_field_form(form,popup){var err_msgs="",fname=thwcfd_base.get_property_field_value(form,"text","name"),ftype=thwcfd_base.get_property_field_value(form,"select","type"),fotype=(thwcfd_base.get_property_field_value(form,"text","label"),thwcfd_base.get_property_field_value(form,"hidden","otype")),fvalue=thwcfd_base.get_property_field_value(form,"text","default"),option_values=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get();return""==ftype&&-1==$.inArray(fotype,SPECIAL_FIELD_TYPES)?err_msgs="Type is required":""==fname?err_msgs="Name is required":thwcfd_base.isHtmlIdValid(fname)||(err_msgs=MSG_INVALID_NAME),option_values.length>0&&""!=fvalue&&("select"==ftype||"radio"==ftype)&&(option_values.includes(fvalue)||(err_msgs=__("Enter a value given in the options.","woo-checkout-field-editor-pro"))),""==err_msgs||(form.find(".err_msgs").html(err_msgs),thwcfd_base.form_wizard_start(popup),!1)}function prepare_field_form(form){var options_json=get_options(form);thwcfd_base.set_property_field_value(form,"hidden","options_json",options_json,0)}function get_options(form){for(var optionsKey=form.find("input[name='i_options_key[]']").map(function(){return $(this).val()}).get(),optionsText=form.find("input[name='i_options_text[]']").map(function(){return $(this).val()}).get(),optionsSize=optionsText.length,optionsArr=[],i=0;i<optionsSize;i++){var optionDetails={};optionDetails.key=optionsKey[i],optionDetails.text=optionsText[i],optionsArr.push(optionDetails)}var optionsJson=optionsArr.length>0?JSON.stringify(optionsArr):"";return optionsJson=encodeURIComponent(optionsJson)}function populate_options_list(form,optionsJson){var optionsHtml="";if(optionsJson)try{optionsJson=decodeURIComponent(optionsJson);var optionsList=$.parseJSON(optionsJson);optionsList&&jQuery.each(optionsList,function(){optionsHtml+=prepare_option_row_html(this)})}catch(err){console.log(err)}var optionsTable=form.find(".thwcfd-option-list tbody");optionsHtml?optionsTable.html(optionsHtml):optionsTable.html(prepare_option_row_html(null))}function prepare_option_row_html(option){var key="",text="";option&&(key=option.key?option.key:"",text=option.text?option.text:"");var html="<tr>";return html+='<td class="key"><input type="text" name="i_options_key[]" value="'+key+'" placeholder="'+__("Option Value","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="value"><input type="text" name="i_options_text[]" value="'+text+'" placeholder="'+__("Option Text","woo-checkout-field-editor-pro")+'"></td>',html+='<td class="action-cell">',html+='<a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="'+__("Add new option","woo-checkout-field-editor-pro")+'">+</a>',html+='<a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="'+__("Remove option","woo-checkout-field-editor-pro")+'">x</a>',html+='<span class="btn btn-tiny sort ui-sortable-handle"></span></td>',html+="</tr>"}function add_new_option_row(elm){var ptable=$(elm).closest("table");ptable.find("tbody tr").size()>0?ptable.find("tbody tr:last").after(prepare_option_row_html(null)):ptable.find("tbody").append(prepare_option_row_html(null))}function remove_option_row(elm){var ptable=$(elm).closest("table");$(elm).closest("tr").remove(),0==ptable.find("tbody tr").size()&&ptable.find("tbody").append(prepare_option_row_html(null))}var _wp$i18n=wp.i18n,__=_wp$i18n.__,MSG_INVALID_NAME=(_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx,__('NAME/ID must begin with a lowercase letter ([a-z]) or underscores ("_") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores ("_")',"woo-checkout-field-editor-pro")),SPECIAL_FIELD_TYPES=["country","state","city"],FIELD_FORM_PROPS={name:{name:"name",type:"text"},type:{name:"type",type:"select"},label:{name:"label",type:"text"},default:{name:"default",type:"text"},placeholder:{name:"placeholder",type:"text"},class:{name:"class",type:"text"},validate:{name:"validate",type:"select",multiple:1},required:{name:"required",type:"checkbox"},enabled:{name:"enabled",type:"checkbox"},show_in_email:{name:"show_in_email",type:"checkbox"},show_in_order:{name:"show_in_order",type:"checkbox"}},FIELDS_TO_HIDE={radio:["placeholder","validate"],select:["validate"],password:["default"]};return{openNewFieldForm:open_new_field_form,openEditFieldForm:open_edit_field_form,openCopyFieldForm:open_copy_field_form,fieldTypeChangeListner:field_type_change_listner,addNewOptionRow:add_new_option_row,removeOptionRow:remove_option_row,save_field:save_field}}(window.jQuery,window,document),thwcfd_settings=function($,window,document){"use strict";function select_all_fields(elm){var checkAll=$(elm).prop("checked");$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]").prop("checked",checkAll)}function remove_selected_fields(){$("#thwcfd_checkout_fields tbody tr").removeClass("strikeout"),$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");row.hasClass("strikeout")||row.addClass("strikeout"),row.find(".f_deleted").val(1)})}function enable_disable_selected_fields(enabled){$("#thwcfd_checkout_fields tbody input:checkbox[name=select_field]:checked").each(function(){var row=$(this).closest("tr");0==enabled?row.hasClass("thpladmin-disabled")||row.addClass("thpladmin-disabled"):row.removeClass("thpladmin-disabled"),row.find(".td_enabled").html(1==enabled?'<span class="dashicons dashicons-yes tips" data-tip="'+__("Yes","woo-checkout-field-editor-pro")+'"></span>':"-"),row.find(".f_enabled").val(enabled)})}function hide_review_request_notice(elm){var wrapper=$(elm).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),data={thwcfd_security_review_notice:nonce,action:"skip_thwcfd_review_request_notice"};$.post(ajaxurl,data,function(){}),$(wrapper).hide(50)}var _wp$i18n=wp.i18n,__=_wp$i18n.__;_wp$i18n._x,_wp$i18n._n,_wp$i18n._nx;return $(function(){var settings_form=$("#thwcfd_checkout_fields_form");thwcfd_base.setupSortableTable(settings_form,"#thwcfd_checkout_fields","0"),thwcfd_base.setup_tiptip_tooltips(),thwcfd_base.setup_form_wizard()}),$(document).on("click",".thpladmin-notice .notice-dismiss",function(){var wrapper=$(this).closest("div.thpladmin-notice"),nonce=wrapper.data("nonce"),action=wrapper.data("action"),data={thwcfd_security_review_notice:nonce,action:action};$.post(ajaxurl,data,function(){})}),$(document).ready(function(){setTimeout(function(){$("#thwcfd_review_request_notice").fadeIn(500)},160)}),$(document).keypress(function(e){!$("#thwcfd_field_form_pp").is(":visible")||13!=e.keycode&&13!=e.which||(e.preventDefault(),thwcfdSaveField(this))}),{selectAllFields:select_all_fields,removeSelectedFields:remove_selected_fields,enableDisableSelectedFields:enable_disable_selected_fields,hideReviewRequestNotice:hide_review_request_notice}}(window.jQuery,window,document);
admin/class-thwcfd-admin-form-field.php CHANGED
@@ -51,37 +51,37 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
51
  $field_types = $this->get_field_types();
52
 
53
  $validations = array(
54
- 'email' => 'Email',
55
- 'phone' => 'Phone',
56
- 'postcode' => 'Postcode',
57
- 'state' => 'State',
58
- 'number' => 'Number',
59
  );
60
 
61
  $display_style = array(
62
- 'full' => 'Full width',
63
- 'half_left' => 'Half width left',
64
- 'half_right' => 'Half width right',
65
  );
66
 
67
  return array(
68
- 'type' => array('type'=>'select', 'name'=>'type', 'label'=>'Type', 'required'=>1, 'options'=>$field_types,
69
  'onchange'=>'thwcfdFieldTypeChangeListner(this)'),
70
- 'name' => array('type'=>'text', 'name'=>'name', 'label'=>'Name', 'required'=>1),
71
- 'label' => array('type'=>'text', 'name'=>'label', 'label'=>'Label'),
72
- 'default' => array('type'=>'text', 'name'=>'default', 'label'=>'Default Value'),
73
- 'placeholder' => array('type'=>'text', 'name'=>'placeholder', 'label'=>'Placeholder'),
74
  //'options' => array('type'=>'text', 'name'=>'options', 'label'=>'Options', 'placeholder'=>'Seperate options with pipe(|)'),
75
- 'class' => array('type'=>'text', 'name'=>'class', 'label'=>'Class', 'placeholder'=>'Separate classes with comma'),
76
- 'validate' => array('type'=>'multiselect', 'name'=>'validate', 'label'=>'Validation', 'placeholder'=>'Select validations', 'options'=>$validations, 'multiple'=>1),
77
  // 'disp_style' => array('type'=>'select', 'name'=>'disp_style', 'label'=>'Field Display', 'options'=>$display_style),
78
 
79
- 'required' => array('type'=>'checkbox', 'name'=>'required', 'label'=>'Required', 'value'=>'1', 'checked'=>1),
80
  //'clear' => array('type'=>'checkbox', 'name'=>'clear', 'label'=>'Clear Row', 'value'=>'1', 'checked'=>1),
81
- 'enabled' => array('type'=>'checkbox', 'name'=>'enabled', 'label'=>'Enabled', 'value'=>'1', 'checked'=>1),
82
 
83
- 'show_in_email' => array('type'=>'checkbox', 'name'=>'show_in_email', 'label'=>'Display in Emails', 'value'=>'1', 'checked'=>1),
84
- 'show_in_order' => array('type'=>'checkbox', 'name'=>'show_in_order', 'label'=>'Display in Order Detail Pages', 'value'=>'1', 'checked'=>1),
85
  );
86
  }
87
 
@@ -122,10 +122,10 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
122
  <div class="modal-body">
123
  <div class="form-wizard wizard">
124
  <aside>
125
- <side-title class="wizard-title">Save Field</side-title>
126
  <ul class="pp_nav_links">
127
  <li class="text-primary active first pp-nav-link-basic" data-index="0">
128
- <i class="dashicons dashicons-admin-generic text-primary"></i>Basic Info
129
  <i class="i i-chevron-right dashicons dashicons-arrow-right-alt2"></i>
130
  </li>
131
  <!-- <li class="text-primary pp-nav-link-styles" data-index="1">
@@ -157,13 +157,13 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
157
  <span class="Loader"></span>
158
  <div class="btn-toolbar">
159
  <button class="save-btn pull-right btn btn-primary" onclick="thwcfdSaveField(this)">
160
- <span>Save & Close</span>
161
  </button>
162
  <!--<button class="next-btn pull-right btn btn-primary-alt" onclick="thwcfdWizardNext(this)">
163
- <span>Next</span><i class="i i-plus"></i>
164
  </button>
165
  <button class="prev-btn pull-right btn btn-primary-alt" onclick="thwcfdWizardPrevious(this)">
166
- <span>Back</span><i class="i i-plus"></i>
167
  </button>-->
168
  </div>
169
  </footer>
@@ -177,7 +177,7 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
177
 
178
  /*----- TAB - General Info -----*/
179
  private function render_form_tab_general_info(){
180
- $this->render_form_tab_main_title('Basic Details');
181
 
182
  ?>
183
  <div style="display: inherit;" class="data-panel-content">
@@ -191,7 +191,7 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
191
 
192
  /*----- TAB - Display Details -----*/
193
  private function render_form_tab_display_details(){
194
- $this->render_form_tab_main_title('Display Settings');
195
 
196
  ?>
197
  <div style="display: inherit;" class="data-panel-content mt-10">
@@ -405,10 +405,10 @@ class THWCFD_Admin_Form_Field extends THWCFD_Admin_Form{
405
  <td colspan="3" class="p-0">
406
  <table border="0" cellpadding="0" cellspacing="0" class="thwcfd-option-list thpladmin-options-table"><tbody>
407
  <tr>
408
- <td class="key"><input type="text" name="i_options_key[]" placeholder="Option Value"></td>
409
- <td class="value"><input type="text" name="i_options_text[]" placeholder="Option Text"></td>
410
  <td class="action-cell">
411
- <a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="Add new option">+</a><a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="Remove option">x</a><span class="btn btn-tiny sort ui-sortable-handle"></span>
412
  </td>
413
  </tr>
414
  </tbody></table>
51
  $field_types = $this->get_field_types();
52
 
53
  $validations = array(
54
+ 'email' => __('Email', 'woo-checkout-field-editor-pro'),
55
+ 'phone' => __('Phone', 'woo-checkout-field-editor-pro'),
56
+ 'postcode' => __('Postcode', 'woo-checkout-field-editor-pro'),
57
+ 'state' => __('State', 'woo-checkout-field-editor-pro'),
58
+ 'number' => __('Number', 'woo-checkout-field-editor-pro'),
59
  );
60
 
61
  $display_style = array(
62
+ 'full' => __('Full width', 'woo-checkout-field-editor-pro'),
63
+ 'half_left' => __('Half width left', 'woo-checkout-field-editor-pro'),
64
+ 'half_right' => __('Half width right', 'woo-checkout-field-editor-pro'),
65
  );
66
 
67
  return array(
68
+ 'type' => array('type'=>'select', 'name'=>'type', 'label'=>__('Type', 'woo-checkout-field-editor-pro'), 'required'=>1, 'options'=>$field_types,
69
  'onchange'=>'thwcfdFieldTypeChangeListner(this)'),
70
+ 'name' => array('type'=>'text', 'name'=>'name', 'label'=>__('Name', 'woo-checkout-field-editor-pro'), 'required'=>1),
71
+ 'label' => array('type'=>'text', 'name'=>'label', 'label'=>__('Label', 'woo-checkout-field-editor-pro')),
72
+ 'default' => array('type'=>'text', 'name'=>'default', 'label'=>__('Default Value', 'woo-checkout-field-editor-pro')),
73
+ 'placeholder' => array('type'=>'text', 'name'=>'placeholder', 'label'=>__('Placeholder', 'woo-checkout-field-editor-pro')),
74
  //'options' => array('type'=>'text', 'name'=>'options', 'label'=>'Options', 'placeholder'=>'Seperate options with pipe(|)'),
75
+ 'class' => array('type'=>'text', 'name'=>'class', 'label'=>__('Class', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Separate classes with comma', 'woo-checkout-field-editor-pro')),
76
+ 'validate' => array('type'=>'multiselect', 'name'=>'validate', 'label'=>__('Validation', 'woo-checkout-field-editor-pro'), 'placeholder'=>__('Select validations', 'woo-checkout-field-editor-pro'), 'options'=>$validations, 'multiple'=>1),
77
  // 'disp_style' => array('type'=>'select', 'name'=>'disp_style', 'label'=>'Field Display', 'options'=>$display_style),
78
 
79
+ 'required' => array('type'=>'checkbox', 'name'=>'required', 'label'=>__('Required', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
80
  //'clear' => array('type'=>'checkbox', 'name'=>'clear', 'label'=>'Clear Row', 'value'=>'1', 'checked'=>1),
81
+ 'enabled' => array('type'=>'checkbox', 'name'=>'enabled', 'label'=>__('Enabled', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
82
 
83
+ 'show_in_email' => array('type'=>'checkbox', 'name'=>'show_in_email', 'label'=>__('Display in Emails', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
84
+ 'show_in_order' => array('type'=>'checkbox', 'name'=>'show_in_order', 'label'=>__('Display in Order Detail Pages', 'woo-checkout-field-editor-pro'), 'value'=>'1', 'checked'=>1),
85
  );
86
  }
87
 
122
  <div class="modal-body">
123
  <div class="form-wizard wizard">
124
  <aside>
125
+ <side-title class="wizard-title"><?php _e('Save Field', 'woo-checkout-field-editor-pro'); ?></side-title>
126
  <ul class="pp_nav_links">
127
  <li class="text-primary active first pp-nav-link-basic" data-index="0">
128
+ <i class="dashicons dashicons-admin-generic text-primary"></i><?php _e('Basic Info', 'woo-checkout-field-editor-pro'); ?>
129
  <i class="i i-chevron-right dashicons dashicons-arrow-right-alt2"></i>
130
  </li>
131
  <!-- <li class="text-primary pp-nav-link-styles" data-index="1">
157
  <span class="Loader"></span>
158
  <div class="btn-toolbar">
159
  <button class="save-btn pull-right btn btn-primary" onclick="thwcfdSaveField(this)">
160
+ <span><?php _e('Save & Close', 'woo-checkout-field-editor-pro'); ?></span>
161
  </button>
162
  <!--<button class="next-btn pull-right btn btn-primary-alt" onclick="thwcfdWizardNext(this)">
163
+ <span><?php _e('Next', 'woo-checkout-field-editor-pro'); ?></span><i class="i i-plus"></i>
164
  </button>
165
  <button class="prev-btn pull-right btn btn-primary-alt" onclick="thwcfdWizardPrevious(this)">
166
+ <span><?php _e('Back', 'woo-checkout-field-editor-pro'); ?></span><i class="i i-plus"></i>
167
  </button>-->
168
  </div>
169
  </footer>
177
 
178
  /*----- TAB - General Info -----*/
179
  private function render_form_tab_general_info(){
180
+ $this->render_form_tab_main_title(__('Basic Details', 'woo-checkout-field-editor-pro'));
181
 
182
  ?>
183
  <div style="display: inherit;" class="data-panel-content">
191
 
192
  /*----- TAB - Display Details -----*/
193
  private function render_form_tab_display_details(){
194
+ $this->render_form_tab_main_title(__('Display Settings', 'woo-checkout-field-editor-pro'));
195
 
196
  ?>
197
  <div style="display: inherit;" class="data-panel-content mt-10">
405
  <td colspan="3" class="p-0">
406
  <table border="0" cellpadding="0" cellspacing="0" class="thwcfd-option-list thpladmin-options-table"><tbody>
407
  <tr>
408
+ <td class="key"><input type="text" name="i_options_key[]" placeholder="<?php _e('Option Value', 'woo-checkout-field-editor-pro'); ?>"></td>
409
+ <td class="value"><input type="text" name="i_options_text[]" placeholder="<?php _e('Option Text', 'woo-checkout-field-editor-pro'); ?>"></td>
410
  <td class="action-cell">
411
+ <a href="javascript:void(0)" onclick="thwcfdAddNewOptionRow(this)" class="btn btn-tiny btn-primary" title="<?php _e('Add new option', 'woo-checkout-field-editor-pro'); ?>">+</a><a href="javascript:void(0)" onclick="thwcfdRemoveOptionRow(this)" class="btn btn-tiny btn-danger" title="<?php _e('Remove option', 'woo-checkout-field-editor-pro'); ?>">x</a><span class="btn btn-tiny sort ui-sortable-handle"></span>
412
  </td>
413
  </tr>
414
  </tbody></table>
admin/class-thwcfd-admin-form.php CHANGED
@@ -66,9 +66,9 @@ abstract class THWCFD_Admin_Form {
66
  $args = wp_parse_args( $args, $defaults );
67
 
68
  $ftype = isset($field['type']) ? $field['type'] : 'text';
69
- $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro') : '';
70
- $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? __($field['sub_label'], 'woo-checkout-field-editor-pro') : '';
71
- $tooltip = isset($field['hint_text']) && !empty($field['hint_text']) ? __($field['hint_text'], 'woo-checkout-field-editor-pro') : '';
72
 
73
  $field_html = '';
74
 
66
  $args = wp_parse_args( $args, $defaults );
67
 
68
  $ftype = isset($field['type']) ? $field['type'] : 'text';
69
+ $flabel = isset($field['label']) && !empty($field['label']) ? $field['label'] : '';
70
+ $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? $field['sub_label'] : '';
71
+ $tooltip = isset($field['hint_text']) && !empty($field['hint_text']) ? $field['hint_text'] : '';
72
 
73
  $field_html = '';
74
 
admin/class-thwcfd-admin-settings-advanced.php CHANGED
@@ -53,19 +53,19 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
53
  public function get_advanced_settings_fields(){
54
  return array(
55
  'enable_label_override' => array(
56
- 'name'=>'enable_label_override', 'label'=>'Enable label override for address fields.', 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
57
  ),
58
  'enable_placeholder_override' => array(
59
- 'name'=>'enable_placeholder_override', 'label'=>'Enable placeholder override for address fields.', 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
60
  ),
61
  'enable_class_override' => array(
62
- 'name'=>'enable_class_override', 'label'=>'Enable class override for address fields.', 'type'=>'checkbox', 'value'=>'1', 'checked'=>0
63
  ),
64
  'enable_priority_override' => array(
65
- 'name'=>'enable_priority_override', 'label'=>'Enable priority override for address fields.', 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
66
  ),
67
  'enable_required_override' => array(
68
- 'name'=>'enable_required_override', 'label'=>'Enable required validation override for address fields.', 'type'=>'checkbox', 'value'=>'1', 'checked'=>0
69
  ),
70
  );
71
  }
@@ -76,7 +76,7 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
76
  }
77
 
78
  public function save_advanced_settings($settings){
79
- $result = update_option(THWCFD_Utils::OPTION_KEY_ADVANCED_SETTINGS, $settings);
80
  return $result;
81
  }
82
 
@@ -88,7 +88,7 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
88
  }
89
 
90
  delete_option(THWCFD_Utils::OPTION_KEY_ADVANCED_SETTINGS);
91
- $this->print_notices('Settings successfully reset.', 'updated', false);
92
  }
93
 
94
  private function save_settings(){
@@ -124,9 +124,9 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
124
 
125
  $result = $this->save_advanced_settings($settings);
126
  if ($result == true) {
127
- $this->print_notices('Your changes were saved.', 'updated', false);
128
  } else {
129
- $this->print_notices('Your changes were not saved due to an error (or you made none!).', 'error', false);
130
  }
131
  }
132
 
@@ -155,7 +155,7 @@ class THWCFD_Admin_Settings_Advanced extends THWCFD_Admin_Settings{
155
  <p class="submit">
156
  <input type="submit" name="save_settings" class="btn btn-small btn-primary" value="Save changes">
157
  <input type="submit" name="reset_settings" class="btn btn-small" value="Reset to default"
158
- onclick="return confirm('Are you sure you want to reset to default settings? all your changes will be deleted.');">
159
  </p>
160
  <?php wp_nonce_field( 'thwcfd_advanced_settings', 'thwcfd_security_advanced_settings' ); ?>
161
  </form>
53
  public function get_advanced_settings_fields(){
54
  return array(
55
  'enable_label_override' => array(
56
+ 'name'=>'enable_label_override', 'label'=>__('Enable label override for address fields.', 'woo-checkout-field-editor-pro'), 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
57
  ),
58
  'enable_placeholder_override' => array(
59
+ 'name'=>'enable_placeholder_override', 'label'=>__('Enable placeholder override for address fields.', 'woo-checkout-field-editor-pro'), 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
60
  ),
61
  'enable_class_override' => array(
62
+ 'name'=>'enable_class_override', 'label'=>__('Enable class override for address fields.', 'woo-checkout-field-editor-pro'), 'type'=>'checkbox', 'value'=>'1', 'checked'=>0
63
  ),
64
  'enable_priority_override' => array(
65
+ 'name'=>'enable_priority_override', 'label'=>__('Enable priority override for address fields.', 'woo-checkout-field-editor-pro'), 'type'=>'checkbox', 'value'=>'1', 'checked'=>1
66
  ),
67
  'enable_required_override' => array(
68
+ 'name'=>'enable_required_override', 'label'=>__('Enable required validation override for address fields.', 'woo-checkout-field-editor-pro'), 'type'=>'checkbox', 'value'=>'1', 'checked'=>0
69
  ),
70
  );
71
  }
76
  }
77
 
78
  public function save_advanced_settings($settings){
79
+ $result = update_option(THWCFD_Utils::OPTION_KEY_ADVANCED_SETTINGS, $settings, 'no');
80
  return $result;
81
  }
82
 
88
  }
89
 
90
  delete_option(THWCFD_Utils::OPTION_KEY_ADVANCED_SETTINGS);
91
+ $this->print_notices(__('Settings successfully reset.', 'woo-checkout-field-editor-pro'), 'updated', false);
92
  }
93
 
94
  private function save_settings(){
124
 
125
  $result = $this->save_advanced_settings($settings);
126
  if ($result == true) {
127
+ $this->print_notices(__('Your changes were saved.', 'woo-checkout-field-editor-pro'), 'updated', false);
128
  } else {
129
+ $this->print_notices(__('Your changes were not saved due to an error (or you made none!).', 'woo-checkout-field-editor-pro'), 'error', false);
130
  }
131
  }
132
 
155
  <p class="submit">
156
  <input type="submit" name="save_settings" class="btn btn-small btn-primary" value="Save changes">
157
  <input type="submit" name="reset_settings" class="btn btn-small" value="Reset to default"
158
+ onclick="return confirm(<?php _e('Are you sure you want to reset to default settings? all your changes will be deleted.', 'woo-checkout-field-editor-pro'); ?>)">
159
  </p>
160
  <?php wp_nonce_field( 'thwcfd_advanced_settings', 'thwcfd_security_advanced_settings' ); ?>
161
  </form>
admin/class-thwcfd-admin-settings-general.php CHANGED
@@ -27,8 +27,17 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
27
  $this->page_id = 'fields';
28
  $this->section_id = 'billing';
29
 
30
- $this->tabs = array( 'fields' => 'Checkout Fields', 'advanced_settings' => 'Advanced Settings', 'pro' => 'Premium Features');
31
- $this->sections = array('billing' => 'Billing Fields', 'shipping' => 'Shipping Fields', 'additional' => 'Additional Fields');
 
 
 
 
 
 
 
 
 
32
  }
33
 
34
  public static function instance() {
@@ -63,7 +72,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
63
  delete_option('wc_fields_shipping');
64
  delete_option('wc_fields_additional');
65
 
66
- return $this->print_notices('Checkout fields successfully reset', 'updated', true);
67
  }
68
 
69
  public function render_page(){
@@ -98,7 +107,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
98
  <th colspan="4">
99
  <input type="submit" name="save_fields" class="button-primary" value="<?php _e( 'Save changes', 'woo-checkout-field-editor-pro' ) ?>" style="float:right" />
100
  <input type="submit" name="reset_fields" class="button" value="<?php _e( 'Reset to default fields', 'woo-checkout-field-editor-pro' ) ?>" style="float:right; margin-right: 5px;"
101
- onclick="return confirm('Are you sure you want to reset to default fields? all your changes will be deleted.');"/>
102
  </th>
103
  <?php
104
  }
@@ -221,6 +230,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
221
  $result = false;
222
  $fields = THWCFD_Utils::get_fields($section);
223
  $field = $this->prepare_field_from_posted_data($_POST);
 
224
  $name = isset($field['name']) ? $field['name'] : false;
225
 
226
  if($name){
@@ -241,12 +251,12 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
241
  $result = THWCFD_Utils::update_fields($section, $fields);
242
 
243
  if($result == true) {
244
- $this->print_notices('Your changes were saved.', 'updated');
245
  }else {
246
- $this->print_notices('Your changes were not saved due to an error (or you made none!).', 'error');
247
  }
248
  } catch (Exception $e) {
249
- $this->print_notices('Your changes were not saved due to an error.', 'error');
250
  }
251
  }
252
 
@@ -261,7 +271,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
261
  $f_names = !empty( $_POST['f_name'] ) ? $_POST['f_name'] : array();
262
  $f_names = array_map('sanitize_key', $f_names);
263
  if(empty($f_names)){
264
- $this->print_notices('Your changes were not saved due to no fields found.', 'error');
265
  return;
266
  }
267
 
@@ -301,12 +311,12 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
301
  $result = THWCFD_Utils::update_fields($section, $fields);
302
 
303
  if($result == true) {
304
- $this->print_notices('Your changes were saved.', 'updated');
305
  }else {
306
- $this->print_notices('Your changes were not saved due to an error (or you made none!).', 'error');
307
  }
308
  } catch (Exception $e) {
309
- $this->print_notices('Your changes were not saved due to an error.', 'error');
310
  }
311
  }
312
 
@@ -402,7 +412,8 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
402
  /*********************************************/
403
  public function order_data_after_order_details($order){
404
  $fields = THWCFD_Utils::get_fields('additional');
405
- $this->display_fields_in_admin_order($order, $fields, '<p>&nbsp;</p>');
 
406
  }
407
 
408
  public function order_data_after_billing_address($order){
@@ -421,7 +432,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
421
  $order_id = THWCFD_Utils::get_order_id($order);
422
 
423
  foreach($fields as $name => $field){
424
- if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order']){
425
  $value = get_post_meta( $order_id, $name, true );
426
  if(!empty($value)){
427
  $value = THWCFD_Utils::get_option_text($field, $value);
@@ -432,7 +443,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
432
  }
433
 
434
  if($html){
435
- echo $prefix_html.$html;
436
  }
437
  }
438
  }
@@ -462,7 +473,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
462
  echo '<h2 class="thpladmin-tabs nav-tab-wrapper woo-nav-tab-wrapper">';
463
  foreach( $this->tabs as $id => $label ){
464
  $active = ( $current_tab == $id ) ? 'nav-tab-active' : '';
465
- $label = __($label, 'woo-checkout-field-editor-pro');
466
  echo '<a class="nav-tab '.$active.'" href="'. esc_url($this->get_admin_url($id)) .'">'.$label.'</a>';
467
  }
468
  echo '</h2>';
@@ -482,7 +493,7 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
482
 
483
  echo '<ul class="thpladmin-sections">';
484
  foreach( $this->sections as $id => $label ){
485
- $label = __($label, 'woo-checkout-field-editor-pro');
486
  $url = $this->get_admin_url($current_tab, sanitize_title($id));
487
  echo '<li><a href="'.esc_url($url) .'" class="'. ( $current_section == $id ? 'current' : '' ) .'">'. $label .'</a> '. (end( $array_keys ) == $id ? '' : '|') .' </li>';
488
  }
@@ -503,6 +514,34 @@ class THWCFD_Admin_Settings_General extends THWCFD_Admin_Settings{
503
  }
504
  return admin_url($url);
505
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  }
507
 
508
  endif;
27
  $this->page_id = 'fields';
28
  $this->section_id = 'billing';
29
 
30
+ $this->tabs = array(
31
+ 'fields' => __('Checkout Fields', 'woo-checkout-field-editor-pro'),
32
+ 'advanced_settings' => __('Advanced Settings', 'woo-checkout-field-editor-pro'),
33
+ 'pro' => __('Premium Features', 'woo-checkout-field-editor-pro'),
34
+ 'themehigh_plugins' => __('Other Free Plugins', 'woo-checkout-field-editor-pro'),
35
+ );
36
+ $this->sections = array(
37
+ 'billing' => __('Billing Fields', 'woo-checkout-field-editor-pro'),
38
+ 'shipping' => __('Shipping Fields', 'woo-checkout-field-editor-pro'),
39
+ 'additional' => __('Additional Fields', 'woo-checkout-field-editor-pro'),
40
+ );
41
  }
42
 
43
  public static function instance() {
72
  delete_option('wc_fields_shipping');
73
  delete_option('wc_fields_additional');
74
 
75
+ return $this->print_notices(__('Checkout fields successfully reset', 'woo-checkout-field-editor-pro'), 'updated', true);
76
  }
77
 
78
  public function render_page(){
107
  <th colspan="4">
108
  <input type="submit" name="save_fields" class="button-primary" value="<?php _e( 'Save changes', 'woo-checkout-field-editor-pro' ) ?>" style="float:right" />
109
  <input type="submit" name="reset_fields" class="button" value="<?php _e( 'Reset to default fields', 'woo-checkout-field-editor-pro' ) ?>" style="float:right; margin-right: 5px;"
110
+ onclick="return confirm('<?php _e('Are you sure you want to reset to default fields? all your changes will be deleted.', 'woo-checkout-field-editor-pro' ); ?>')"/>
111
  </th>
112
  <?php
113
  }
230
  $result = false;
231
  $fields = THWCFD_Utils::get_fields($section);
232
  $field = $this->prepare_field_from_posted_data($_POST);
233
+ $this->add_wpml_support($field);
234
  $name = isset($field['name']) ? $field['name'] : false;
235
 
236
  if($name){
251
  $result = THWCFD_Utils::update_fields($section, $fields);
252
 
253
  if($result == true) {
254
+ $this->print_notices(__('Your changes were saved.', 'woo-checkout-field-editor-pro' ), 'updated');
255
  }else {
256
+ $this->print_notices(__('Your changes were not saved due to an error (or you made none!).', 'woo-checkout-field-editor-pro'), 'error');
257
  }
258
  } catch (Exception $e) {
259
+ $this->print_notices(__('Your changes were not saved due to an error.', 'woo-checkout-field-editor-pro'), 'error');
260
  }
261
  }
262
 
271
  $f_names = !empty( $_POST['f_name'] ) ? $_POST['f_name'] : array();
272
  $f_names = array_map('sanitize_key', $f_names);
273
  if(empty($f_names)){
274
+ $this->print_notices(__('Your changes were not saved due to no fields found.', 'woo-checkout-field-editor-pro'), 'error');
275
  return;
276
  }
277
 
311
  $result = THWCFD_Utils::update_fields($section, $fields);
312
 
313
  if($result == true) {
314
+ $this->print_notices(__('Your changes were saved.', 'woo-checkout-field-editor-pro'), 'updated');
315
  }else {
316
+ $this->print_notices(__('Your changes were not saved due to an error (or you made none!).', 'woo-checkout-field-editor-pro'), 'error');
317
  }
318
  } catch (Exception $e) {
319
+ $this->print_notices(__('Your changes were not saved due to an error.', 'woo-checkout-field-editor-pro'), 'error');
320
  }
321
  }
322
 
412
  /*********************************************/
413
  public function order_data_after_order_details($order){
414
  $fields = THWCFD_Utils::get_fields('additional');
415
+ //$this->display_fields_in_admin_order($order, $fields, '<p>&nbsp;</p>');
416
+ $this->display_fields_in_admin_order($order, $fields, '');
417
  }
418
 
419
  public function order_data_after_billing_address($order){
432
  $order_id = THWCFD_Utils::get_order_id($order);
433
 
434
  foreach($fields as $name => $field){
435
+ if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
436
  $value = get_post_meta( $order_id, $name, true );
437
  if(!empty($value)){
438
  $value = THWCFD_Utils::get_option_text($field, $value);
443
  }
444
 
445
  if($html){
446
+ echo '<div style="clear:both; padding:5px 0 0;">'.$prefix_html.$html.'</div>';
447
  }
448
  }
449
  }
473
  echo '<h2 class="thpladmin-tabs nav-tab-wrapper woo-nav-tab-wrapper">';
474
  foreach( $this->tabs as $id => $label ){
475
  $active = ( $current_tab == $id ) ? 'nav-tab-active' : '';
476
+ //$label = __($label, 'woo-checkout-field-editor-pro');
477
  echo '<a class="nav-tab '.$active.'" href="'. esc_url($this->get_admin_url($id)) .'">'.$label.'</a>';
478
  }
479
  echo '</h2>';
493
 
494
  echo '<ul class="thpladmin-sections">';
495
  foreach( $this->sections as $id => $label ){
496
+ // $label = __($label, 'woo-checkout-field-editor-pro');
497
  $url = $this->get_admin_url($current_tab, sanitize_title($id));
498
  echo '<li><a href="'.esc_url($url) .'" class="'. ( $current_section == $id ? 'current' : '' ) .'">'. $label .'</a> '. (end( $array_keys ) == $id ? '' : '|') .' </li>';
499
  }
514
  }
515
  return admin_url($url);
516
  }
517
+
518
+ private function add_wpml_support($field){
519
+ $context = 'woo-checkout-field-editor-pro';
520
+
521
+ $label = isset($field['label']) ? $field['label'] : '';
522
+ if($label){
523
+ $name = 'Field label - ' . $label;
524
+ do_action( 'wpml_register_single_string', 'woo-checkout-field-editor-pro', $name, $label );
525
+ }
526
+
527
+ $placeholder = isset($field['placeholder']) ? $field['placeholder'] : '';
528
+ if($placeholder){
529
+ $name = 'Field placeholder - ' . $placeholder;
530
+ do_action( 'wpml_register_single_string', 'woo-checkout-field-editor-pro', $name, $placeholder );
531
+ }
532
+
533
+ $options = isset($field['options']) ? $field['options'] : '';
534
+ if($options){
535
+ if(is_array($options)){
536
+ $index = 0;
537
+ foreach($options as $option_value => $option_text){
538
+ $name = 'Field option text - ' . $option_text;
539
+ do_action( 'wpml_register_single_string', 'woo-checkout-field-editor-pro', $name, $option_text );
540
+ $index++;
541
+ }
542
+ }
543
+ }
544
+ }
545
  }
546
 
547
  endif;
admin/class-thwcfd-admin-settings-themehigh-plugins.php ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The admin advanced settings page functionality of the plugin.
4
+ *
5
+ * @link https://themehigh.com
6
+ * @since 1.4.4
7
+ *
8
+ * @package woo-checkout-field-editor-pro
9
+ * @subpackage woo-checkout-field-editor-pro/admin
10
+ */
11
+
12
+ if(!defined('WPINC')){ die; }
13
+
14
+ if(!class_exists('THWCFD_Admin_Settings_Themehigh_Plugins')):
15
+
16
+ class THWCFD_Admin_Settings_Themehigh_Plugins extends THWCFD_Admin_Settings{
17
+ protected static $_instance = null;
18
+ protected $tabs = '';
19
+
20
+ private $settings_fields = NULL;
21
+ private $cell_props = array();
22
+ private $cell_props_CB = array();
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+ $this->page_id = 'themehigh_plugins';
27
+ }
28
+
29
+ public static function instance() {
30
+ if(is_null(self::$_instance)){
31
+ self::$_instance = new self();
32
+ }
33
+ return self::$_instance;
34
+ }
35
+
36
+ public function render_page(){
37
+ $this->render_tabs();
38
+ $this->render_content();
39
+ }
40
+
41
+ private function plugins(){
42
+ return array(
43
+ array(
44
+ 'title' => 'Checkout Field Editor (Checkout Manager) for WooCommerce',
45
+ 'image' => 'checkout-field-editor.png',
46
+ 'content' => 'Checkout Field Editor plugin lets you add and manage the fields of your WooCommerce checkout page and allows you to choose the field display areas.',
47
+ 'slug' => 'woo-checkout-field-editor-pro',
48
+ 'file' => 'checkout-form-designer.php',
49
+ 'featured' => true,
50
+ 'skip' => true,
51
+ ),
52
+ array(
53
+ 'title' => 'Extra Product Options (Product Addons) for WooCommerce',
54
+ 'image' => 'extra-product-options.png',
55
+ 'content' => 'The Extra Product Options plugin allows you to create additional fields on your product page and helps you to manage them efficiently.',
56
+ 'slug' => 'woo-extra-product-options',
57
+ 'file' => 'woo-extra-product-options.php',
58
+ ),
59
+ array(
60
+ 'title' => 'MultiStep Checkout for WooCommerce',
61
+ 'image' => 'multistep-checkout.png',
62
+ 'content' => 'Using the compatibility feature of the Multi-step checkout plugin, you can create additional fields to your checkout page and split the default WooCommerce checkout page into simpler steps.',
63
+ 'slug' => 'woo-multistep-checkout',
64
+ 'file' => 'woo-multistep-checkout.php',
65
+ 'featured' => true,
66
+ ),
67
+ array(
68
+ 'title' => 'Email Customizer for WooCommerce',
69
+ 'image' => 'email-customizer.png',
70
+ 'content' => 'As the Checkout Field editor plugin is compatible with the Email customizer, you can edit the WooCommerce transactional emails with the checkout fields at your desired position in the email.',
71
+ 'slug' => 'email-customizer-for-woocommerce',
72
+ 'file' => 'email-customizer-for-woocommerce.php',
73
+ 'featured' => true,
74
+ ),
75
+ array(
76
+ 'title' => 'Multiple Addresses for WooCommerce',
77
+ 'image' => 'multiple-addresses.png',
78
+ 'content' => 'The plugin compatibility helps the shoppers to add custom checkout field data to their customer addresses and lets them choose the desired address while placing the order.',
79
+ 'slug' => 'themehigh-multiple-addresses',
80
+ 'file' => 'themehigh-multiple-addresses.php',
81
+ 'featured' => true,
82
+ ),
83
+ array(
84
+ 'title' => 'Variation Swatches for WooCommerce',
85
+ 'image' => 'variation-swatches.png',
86
+ 'content' => 'Variation Swatches for Woocommerce plugin lets you display the variable product attributes as attractive swatches of different types.',
87
+ 'slug' => 'product-variation-swatches-for-woocommerce',
88
+ 'file' => 'product-variation-swatches-for-woocommerce.php',
89
+ ),
90
+ array(
91
+ 'title' => 'Job Manager & Career',
92
+ 'image' => 'job-manager.png',
93
+ 'content' => 'Job Manager & Career is a lightweight WordPress plugin to add and manage job posts on your career page.',
94
+ 'slug' => 'job-manager-career',
95
+ 'file' => 'job-manager-career.php',
96
+ ),
97
+ array(
98
+ 'title' => 'WooCommerce Wishlist and Comparison',
99
+ 'image' => 'wishlist-compare.png',
100
+ 'content' => 'The plugin helps your customers to move products to the wishlist for future purchases and lets them compare between different products.',
101
+ 'slug' => 'wishlist-and-compare',
102
+ 'file' => 'wishlist-and-compare.php',
103
+ ),
104
+ array(
105
+ 'title' => 'Dynamic Pricing and Discount Rules',
106
+ 'image' => 'discount-and-dynamic-pricing.png',
107
+ 'content' => 'Dynamic Pricing and Discount Rules plugin helps you to define special discount rules for both the product and cart details.',
108
+ 'slug' => 'discount-and-dynamic-pricing',
109
+ 'file' => 'discount-and-dynamic-pricing.php',
110
+ ),
111
+ array(
112
+ 'title' => 'Advanced FAQ Manager',
113
+ 'image' => 'advanced-faq-manager.png',
114
+ 'content' => 'Advanced FAQ Manager plugin lets you easily add and manage the Frequently Asked Questions on your WordPress pages.',
115
+ 'slug' => 'advanced-faq-manager',
116
+ 'file' => 'advanced-faq-manager.php',
117
+ ),
118
+
119
+ array(
120
+ 'title' => 'Product Feature Request',
121
+ 'image' => 'product-feature-request.png',
122
+ 'content' => 'Using the Product Feature Request plugin, you can collect suggestions or ideas from the customers and improve your WooCommerce products.',
123
+ 'slug' => 'product-feature-request',
124
+ 'file' => 'product-feature-request.php',
125
+ ),
126
+
127
+ );
128
+ }
129
+
130
+ private function render_content(){
131
+ ?>
132
+ <?php
133
+ $plugins = $this->plugins();
134
+ $featured_plugins = array_filter($plugins, function ($var) {
135
+ return (isset($var['featured']) && $var['featured'] == true && !(isset($var['skip'])));
136
+ });
137
+ if(!empty($featured_plugins)){ ?>
138
+ <h2><?php _e('Compatible Plugins', 'woo-checkout-field-editor-pro'); ?></h2>
139
+ <div class="th-plugins-wrapper featured">
140
+ <?php
141
+ foreach($featured_plugins as $plugin){
142
+ $title = isset($plugin['title']) ? $plugin['title'] : '';
143
+ $img = isset($plugin['image']) ? $plugin['image'] : '';
144
+ $content = isset($plugin['content']) ? $plugin['content'] : '';
145
+ $link = isset($plugin['download_link']) ? $plugin['download_link'] : '';
146
+ $slug = isset($plugin['slug']) ? $plugin['slug'] : '';
147
+ $file = isset($plugin['file']) ? $plugin['file'] : '';
148
+ ?>
149
+ <div class="th-plugins-child">
150
+ <div class="th-title-box">
151
+ <?php if($img){ ?>
152
+ <img src="<?php echo THWCFD_URL; ?>admin/assets/images/wp-plugins/<?php echo $img; ?>" alt="<?php echo $title; ?>">
153
+ <?php } ?>
154
+ <h3><a href="https://wordpress.org/plugins/<?php echo esc_attr( $slug ); ?>" target="_blank"><?php echo $title; ?></a></h3>
155
+ </div>
156
+ <?php echo wpautop($content); ?>
157
+
158
+ <?php if($slug && $file){
159
+ $this->install_plugin_button($slug, $file, $title);
160
+ } ?>
161
+
162
+ </div>
163
+ <?php } ?>
164
+ </div>
165
+ <?php } ?>
166
+
167
+
168
+
169
+
170
+ <?php
171
+ $plugin = array();
172
+ $regular_plugins = array_filter($plugins, function ($var) {
173
+ return (!isset($var['featured']) && !isset($var['skip']));
174
+ });
175
+ if(!empty($regular_plugins)){ ?>
176
+ <h2><?php _e('Other Plugins', 'woo-checkout-field-editor-pro'); ?></h2>
177
+ <div class="th-plugins-wrapper">
178
+ <?php
179
+ foreach($regular_plugins as $plugin){
180
+ $title = isset($plugin['title']) ? $plugin['title'] : '';
181
+ $img = isset($plugin['image']) ? $plugin['image'] : '';
182
+ $content = isset($plugin['content']) ? $plugin['content'] : '';
183
+ $link = isset($plugin['download_link']) ? $plugin['download_link'] : '';
184
+ $slug = isset($plugin['slug']) ? $plugin['slug'] : '';
185
+ $file = isset($plugin['file']) ? $plugin['file'] : '';
186
+ ?>
187
+ <div class="th-plugins-child">
188
+ <div class="th-title-box">
189
+ <?php if($img){ ?>
190
+ <img src="<?php echo THWCFD_URL; ?>admin/assets/images/wp-plugins/<?php echo $img; ?>" alt="<?php echo $title; ?>">
191
+ <?php } ?>
192
+ <h3><a href="https://wordpress.org/plugins/<?php echo esc_attr( $slug ); ?>" target="_blank"><?php echo $title; ?></a></h3>
193
+ </div>
194
+ <?php echo wpautop($content); ?>
195
+
196
+ <?php if($slug && $file){
197
+ $this->install_plugin_button($slug, $file, $title);
198
+ } ?>
199
+
200
+ </div>
201
+ <?php } ?>
202
+ </div>
203
+ <?php } ?>
204
+ <?php
205
+ }
206
+
207
+
208
+ /**
209
+ * Output a button that will install or activate a plugin if it doesn't exist, or display a disabled button if the
210
+ * plugin is already activated.
211
+ *
212
+ * @param string $plugin_slug The plugin slug.
213
+ * @param string $plugin_file The plugin file.
214
+ * @param string $plugin_name The plugin name.
215
+ * @param string $classes CSS classes.
216
+ * @param string $activated Button activated text.
217
+ * @param string $activate Button activate text.
218
+ * @param string $install Button install text.
219
+ */
220
+ public static function install_plugin_button( $plugin_slug, $plugin_file, $plugin_name, $classes = array(), $activated = '', $activate = '', $install = '' ) {
221
+ if ( current_user_can( 'install_plugins' ) && current_user_can( 'activate_plugins' ) ) {
222
+ if ( is_plugin_active( $plugin_slug . '/' . $plugin_file ) ) {
223
+ // The plugin is already active.
224
+ $button = array(
225
+ 'message' => esc_attr__( 'Activated', 'storefront' ),
226
+ 'url' => '#',
227
+ 'classes' => array('button', 'disabled' ),
228
+ );
229
+
230
+ if ( '' !== $activated ) {
231
+ $button['message'] = esc_attr( $activated );
232
+ }
233
+ } elseif ( self::is_plugin_installed( $plugin_slug ) ) {
234
+ $url = self::is_plugin_installed( $plugin_slug );
235
+
236
+ // The plugin exists but isn't activated yet.
237
+ $button = array(
238
+ 'message' => esc_attr__( 'Activate', 'storefront' ),
239
+ 'url' => $url,
240
+ 'classes' => array( 'activate-now', 'button' ),
241
+ );
242
+
243
+ if ( '' !== $activate ) {
244
+ $button['message'] = esc_attr( $activate );
245
+ }
246
+ } else {
247
+ // The plugin doesn't exist.
248
+ $url = wp_nonce_url(
249
+ add_query_arg(
250
+ array(
251
+ 'action' => 'install-plugin',
252
+ 'plugin' => $plugin_slug,
253
+ ),
254
+ self_admin_url( 'update.php' )
255
+ ),
256
+ 'install-plugin_' . $plugin_slug
257
+ );
258
+ $button = array(
259
+ 'message' => esc_attr__( 'Install now', 'storefront' ),
260
+ 'url' => $url,
261
+ 'classes' => array('button-primary', 'install-now', 'install-' . $plugin_slug ),
262
+ );
263
+
264
+ if ( '' !== $install ) {
265
+ $button['message'] = esc_attr( $install );
266
+ }
267
+ }
268
+
269
+ if ( ! empty( $classes ) ) {
270
+ $button['classes'] = array_merge( $button['classes'], $classes );
271
+ }
272
+
273
+ $button['classes'] = implode( ' ', $button['classes'] );
274
+
275
+ ?>
276
+ <span class="plugin-card-<?php echo esc_attr( $plugin_slug ); ?>">
277
+ <a href="<?php echo esc_url( $button['url'] ); ?>" class="<?php echo esc_attr( $button['classes'] ); ?> th-plugin-action" data-originaltext="<?php echo esc_attr( $button['message'] ); ?>" data-name="<?php echo esc_attr( $plugin_name ); ?>" data-slug="<?php echo esc_attr( $plugin_slug ); ?>" aria-label="<?php echo esc_attr( $button['message'] ); ?>"><?php echo esc_html( $button['message'] ); ?></a>
278
+ </span>
279
+ <?php
280
+ }
281
+ }
282
+
283
+ /**
284
+ * Check if a plugin is installed and return the url to activate it if so.
285
+ *
286
+ * @param string $plugin_slug The plugin slug.
287
+ */
288
+ public static function is_plugin_installed( $plugin_slug ) {
289
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {
290
+ $plugins = get_plugins( '/' . $plugin_slug );
291
+ if ( ! empty( $plugins ) ) {
292
+ $keys = array_keys( $plugins );
293
+ $plugin_file = $plugin_slug . '/' . $keys[0];
294
+ $url = wp_nonce_url(
295
+ add_query_arg(
296
+ array(
297
+ 'action' => 'activate',
298
+ 'plugin' => $plugin_file,
299
+ ),
300
+ admin_url( 'plugins.php' )
301
+ ),
302
+ 'activate-plugin_' . $plugin_file
303
+ );
304
+ return $url;
305
+ }
306
+ }
307
+ return false;
308
+ }
309
+
310
+ function activate_themehigh_plugins(){
311
+ $plugin_file = isset($_REQUEST['file']) ? $_REQUEST['file'] : '';
312
+ if( $plugin_file && check_ajax_referer( 'activate-plugin_' . $plugin_file ) ){
313
+ if ( current_user_can( 'install_plugins' ) && current_user_can( 'activate_plugins' ) ) {
314
+ if (!is_plugin_active($plugin_file) ) {
315
+
316
+ $result = activate_plugin($plugin_file);
317
+
318
+ if( is_wp_error( $result ) ) {
319
+ wp_send_json(false);
320
+ }else{
321
+ wp_send_json(true);
322
+ }
323
+ }
324
+ }
325
+ }
326
+ wp_send_json(false);
327
+ }
328
+
329
+ }
330
+
331
+ endif;
admin/class-thwcfd-admin-settings.php CHANGED
@@ -20,7 +20,12 @@ abstract class THWCFD_Admin_Settings{
20
  protected $sections = '';
21
 
22
  public function __construct() {
23
- $this->tabs = array( 'fields' => 'Checkout Fields', 'advanced_settings' => 'Advanced Settings', 'pro' => 'Premium Features');
 
 
 
 
 
24
  }
25
 
26
  public function get_tabs(){
@@ -46,7 +51,7 @@ abstract class THWCFD_Admin_Settings{
46
  echo '<h2 class="thpladmin-tabs nav-tab-wrapper woo-nav-tab-wrapper">';
47
  foreach( $tabs as $id => $label ){
48
  $active = ( $current_tab == $id ) ? 'nav-tab-active' : '';
49
- $label = esc_html__($label, 'woo-checkout-field-editor-pro');
50
  echo '<a class="nav-tab '.$active.'" href="'. esc_url($this->get_admin_url($id)) .'">'.$label.'</a>';
51
  }
52
  echo '</h2>';
@@ -83,7 +88,7 @@ abstract class THWCFD_Admin_Settings{
83
  }
84
 
85
  public function print_notices($msg, $type='updated', $return=false){
86
- $notice = '<div class="thwcfd-notice '. $type .'"><p>'. __($msg, 'woo-checkout-field-editor-pro') .'</p></div>';
87
  if(!$return){
88
  echo $notice;
89
  }
@@ -102,7 +107,7 @@ abstract class THWCFD_Admin_Settings{
102
  // $tooltip_html = '<a href="javascript:void(0)" title="'. $tooltip .'" class="thpladmin_tooltip"><img src="'. $icon .'" alt="" title=""/></a>';
103
  }
104
  ?>
105
- <td style="width: 26px; padding:0px;"><?php esc_html_e($tooltip_html, 'woo-checkout-field-editor-pro'); ?></td>
106
  <?php
107
  }
108
 
20
  protected $sections = '';
21
 
22
  public function __construct() {
23
+ $this->tabs = array(
24
+ 'fields' => __('Checkout Fields', 'woo-checkout-field-editor-pro'),
25
+ 'advanced_settings' => __('Advanced Settings', 'woo-checkout-field-editor-pro'),
26
+ 'pro' => __('Premium Features', 'woo-checkout-field-editor-pro'),
27
+ 'themehigh_plugins' => __('Other Free Plugins', 'woo-checkout-field-editor-pro'),
28
+ );
29
  }
30
 
31
  public function get_tabs(){
51
  echo '<h2 class="thpladmin-tabs nav-tab-wrapper woo-nav-tab-wrapper">';
52
  foreach( $tabs as $id => $label ){
53
  $active = ( $current_tab == $id ) ? 'nav-tab-active' : '';
54
+ //$label = esc_html__($label, 'woo-checkout-field-editor-pro');
55
  echo '<a class="nav-tab '.$active.'" href="'. esc_url($this->get_admin_url($id)) .'">'.$label.'</a>';
56
  }
57
  echo '</h2>';
88
  }
89
 
90
  public function print_notices($msg, $type='updated', $return=false){
91
+ $notice = '<div class="thwcfd-notice '. $type .'"><p>'. $msg .'</p></div>';
92
  if(!$return){
93
  echo $notice;
94
  }
107
  // $tooltip_html = '<a href="javascript:void(0)" title="'. $tooltip .'" class="thpladmin_tooltip"><img src="'. $icon .'" alt="" title=""/></a>';
108
  }
109
  ?>
110
+ <td style="width: 26px; padding:0px;"><?php esc_html($tooltip_html); ?></td>
111
  <?php
112
  }
113
 
admin/class-thwcfd-admin.php CHANGED
@@ -44,9 +44,10 @@ class THWCFD_Admin {
44
  }
45
 
46
  private function enqueue_scripts($suffix) {
47
- $deps = array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-tiptip', 'woocommerce_admin', 'selectWoo', 'wp-color-picker');
48
 
49
  wp_enqueue_script('thwcfd-admin-script', THWCFD_ASSETS_URL_ADMIN . 'js/thwcfd-admin'. $suffix .'.js', $deps, $this->version, false);
 
50
  }
51
 
52
  public function admin_menu() {
@@ -54,7 +55,7 @@ class THWCFD_Admin {
54
  $this->screen_id = add_submenu_page('woocommerce', __('WooCommerce Checkout Field Editor', 'woo-checkout-field-editor-pro'), __('Checkout Form', 'woo-checkout-field-editor-pro'), $capability, 'checkout_form_designer', array($this, 'output_settings'));
55
  }
56
 
57
- public function add_screen_id($ids){
58
  $ids[] = 'woocommerce_page_checkout_form_designer';
59
  $ids[] = strtolower(__('WooCommerce', 'woo-checkout-field-editor-pro')) .'_page_checkout_form_designer';
60
 
@@ -69,7 +70,7 @@ class THWCFD_Admin {
69
  return $links;
70
  }
71
 
72
- private function output_review_request_link(){
73
  $is_dismissed = get_transient('thwcfd_review_request_notice_dismissed');
74
  if($is_dismissed){
75
  return;
@@ -83,7 +84,7 @@ class THWCFD_Admin {
83
  $thwcfd_since = get_option('thwcfd_since');
84
  if(!$thwcfd_since){
85
  $now = time();
86
- update_option('thwcfd_since', $now, 'no' );
87
  }else{
88
  $now = time();
89
  $diff_seconds = $now - $thwcfd_since;
@@ -98,13 +99,11 @@ class THWCFD_Admin {
98
  private function render_review_request_notice(){
99
  ?>
100
  <div id="thwcfd_review_request_notice" class="notice notice-info is-dismissible thpladmin-notice" data-nonce="<?php echo wp_create_nonce( 'thwcfd_review_request_notice'); ?>" data-action="dismiss_thwcfd_review_request_notice" style="display:none">
101
- <h3>
102
- Just wanted to say thank you for using Checkout Field Editor plugin in your store.
103
- </h3>
104
- <p>We hope you had a great experience. Please leave us with your feedback to serve best to you and others. Cheers!</p>
105
  <p class="action-row">
106
- <button type="button" class="button button-primary" onclick="window.open('https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews?rate=5#new-post', '_blank')">Review Now</button>
107
- <button type="button" class="button" onclick="thwcfdHideReviewRequestNotice(this)">Remind Me Later</button>
108
  <span class="logo"><a target="_blank" href="https://www.themehigh.com">
109
  <img src="<?php echo esc_url(THWCFD_ASSETS_URL_ADMIN .'css/logo.svg'); ?>" />
110
  </a></span>
@@ -132,6 +131,9 @@ class THWCFD_Admin {
132
  }elseif($tab === 'pro'){
133
  $pro_details = THWCFD_Admin_Settings_Pro::instance();
134
  $pro_details->render_page();
 
 
 
135
  }else{
136
  $general_settings = THWCFD_Admin_Settings_General::instance();
137
  $general_settings->init();
44
  }
45
 
46
  private function enqueue_scripts($suffix) {
47
+ $deps = array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-tiptip', 'woocommerce_admin', 'selectWoo', 'wp-color-picker', 'wp-i18n');
48
 
49
  wp_enqueue_script('thwcfd-admin-script', THWCFD_ASSETS_URL_ADMIN . 'js/thwcfd-admin'. $suffix .'.js', $deps, $this->version, false);
50
+ wp_set_script_translations('thwcfd-admin-script', 'woo-checkout-field-editor-pro', dirname(THWCFD_BASE_NAME) . '/languages/');
51
  }
52
 
53
  public function admin_menu() {
55
  $this->screen_id = add_submenu_page('woocommerce', __('WooCommerce Checkout Field Editor', 'woo-checkout-field-editor-pro'), __('Checkout Form', 'woo-checkout-field-editor-pro'), $capability, 'checkout_form_designer', array($this, 'output_settings'));
56
  }
57
 
58
+ public function add_screen_id($ids) {
59
  $ids[] = 'woocommerce_page_checkout_form_designer';
60
  $ids[] = strtolower(__('WooCommerce', 'woo-checkout-field-editor-pro')) .'_page_checkout_form_designer';
61
 
70
  return $links;
71
  }
72
 
73
+ private function output_review_request_link() {
74
  $is_dismissed = get_transient('thwcfd_review_request_notice_dismissed');
75
  if($is_dismissed){
76
  return;
84
  $thwcfd_since = get_option('thwcfd_since');
85
  if(!$thwcfd_since){
86
  $now = time();
87
+ update_option('thwcfd_since', $now, 'no');
88
  }else{
89
  $now = time();
90
  $diff_seconds = $now - $thwcfd_since;
99
  private function render_review_request_notice(){
100
  ?>
101
  <div id="thwcfd_review_request_notice" class="notice notice-info is-dismissible thpladmin-notice" data-nonce="<?php echo wp_create_nonce( 'thwcfd_review_request_notice'); ?>" data-action="dismiss_thwcfd_review_request_notice" style="display:none">
102
+ <h3><?php _e('Just wanted to say thank you for using Checkout Field Editor plugin in your store.', 'woo-checkout-field-editor-pro'); ?></h3>
103
+ <p><?php _e('We hope you had a great experience. Please leave us with your feedback to serve best to you and others. Cheers!', 'woo-checkout-field-editor-pro'); ?></p>
 
 
104
  <p class="action-row">
105
+ <button type="button" class="button button-primary" onclick="window.open('https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews?rate=5#new-post', '_blank')"><?php _e('Review Now', 'woo-checkout-field-editor-pro'); ?></button>
106
+ <button type="button" class="button" onclick="thwcfdHideReviewRequestNotice(this)"><?php _e('Remind Me Later', 'woo-checkout-field-editor-pro'); ?></button>
107
  <span class="logo"><a target="_blank" href="https://www.themehigh.com">
108
  <img src="<?php echo esc_url(THWCFD_ASSETS_URL_ADMIN .'css/logo.svg'); ?>" />
109
  </a></span>
131
  }elseif($tab === 'pro'){
132
  $pro_details = THWCFD_Admin_Settings_Pro::instance();
133
  $pro_details->render_page();
134
+ }elseif($tab === 'themehigh_plugins'){
135
+ $themehigh_plugins = THWCFD_Admin_Settings_Themehigh_Plugins::instance();
136
+ $themehigh_plugins->render_page();
137
  }else{
138
  $general_settings = THWCFD_Admin_Settings_General::instance();
139
  $general_settings->init();
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.4.9
7
  * Author URI: https://www.themehigh.com
8
  * Plugin URI: https://www.themehigh.com
9
  * Text Domain: woo-checkout-field-editor-pro
10
  * Domain Path: /languages
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 5.6.0
13
  */
14
 
15
  if(!defined( 'ABSPATH' )) exit;
@@ -25,7 +25,7 @@ if (!function_exists('is_woocommerce_active')){
25
  }
26
 
27
  if(is_woocommerce_active()) {
28
- define('THWCFD_VERSION', '1.4.9');
29
  !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ ));
30
  !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ ));
31
  !defined('THWCFD_URL') && define('THWCFD_URL', plugins_url( '/', __FILE__ ));
3
  * Plugin Name: Checkout Field Editor for WooCommerce
4
  * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields).
5
  * Author: ThemeHigh
6
+ * Version: 1.5.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: 5.8.0
13
  */
14
 
15
  if(!defined( 'ABSPATH' )) exit;
25
  }
26
 
27
  if(is_woocommerce_active()) {
28
+ define('THWCFD_VERSION', '1.5.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
@@ -71,6 +71,9 @@ class THWCFD {
71
  add_action('wp_ajax_dismiss_thwcfd_review_request_notice', array($plugin_admin, 'dismiss_thwcfd_review_request_notice'));
72
  add_action('wp_ajax_skip_thwcfd_review_request_notice', array($plugin_admin, 'skip_thwcfd_review_request_notice'));
73
 
 
 
 
74
  $general_settings = new THWCFD_Admin_Settings_General();
75
  add_action('after_setup_theme', array($general_settings, 'define_admin_hooks'));
76
  }
71
  add_action('wp_ajax_dismiss_thwcfd_review_request_notice', array($plugin_admin, 'dismiss_thwcfd_review_request_notice'));
72
  add_action('wp_ajax_skip_thwcfd_review_request_notice', array($plugin_admin, 'skip_thwcfd_review_request_notice'));
73
 
74
+ $themehigh_plugins = new THWCFD_Admin_Settings_Themehigh_Plugins();
75
+ add_action('wp_ajax_th_activate_plugin', array($themehigh_plugins, 'activate_themehigh_plugins'));
76
+
77
  $general_settings = new THWCFD_Admin_Settings_General();
78
  add_action('after_setup_theme', array($general_settings, 'define_admin_hooks'));
79
  }
includes/utils/class-thwcfd-utils.php CHANGED
@@ -114,8 +114,24 @@ class THWCFD_Utils {
114
  return $return;
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  public static function update_fields($key, $fields){
118
- $result = update_option('wc_fields_' . $key, $fields);
119
  return $result;
120
  }
121
 
@@ -352,6 +368,20 @@ class THWCFD_Utils {
352
  }
353
  echo $text;
354
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
  public static function write_log ( $log ) {
357
  if ( true === WP_DEBUG ) {
114
  return $return;
115
  }
116
 
117
+ public static function is_wc_handle_custom_field($field){
118
+ $name = isset($field['name']) ? $field['name'] : '';
119
+ $special_fields = array();
120
+
121
+ if(version_compare(THWCFD_Utils::get_wc_version(), '5.6.0', ">=")){
122
+ $special_fields[] = 'shipping_phone';
123
+ }
124
+
125
+ $special_fields = apply_filters('thwcfd_wc_handle_custom_field', $special_fields);
126
+
127
+ if($name && in_array($name, $special_fields)){
128
+ return true;
129
+ }
130
+ return false;
131
+ }
132
+
133
  public static function update_fields($key, $fields){
134
+ $result = update_option('wc_fields_' . $key, $fields, 'no');
135
  return $result;
136
  }
137
 
368
  }
369
  echo $text;
370
  }
371
+ /***********************************
372
+ ----- i18n functions - END ------
373
+ ***********************************/
374
+
375
+ public static function get_wc_version() {
376
+ if(!class_exists('WooCommerce')){
377
+ return;
378
+ }
379
+
380
+ if(defined('WC_VERSION')) {
381
+ return WC_VERSION;
382
+ }
383
+ return;
384
+ }
385
 
386
  public static function write_log ( $log ) {
387
  if ( true === WP_DEBUG ) {
languages/woo-checkout-field-editor-pro.pot CHANGED
@@ -1,158 +1,382 @@
1
- # Copyright (C) 2019 Checkout Field Editor for WooCommerce
2
- # This file is distributed under the same license as the Checkout Field Editor for WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Checkout Field Editor for WooCommerce 1.3.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n"
7
- "POT-Creation-Date: 2019-07-12 12:34:37+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
 
14
 
15
- #: classes/class-wc-checkout-field-editor.php:30
16
- msgid "WooCommerce Checkout Form Designer"
17
  msgstr ""
18
 
19
- #: classes/class-wc-checkout-field-editor.php:30
20
- msgid "Checkout Form"
 
21
  msgstr ""
22
 
23
- #: classes/class-wc-checkout-field-editor.php:47
24
- msgid "Settings"
25
  msgstr ""
26
 
27
- #: classes/class-wc-checkout-field-editor.php:96
28
- msgid "SUCCESS: Checkout fields successfully reset"
29
  msgstr ""
30
 
31
- #: classes/class-wc-checkout-field-editor.php:390
32
- msgid "Fields"
33
  msgstr ""
34
 
35
- #: classes/class-wc-checkout-field-editor.php:431
36
- msgid "+ Add field"
37
- msgstr ""
38
- msgid "Add field"
39
  msgstr ""
40
 
41
- #: classes/class-wc-checkout-field-editor.php:432
42
- msgid "Remove"
 
43
  msgstr ""
44
 
45
- #: classes/class-wc-checkout-field-editor.php:433
46
- msgid "Enable"
 
47
  msgstr ""
48
 
49
- #: classes/class-wc-checkout-field-editor.php:434
50
- msgid "Disable"
51
  msgstr ""
52
 
53
- #: classes/class-wc-checkout-field-editor.php:437
54
- msgid "Save changes"
55
  msgstr ""
56
 
57
- #: classes/class-wc-checkout-field-editor.php:438
58
- msgid "Reset to default fields"
59
  msgstr ""
60
 
61
- #: classes/class-wc-checkout-field-editor.php:589
62
- msgid "Edit"
63
  msgstr ""
64
 
65
- #: classes/class-wc-checkout-field-editor.php:717
66
- msgid "Your changes were saved."
67
  msgstr ""
68
 
69
- #: classes/class-wc-checkout-field-editor.php:719
70
- msgid "Your changes were not saved due to an error (or you made none!)."
71
  msgstr ""
72
- #. Plugin Name of the plugin/theme
73
- msgid "Checkout Field Editor for WooCommerce"
 
74
  msgstr ""
75
 
76
- #. Description of the plugin/theme
77
- msgid "Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields)."
78
  msgstr ""
79
 
80
- #: classes/class-wc-checkout-field-editor.php:489
81
- msgid "Name"
82
  msgstr ""
83
 
84
- #: classes/class-wc-checkout-field-editor.php:490
 
85
  msgid "Type"
86
  msgstr ""
87
 
88
- #: classes/class-wc-checkout-field-editor.php:491
 
 
 
 
 
 
89
  msgid "Label"
90
  msgstr ""
91
 
92
- #: classes/class-wc-checkout-field-editor.php:492
 
 
 
 
 
93
  msgid "Placeholder"
94
  msgstr ""
95
 
96
- #: classes/class-wc-checkout-field-editor.php:493
97
- msgid "Validation Rules"
98
  msgstr ""
99
 
100
- #: classes/class-wc-checkout-field-editor.php:494
101
- msgid "Required"
102
  msgstr ""
103
 
104
- #: classes/class-wc-checkout-field-editor.php:495
105
- msgid "Enabled"
106
  msgstr ""
107
 
108
- #: classes/class-wc-checkout-field-editor.php:290
109
- msgid "Class"
110
  msgstr ""
111
 
112
- #: classes/class-wc-checkout-field-editor.php:298
113
- msgid "Validation"
 
114
  msgstr ""
115
 
116
- #: classes/class-wc-checkout-field-editor.php:316
117
- msgid "Clear Row"
 
118
  msgstr ""
119
 
120
- #: classes/class-wc-checkout-field-editor.php:326
121
  msgid "Display in Emails"
122
  msgstr ""
123
 
124
- #: classes/class-wc-checkout-field-editor.php:333
125
  msgid "Display in Order Detail Pages"
126
  msgstr ""
127
 
128
- #: classes/class-wc-checkout-field-editor.php:257
129
- msgid "New Checkout Field"
130
  msgstr ""
131
 
132
- #: classes/class-wc-checkout-field-editor.php:246
133
- msgid "Text"
134
  msgstr ""
135
 
136
- #: classes/class-wc-checkout-field-editor.php:247
137
- msgid "Select"
138
  msgstr ""
139
 
140
- #: classes/class-wc-checkout-field-editor.php:303
141
- msgid "Phone"
142
  msgstr ""
143
 
144
- #: classes/class-wc-checkout-field-editor.php:302
145
- msgid "Email"
146
  msgstr ""
147
 
148
- #: classes/class-wc-checkout-field-editor.php:304
149
- msgid "Postcode"
150
  msgstr ""
151
 
152
- #: classes/class-wc-checkout-field-editor.php:305
153
- msgid "State"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  msgstr ""
155
 
156
- #: classes/class-wc-checkout-field-editor.php:438
 
 
 
 
 
157
  msgid "Checkout Fields"
158
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2021 ThemeHigh
2
+ # This file is distributed under the same license as the Checkout Field Editor for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Checkout Field Editor for WooCommerce 1.4.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n"
7
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-09-21T17:14:59+05:30\n"
13
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.5.0\n"
15
+ "X-Domain: woo-checkout-field-editor-pro\n"
16
 
17
+ #. Plugin Name of the plugin
18
+ msgid "Checkout Field Editor for WooCommerce"
19
  msgstr ""
20
 
21
+ #. Plugin URI of the plugin
22
+ #. Author URI of the plugin
23
+ msgid "https://www.themehigh.com"
24
  msgstr ""
25
 
26
+ #. Description of the plugin
27
+ msgid "Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields)."
28
  msgstr ""
29
 
30
+ #. Author of the plugin
31
+ msgid "ThemeHigh"
32
  msgstr ""
33
 
34
+ #: admin/class-thwcfd-admin-form-field.php:40
35
+ msgid "Text"
36
  msgstr ""
37
 
38
+ #: admin/class-thwcfd-admin-form-field.php:41
39
+ msgid "Password"
 
 
40
  msgstr ""
41
 
42
+ #: admin/class-thwcfd-admin-form-field.php:42
43
+ #: admin/class-thwcfd-admin-form-field.php:54
44
+ msgid "Email"
45
  msgstr ""
46
 
47
+ #: admin/class-thwcfd-admin-form-field.php:43
48
+ #: admin/class-thwcfd-admin-form-field.php:55
49
+ msgid "Phone"
50
  msgstr ""
51
 
52
+ #: admin/class-thwcfd-admin-form-field.php:44
53
+ msgid "Select"
54
  msgstr ""
55
 
56
+ #: admin/class-thwcfd-admin-form-field.php:45
57
+ msgid "Textarea"
58
  msgstr ""
59
 
60
+ #: admin/class-thwcfd-admin-form-field.php:46
61
+ msgid "Radio"
62
  msgstr ""
63
 
64
+ #: admin/class-thwcfd-admin-form-field.php:56
65
+ msgid "Postcode"
66
  msgstr ""
67
 
68
+ #: admin/class-thwcfd-admin-form-field.php:57
69
+ msgid "State"
70
  msgstr ""
71
 
72
+ #: admin/class-thwcfd-admin-form-field.php:58
73
+ msgid "Number"
74
  msgstr ""
75
+
76
+ #: admin/class-thwcfd-admin-form-field.php:62
77
+ msgid "Full width"
78
  msgstr ""
79
 
80
+ #: admin/class-thwcfd-admin-form-field.php:63
81
+ msgid "Half width left"
82
  msgstr ""
83
 
84
+ #: admin/class-thwcfd-admin-form-field.php:64
85
+ msgid "Half width right"
86
  msgstr ""
87
 
88
+ #: admin/class-thwcfd-admin-form-field.php:68
89
+ #: admin/class-thwcfd-admin-settings-general.php:88
90
  msgid "Type"
91
  msgstr ""
92
 
93
+ #: admin/class-thwcfd-admin-form-field.php:70
94
+ #: admin/class-thwcfd-admin-settings-general.php:87
95
+ msgid "Name"
96
+ msgstr ""
97
+
98
+ #: admin/class-thwcfd-admin-form-field.php:71
99
+ #: admin/class-thwcfd-admin-settings-general.php:89
100
  msgid "Label"
101
  msgstr ""
102
 
103
+ #: admin/class-thwcfd-admin-form-field.php:72
104
+ msgid "Default Value"
105
+ msgstr ""
106
+
107
+ #: admin/class-thwcfd-admin-form-field.php:73
108
+ #: admin/class-thwcfd-admin-settings-general.php:90
109
  msgid "Placeholder"
110
  msgstr ""
111
 
112
+ #: admin/class-thwcfd-admin-form-field.php:75
113
+ msgid "Class"
114
  msgstr ""
115
 
116
+ #: admin/class-thwcfd-admin-form-field.php:75
117
+ msgid "Separate classes with comma"
118
  msgstr ""
119
 
120
+ #: admin/class-thwcfd-admin-form-field.php:76
121
+ msgid "Validation"
122
  msgstr ""
123
 
124
+ #: admin/class-thwcfd-admin-form-field.php:76
125
+ msgid "Select validations"
126
  msgstr ""
127
 
128
+ #: admin/class-thwcfd-admin-form-field.php:79
129
+ #: admin/class-thwcfd-admin-settings-general.php:92
130
+ msgid "Required"
131
  msgstr ""
132
 
133
+ #: admin/class-thwcfd-admin-form-field.php:81
134
+ #: admin/class-thwcfd-admin-settings-general.php:93
135
+ msgid "Enabled"
136
  msgstr ""
137
 
138
+ #: admin/class-thwcfd-admin-form-field.php:83
139
  msgid "Display in Emails"
140
  msgstr ""
141
 
142
+ #: admin/class-thwcfd-admin-form-field.php:84
143
  msgid "Display in Order Detail Pages"
144
  msgstr ""
145
 
146
+ #: admin/class-thwcfd-admin-form-field.php:125
147
+ msgid "Save Field"
148
  msgstr ""
149
 
150
+ #: admin/class-thwcfd-admin-form-field.php:128
151
+ msgid "Basic Info"
152
  msgstr ""
153
 
154
+ #: admin/class-thwcfd-admin-form-field.php:160
155
+ msgid "Save & Close"
156
  msgstr ""
157
 
158
+ #: admin/class-thwcfd-admin-form-field.php:163
159
+ msgid "Next"
160
  msgstr ""
161
 
162
+ #: admin/class-thwcfd-admin-form-field.php:166
163
+ msgid "Back"
164
  msgstr ""
165
 
166
+ #: admin/class-thwcfd-admin-form-field.php:180
167
+ msgid "Basic Details"
168
  msgstr ""
169
 
170
+ #: admin/class-thwcfd-admin-form-field.php:194
171
+ msgid "Display Settings"
172
+ msgstr ""
173
+
174
+ #: admin/class-thwcfd-admin-form-field.php:400
175
+ msgid "Options"
176
+ msgstr ""
177
+
178
+ #: admin/class-thwcfd-admin-form-field.php:408
179
+ #: admin/assets/js/inc/thwcfd-admin-field.js:389
180
+ #: admin/assets/js/thwcfd-admin.js:789
181
+ msgid "Option Value"
182
+ msgstr ""
183
+
184
+ #: admin/class-thwcfd-admin-form-field.php:409
185
+ #: admin/assets/js/inc/thwcfd-admin-field.js:390
186
+ #: admin/assets/js/thwcfd-admin.js:790
187
+ msgid "Option Text"
188
+ msgstr ""
189
+
190
+ #: admin/class-thwcfd-admin-form-field.php:411
191
+ #: admin/assets/js/inc/thwcfd-admin-field.js:392
192
+ #: admin/assets/js/thwcfd-admin.js:792
193
+ msgid "Add new option"
194
+ msgstr ""
195
+
196
+ #: admin/class-thwcfd-admin-form-field.php:411
197
+ #: admin/assets/js/inc/thwcfd-admin-field.js:393
198
+ #: admin/assets/js/thwcfd-admin.js:793
199
+ msgid "Remove option"
200
+ msgstr ""
201
+
202
+ #: admin/class-thwcfd-admin-settings-advanced.php:56
203
+ msgid "Enable label override for address fields."
204
+ msgstr ""
205
+
206
+ #: admin/class-thwcfd-admin-settings-advanced.php:59
207
+ msgid "Enable placeholder override for address fields."
208
+ msgstr ""
209
+
210
+ #: admin/class-thwcfd-admin-settings-advanced.php:62
211
+ msgid "Enable class override for address fields."
212
+ msgstr ""
213
+
214
+ #: admin/class-thwcfd-admin-settings-advanced.php:65
215
+ msgid "Enable priority override for address fields."
216
+ msgstr ""
217
+
218
+ #: admin/class-thwcfd-admin-settings-advanced.php:68
219
+ msgid "Enable required validation override for address fields."
220
+ msgstr ""
221
+
222
+ #: admin/class-thwcfd-admin-settings-advanced.php:91
223
+ msgid "Settings successfully reset."
224
+ msgstr ""
225
+
226
+ #: admin/class-thwcfd-admin-settings-advanced.php:127
227
+ #: admin/class-thwcfd-admin-settings-general.php:252
228
+ #: admin/class-thwcfd-admin-settings-general.php:312
229
+ msgid "Your changes were saved."
230
+ msgstr ""
231
+
232
+ #: admin/class-thwcfd-admin-settings-advanced.php:129
233
+ #: admin/class-thwcfd-admin-settings-general.php:254
234
+ #: admin/class-thwcfd-admin-settings-general.php:314
235
+ msgid "Your changes were not saved due to an error (or you made none!)."
236
  msgstr ""
237
 
238
+ #: admin/class-thwcfd-admin-settings-advanced.php:158
239
+ msgid "Are you sure you want to reset to default settings? all your changes will be deleted."
240
+ msgstr ""
241
+
242
+ #: admin/class-thwcfd-admin-settings-general.php:31
243
+ #: admin/class-thwcfd-admin-settings.php:24
244
  msgid "Checkout Fields"
245
  msgstr ""
246
+
247
+ #: admin/class-thwcfd-admin-settings-general.php:32
248
+ #: admin/class-thwcfd-admin-settings.php:25
249
+ msgid "Advanced Settings"
250
+ msgstr ""
251
+
252
+ #: admin/class-thwcfd-admin-settings-general.php:33
253
+ #: admin/class-thwcfd-admin-settings.php:26
254
+ msgid "Premium Features"
255
+ msgstr ""
256
+
257
+ #: admin/class-thwcfd-admin-settings-general.php:36
258
+ msgid "Billing Fields"
259
+ msgstr ""
260
+
261
+ #: admin/class-thwcfd-admin-settings-general.php:37
262
+ msgid "Shipping Fields"
263
+ msgstr ""
264
+
265
+ #: admin/class-thwcfd-admin-settings-general.php:38
266
+ msgid "Additional Fields"
267
+ msgstr ""
268
+
269
+ #: admin/class-thwcfd-admin-settings-general.php:74
270
+ msgid "Checkout fields successfully reset"
271
+ msgstr ""
272
+
273
+ #: admin/class-thwcfd-admin-settings-general.php:91
274
+ msgid "Validations"
275
+ msgstr ""
276
+
277
+ #: admin/class-thwcfd-admin-settings-general.php:94
278
+ #: admin/class-thwcfd-admin-settings-general.php:190
279
+ msgid "Edit"
280
+ msgstr ""
281
+
282
+ #: admin/class-thwcfd-admin-settings-general.php:101
283
+ msgid "Add field"
284
+ msgstr ""
285
+
286
+ #: admin/class-thwcfd-admin-settings-general.php:102
287
+ msgid "Remove"
288
+ msgstr ""
289
+
290
+ #: admin/class-thwcfd-admin-settings-general.php:103
291
+ msgid "Enable"
292
+ msgstr ""
293
+
294
+ #: admin/class-thwcfd-admin-settings-general.php:104
295
+ msgid "Disable"
296
+ msgstr ""
297
+
298
+ #: admin/class-thwcfd-admin-settings-general.php:107
299
+ msgid "Save changes"
300
+ msgstr ""
301
+
302
+ #: admin/class-thwcfd-admin-settings-general.php:108
303
+ msgid "Reset to default fields"
304
+ msgstr ""
305
+
306
+ #: admin/class-thwcfd-admin-settings-general.php:109
307
+ msgid "Are you sure you want to reset to default fields? all your changes will be deleted."
308
+ msgstr ""
309
+
310
+ #: admin/class-thwcfd-admin-settings-general.php:257
311
+ #: admin/class-thwcfd-admin-settings-general.php:317
312
+ msgid "Your changes were not saved due to an error."
313
+ msgstr ""
314
+
315
+ #: admin/class-thwcfd-admin-settings-general.php:272
316
+ msgid "Your changes were not saved due to no fields found."
317
+ msgstr ""
318
+
319
+ #: admin/class-thwcfd-admin.php:55
320
+ msgid "WooCommerce Checkout Field Editor"
321
+ msgstr ""
322
+
323
+ #: admin/class-thwcfd-admin.php:55
324
+ msgid "Checkout Form"
325
+ msgstr ""
326
+
327
+ #: admin/class-thwcfd-admin.php:60
328
+ msgid "WooCommerce"
329
+ msgstr ""
330
+
331
+ #: admin/class-thwcfd-admin.php:66
332
+ msgid "Settings"
333
+ msgstr ""
334
+
335
+ #: admin/class-thwcfd-admin.php:68
336
+ msgid "Get Pro"
337
+ msgstr ""
338
+
339
+ #: admin/class-thwcfd-admin.php:102
340
+ msgid "Just wanted to say thank you for using Checkout Field Editor plugin in your store."
341
+ msgstr ""
342
+
343
+ #: admin/class-thwcfd-admin.php:103
344
+ msgid "We hope you had a great experience. Please leave us with your feedback to serve best to you and others. Cheers!"
345
+ msgstr ""
346
+
347
+ #: admin/class-thwcfd-admin.php:105
348
+ msgid "Review Now"
349
+ msgstr ""
350
+
351
+ #: admin/class-thwcfd-admin.php:106
352
+ msgid "Remind Me Later"
353
+ msgstr ""
354
+
355
+ #: public/class-thwcfd-public-checkout.php:355
356
+ msgid "<strong>%s</strong> is not a valid number."
357
+ msgstr ""
358
+
359
+ #: admin/assets/js/inc/thwcfd-admin-field.js:10
360
+ #: admin/assets/js/thwcfd-admin.js:410
361
+ msgid "NAME/ID must begin with a lowercase letter ([a-z]) or underscores (\"_\") and may be followed by any number of lowercase letters, digits ([0-9]) and underscores (\"_\")"
362
+ msgstr ""
363
+
364
+ #: admin/assets/js/inc/thwcfd-admin-field.js:59
365
+ #: admin/assets/js/thwcfd-admin.js:459
366
+ msgid "Edit Field"
367
+ msgstr ""
368
+
369
+ #: admin/assets/js/inc/thwcfd-admin-field.js:59
370
+ #: admin/assets/js/thwcfd-admin.js:459
371
+ msgid "New Field"
372
+ msgstr ""
373
+
374
+ #: admin/assets/js/inc/thwcfd-admin-field.js:310
375
+ #: admin/assets/js/thwcfd-admin.js:710
376
+ msgid "Enter a value given in the options."
377
+ msgstr ""
378
+
379
+ #: admin/assets/js/inc/thwcfd-admin.js:74
380
+ #: admin/assets/js/thwcfd-admin.js:935
381
+ msgid "Yes"
382
+ msgstr ""
public/class-thwcfd-public-checkout.php CHANGED
@@ -292,7 +292,7 @@ class THWCFD_Public_Checkout {
292
  $options_arr = THWCFD_Utils::prepare_field_options($new_field['options']);
293
  $options = array();
294
  foreach($options_arr as $key => $value) {
295
- $options[$key] = __($value, 'woo-checkout-field-editor-pro');
296
  }
297
  $new_field['options'] = $options;
298
  }
@@ -348,11 +348,11 @@ class THWCFD_Public_Checkout {
348
  if($value && is_array($validators) && !empty($validators)){
349
  foreach($validators as $vname){
350
  $err_msg = '';
351
- $flabel = isset($field['label']) ? THWCFD_Utils::t($field['label']) : $key;
352
 
353
  if($vname === 'number'){
354
  if(!is_numeric($value)){
355
- $err_msg = '<strong>'. $flabel .'</strong> '. THWCFD_Utils::t('is not a valid number.');
356
  }
357
  }
358
 
@@ -388,7 +388,7 @@ class THWCFD_Public_Checkout {
388
  $fields = THWCFD_Utils::get_fields($type);
389
 
390
  foreach($fields as $name => $field){
391
- if(THWCFD_Utils::is_active_custom_field($field) && isset($posted[$name])){
392
 
393
  $type = isset($field['type']) ? $field['type'] : 'text';
394
 
@@ -434,7 +434,7 @@ class THWCFD_Public_Checkout {
434
 
435
  // Loop through all custom fields to see if it should be added
436
  foreach( $fields as $key => $field ) {
437
- if(isset($field['show_in_email']) && $field['show_in_email']){
438
  $order_id = THWCFD_Utils::get_order_id($order);
439
  $value = get_post_meta( $order_id, $key, true );
440
 
@@ -472,7 +472,7 @@ class THWCFD_Public_Checkout {
472
  $fields_html = '';
473
  // Loop through all custom fields to see if it should be added
474
  foreach($fields as $key => $field){
475
- if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order']){
476
  $value = get_post_meta( $order_id, $key, true );
477
 
478
  if($value){
292
  $options_arr = THWCFD_Utils::prepare_field_options($new_field['options']);
293
  $options = array();
294
  foreach($options_arr as $key => $value) {
295
+ $options[$key] = THWCFD_Utils::t($value);
296
  }
297
  $new_field['options'] = $options;
298
  }
348
  if($value && is_array($validators) && !empty($validators)){
349
  foreach($validators as $vname){
350
  $err_msg = '';
351
+ $flabel = isset($field['label']) ? $field['label'] : $key;
352
 
353
  if($vname === 'number'){
354
  if(!is_numeric($value)){
355
+ $err_msg = sprintf( __( '<strong>%s</strong> is not a valid number.', 'woo-checkout-field-editor-pro' ), $flabel );
356
  }
357
  }
358
 
388
  $fields = THWCFD_Utils::get_fields($type);
389
 
390
  foreach($fields as $name => $field){
391
+ if(THWCFD_Utils::is_active_custom_field($field) && isset($posted[$name]) && !THWCFD_Utils::is_wc_handle_custom_field($field)){
392
 
393
  $type = isset($field['type']) ? $field['type'] : 'text';
394
 
434
 
435
  // Loop through all custom fields to see if it should be added
436
  foreach( $fields as $key => $field ) {
437
+ if(isset($field['show_in_email']) && $field['show_in_email'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
438
  $order_id = THWCFD_Utils::get_order_id($order);
439
  $value = get_post_meta( $order_id, $key, true );
440
 
472
  $fields_html = '';
473
  // Loop through all custom fields to see if it should be added
474
  foreach($fields as $key => $field){
475
+ if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
476
  $value = get_post_meta( $order_id, $key, true );
477
 
478
  if($value){
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 1.4.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -249,6 +249,12 @@ Yes. There is a button 'reset to default fields' to go back to the WooCommerce d
249
  9. Locale override settings
250
 
251
  == Changelog ==
 
 
 
 
 
 
252
  = 1.4.9 =
253
  * Added security improvements.
254
  * Added compatibility with PHP 8 version.
5
  Requires at least: 4.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 1.5.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
249
  9. Locale override settings
250
 
251
  == Changelog ==
252
+ = 1.5.0 =
253
+ * Improved the pot file.
254
+ * Added compatibility with Loco Translate plugin.
255
+ * Added WPML compatibility for dynamic strings.
256
+ * Added WooCommerce 5.8.0 compatibility.
257
+
258
  = 1.4.9 =
259
  * Added security improvements.
260
  * Added compatibility with PHP 8 version.