<input type="hidden" id="customer_details_id" value="{{id}}">
<script type="text/template" id="tmpl-form-add-customer">
<input type="hidden" id="customer_details_id" value="{{id}}">
<div id="pos_billing_details" class="pos-customer-details-tab">
<div class="woocommerce-billing-fields">
<?php
// Fix for checkout address if the WooCommerce Subscriptions plugin activated
remove_all_filters('woocommerce_checkout_get_value');
$checkout = WC()->checkout();
$wc_reg_generate_username_opt = get_option('woocommerce_registration_generate_username');
$wc_reg_generate_pass_opt = get_option('woocommerce_registration_generate_password');
$required_fields = get_option('wc_pos_customer_create_required_fields', false);
$hide_fields = get_option('wc_pos_hide_not_required_fields', 'no');
//unset($checkout->checkout_fields['order']['order_comments']);
$customer_id = '{{id}}';
$customer_id = filter_var((int)$customer_id, FILTER_SANITIZE_NUMBER_INT);
if (isset($checkout->checkout_fields['billing'])) {
if (function_exists('wc_address_validation')) {
$validation_handler = wc_address_validation()->get_handler_instance();
$validation_handler->show_billing_postcode_lookup();
}
foreach ($checkout->checkout_fields['billing'] as $key => $field) :
$value = str_replace('billing_', 'billing_address.', $key);
if ($required_fields !== false && !in_array($key, $required_fields) && !in_array($key, array('billing_first_name', 'billing_last_name', 'billing_email'))) {
$field['required'] = false;
}
if ($hide_fields == 'yes' && $field['required'] == false) {
continue;
}
if (strpos($value, 'billing_address.') === false && strpos($value, 'billing_address.') !== 0) {
$value = 'billing_address.[' . $key . ']';
}
if (get_option('woocommerce_allowed_countries') == 'specific' && $key == 'billing_country') {
$countries = get_option('woocommerce_specific_allowed_countries');
if (count($countries) == 1) {
$field['country'] = $countries['0'];
}
}
if (get_option('woocommerce_allowed_countries') == 'specific' && $key == 'billing_state') {
$field['type'] = 'state';
}
if ($customer_id != '0') {
if (get_option('woocommerce_allowed_countries') == 'specific' && $key == 'billing_state') {
$value = get_user_meta($customer_id, 'billing_state', true);
}
if ($key == 'billing_email') {
$value = get_user_meta($customer_id, 'billing_email', true);
}
if ($key == 'billing_first_name') {
$value = get_user_meta($customer_id, 'billing_first_name', true);
}
if ($key == 'billing_last_name') {
$value = get_user_meta($customer_id, 'billing_last_name', true);
}
if (
(get_option('woocommerce_allowed_countries') == 'specific' && $key == 'billing_state') ||
$key == 'billing_email' ||
$key == 'billing_first_name' ||
$key == 'billing_last_name'
) {
var_dump($value);
woocommerce_form_field($key, $field, $value);
} else {
woocommerce_form_field($key, $field, '{{' . $value . '}}');
}
} else {
woocommerce_form_field($key, $field, '{{' . $value . '}}');
}
endforeach;
}.....
Я как вариант могу добавить правила в htaccess, но там нормальные страницы есть, а есть около 150, все не подберу так) И можно ли потом отменить 410 для нормальных страниц?
Спасибо!