Hi there, I added two new fields through this plugin but the added fields are not showing up on checkout page. What could be the issue?
]]>When the Woo Checkout Field Editor Pro plugin is activated, a JavaScript error occurs on the plugins page wp-admin/plugins.php. The error message in the browser console is as follows:
Uncaught SyntaxError: Unexpected string (at plugins.php:5381:89)
This error is caused by the following line of code in the plugin:
reason_input += '<option value="' . esc_attr(HOUR_IN_SECONDS) . '">1 Hour</option>';
The issue arises because the HOUR_IN_SECONDS
constant is not properly replaced with a numeric value when the HTML is generated by PHP. As a result, the client-side code fails due to a syntax error.
Path to the Problematic Code:
Plugin file: plugins\woo-checkout-field-editor-pro\includes\class-thwcfd.php
Code lines (387–392):
reason_input += '<label for="th-snooze">Snooze this panel while troubleshooting</label>';
reason_input += '<select name="th-snooze-time" class="th-snooze-select" disabled>';
reason_input += '<option value="' . esc_attr(HOUR_IN_SECONDS) . '">1 Hour</option>';
reason_input += '<option value="' . esc_attr(12 * HOUR_IN_SECONDS) . '">12 Hour</option>';
reason_input += '<option value="' . esc_attr(DAY_IN_SECONDS) . '">24 Hour</option>';
reason_input += '<option value="' . esc_attr(WEEK_IN_SECONDS) . '">1 Week</option>';
Cause of the Issue:
PHP constants like HOUR_IN_SECONDS
are not interpolated correctly in JavaScript. These constants need to be evaluated on the server side and passed as specific numeric values.
Solution:
To resolve this issue, the code should be modified so that the PHP constants are passed into JavaScript as numbers. For example:
<script type="text/javascript">
(function($){
var popup = $("#thwcfd_deactivation_form");
var deactivation_link = '';
$('.thwcfd-deactivate-link').on('click', function(e){
e.preventDefault();
deactivation_link = $(this).attr('href');
popup.css("display", "block");
popup.find('a.thwcfd-deactivate').attr('href', deactivation_link);
});
popup.on('click', 'input[type="radio"]', function () {
var parent = $(this).parents('li:first');
popup.find('.reason-input').remove();
var type = parent.data('type');
var placeholder = parent.data('placeholder');
var reason_input = '';
if('text' == type){
reason_input += '<div class="reason-input">';
reason_input += '<input type="text" placeholder="'+ placeholder +'">';
reason_input += '</div>';
}else if('textarea' == type){
reason_input += '<div class="reason-input">';
reason_input += '<textarea row="5" placeholder="'+ placeholder +'">';
reason_input += '</textarea>';
reason_input += '</div>';
}else if('checkbox' == type){
reason_input += '<div class="reason-input ">';
reason_input += '<input type="checkbox" id="th-snooze" name="th-snooze" class="th-snooze-checkbox">';
reason_input += '<label for="th-snooze">Snooze this panel while troubleshooting</label>';
reason_input += '<select name="th-snooze-time" class="th-snooze-select" disabled>';
// PHP constants will be output here as actual values
reason_input += '<option value="' + <?php echo HOUR_IN_SECONDS; ?> + '">1 Hour</option>';
reason_input += '<option value="' + <?php echo 12 * HOUR_IN_SECONDS; ?> + '">12 Hour</option>';
reason_input += '<option value="' + <?php echo DAY_IN_SECONDS; ?> + '">24 Hour</option>';
reason_input += '<option value="' + <?php echo WEEK_IN_SECONDS; ?> + '">1 Week</option>';
reason_input += '<option value="' + <?php echo MONTH_IN_SECONDS; ?> + '">1 Month</option>';
reason_input += '</select>';
reason_input += '</div>';
}else if('reviewlink' == type){
reason_input += '<div class="reason-input wcfe-review-link">';
reason_input += '<input type="hidden" value="<?php esc_html_e('Upgraded', 'woo-checkout-field-editor-pro');?>">';
reason_input += '</div>';
}
if(reason_input !== ''){
parent.append($(reason_input));
}
});
popup.on('click', '.thwcfd-close', function () {
popup.css("display", "none");
});
popup.on('click', '.thwcfd-submit-deactivate', function (e) {
e.preventDefault();
var button = $(this);
if (button.hasClass('disabled')) {
return;
}
var radio = $('.deactivation-reason input[type="radio"]:checked');
var parent_li = radio.parents('li:first');
var parent_ul = radio.parents('ul:first');
var input = parent_li.find('textarea, input[type="text"], input[type="hidden"]');
var wcfe_deacive_nonce = parent_ul.data('nonce');
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'thwcfd_deactivation_reason',
reason: (0 === radio.length) ? 'none' : radio.val(),
comments: (0 !== input.length) ? input.val().trim() : '',
security: wcfe_deacive_nonce,
},
beforeSend: function () {
button.addClass('disabled');
button.text('Processing...');
},
complete: function () {
window.location.href = deactivation_link;
}
});
});
popup.on('click', '#th-snooze', function () {
if($(this).is(':checked')){
popup.find('.th-snooze-select').prop("disabled", false);
}else{
popup.find('.th-snooze-select').prop("disabled", true);
}
});
}(jQuery))
</script>
The esc_attr(HOUR_IN_SECONDS)
should be replaced with the actual numeric value of the constant, possibly by passing it through Ajax or another method of server-client interaction.
Recommendation for Plugin Developers:
Bonjour
j’ai créé un champ personnalisé Billing Fields checkbox en précisant les options suivantes :
Activé,?Afficher dans les e-mails,?Afficher dans les pages de détails de commande
J’ai également créer un autre champ personnalisé Additional Fields bouton radio avec les mêmes options
Cependant cela n’apparait pas dans les mails administrateurs ni dans le détail de commande
Merci de m’aider à résoudre cela
]]>I’ve added two custom checkboxes to the WooCommerce checkout:
These fields are required, but even if they are not checked, the order can still be placed. However, the validation doesn’t seem to trigger properly. What could be causing this validation to fail? The checkboxes are visible in the checkout, any help would be appreciated!
]]>Hello everyone,
Can i use the premium version of the plugin to validate that the customer provided his correct e-mail adres by imputting it twice? If the second provided e-mail adres differs from the first it should prompt an error.
I have removed all the fields, but the default fields are still showing. I am using the Kadence theme. Please suggest me a solution.
]]>After update to the v2.0.5 the fields did not display in the Woo Order Detail Pages. After restoring (rollback) to v2.04 the fields showed again.
Please fix this issue, asop.
]]>Hello
I dont want to auto-complete name / surname / adress etc when a customer write on forms
How to do this ?
Thanks a lot
]]>Hello,
I added a field during an order, but it is not displaying. Is your plugin compatible with the “Payment Plugins for Stripe WooCommerce” plugin?
Thanks
Getting this message in Query monitor with WP 6.7 and PHP 8.3:
Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the brands-for-woocommerce domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. (This message was added in version 6.7.0.)
]]>my checkout page is build with blocks, there is no communication between the check out field editor and the check out page, changes made are not visible on the page. Looks like it is still in short code. How do I correct that?
thank you.
]]>Plugin is NOT compatiable with: 1 Incompatible plugin detected (Checkout Field Editor for WooCommerce).
See this screenshot:
this is the only plugin that is NOT compatiable and cnsidering its specific to Woo thats pretty poor.. Can you advise when it will be compatiable???
]]>Hi There,
Your plugin is calling to: https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.3/i18n/jquery-ui-i18n.min.js?ver=1 which results as 404 not found.
turning off all plugins to identify this issue identified that your plugin is the culprit. See this imge too:
we use google fonts and other google serices and all those work fine. Just the jquery UI thats been called by your plugin is an issue. Please can you fix this?
]]>Hi there
I wanted to ask why the date field isn’t rendered according to the date settings in WordPress? In order confirmation emails as well as on the order edit page I see a date entered in a date field in the format 2024-11-07 (YYYY-MM-DD). But I’d like to have it look like 07.11.2024 (DD.MM.YYYY) or 7. November 2024. How to do that?
Those are my general settings: https://nimb.ws/yjlfoKx
I went into the plugin and disable and hide all the field but it is still telling me i require them. they still sow up.
]]>After having the plugin installed since 2021, it recently started to fail.
The checkout does not allow completion, since it indicates an error “Enter the address”, although all the mandatory data in the form is complete, including the address.
Good afternoon team,
I have the following problem:
The link to complete the purchase of a product is: vajillasycubos.com/finalizar-compra
In this link the Checkout Field Editor for WooCommerce plugin is located, all the data is completed and for some reason the process payment button (which is a button shown by woo cheackout) is blocked.
However, I have carried out the test by adding the button twice, and so the 2nd button does “work”, however the first button is still blocked.
Please I will appreciate your support to verify if the latest update has caused this error.
Apparently it is a type of incompatibility between Checkout Field Editor for WooCommerce and Woocommerce or DIVI
Thank you.
]]>Hi team,
I created a custom date and select field and set them to required but the user is still able to proceed without filling them in. Any ideas?
Thanks!
]]>Is there a way i can add form fields that i created using your plugin on the checkout page below the payment methods?
]]>Hi,
We are looking to add a radio button field to the checkout where users can choose between different design options. However, instead of displaying these options as text, we would like to present them as images for the users to select.
Could you please guide us on how to implement this functionality using the plugin? We need users to visually choose from design options by clicking on the corresponding images in the checkout.
Any assistance or advice would be greatly appreciated.
Thank you!
]]>Hi!
Our checkout page has been working for several years and just recently, any field that is required is now giving an error. We fill it in and try to process payments and it says that the fields are required even though they are already filled. When I take the “required” off, it seems to work but we need fields to be required. We appreciate any direction and help that you can give. Thanks!
]]>Hello
When this plugin active when my account page billing address all fields edit save address not working.
So, What is issue or any solutions for this?
Thanks
Good evening,
the plugin seems to load in the first second but then gets replaced by the standard one and doesn’t work. Do you have any advice/solution other than disabling plugins and clearing cache?
hola, me gustaria establecer un numero maximo de caracteres en order notes. Es posible?
]]>Hi, in the “order edit” section: I can’t edit the value of the custom fields. Only over the wordpress native “Custom fields”. Is it in the free version not possible or i miss a setting?
Screenshot:
https://tinyurl.com/yl95qzeo
Is it possible that the user can change this values in the user profile page. I saw in your documentation that you have the checkbox “user meta data”. I dont see this in the free version? Is this a part of the pro version?
https://www.themehigh.com/docs/create-user-meta-fields/
It is not compatible with woo commerce anymore; not working
]]>For the fields in checkout page.
Name, Adress… This plugin check: [billing_first_name]
But new fields in woo: [billing-first_name],[billing-address_1],…
The first dash is a mid dash, not a low bar! This is happening with all plugins for checkout
How can I solved it? I have tested code, but no success.
Trying to ensure a phone number is added to orders but the field isn’t showing as mandatory.
Already followed the steps provided in a previous thread:
Hi,
Please ensure that you have enabled the options “Enable required validation override for address fields.” and “Enable placeholder override for address fields.” in the Locale override settings inside the Advanced Settings tab . If not, please enable it and verify from your side.
Thank you!
The issue still persists.
Tahnk you
]]>I recently have tried to edit some custom fields. But the edit mode (interface) is damaged: so I cannot access the necessary fields to do some changes and save them. I’ve searched the forum but did not find any related topics.
Best regards, Jan
Hi,
I have added two new fields to my checkout form.
I have translated them using the Polylang plugin but the translations are not displayed on the front end in their corresponding languages.
I have cleared the page cache and the labels are still not translated.
What could be the problem?
Thanks.
Regards.