Это PHP-код, который я использовал для рендеринга, как показано на изображении выше.
Код: Выделить всё
Код: Выделить всё
//Add participants number and details
var participants = 0;
document.onreadystatechange = function() {
document.getElementById('add_participant_button').onclick = function() {
participants += 1;
addParticipantsDetails();
console.log(participants);
}
document.getElementById('remove_participant_button').onclick = function() {
removeParticipantsDetails();
participants -= 1;
if (participants
Подробнее здесь: [url]https://stackoverflow.com/questions/78552735/add-remove-custom-field-into-woocommerce-checkout-billing-form-using-javascrip[/url]