PHP /** * Sincronizar NIF de outros campos para o campo correto do checkout/site */ add_action('save_post_shop_order', function($post_id) { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; if (wp_is_post_revision($post_id)) return; if (get_post_type($post_id) !== 'shop_order') return; $tax = get_post_meta($post_id, '_billing_tax_registration_number', true); if (empty($tax)) { $tax = get_post_meta($post_id, '_billing_nif', true); } if (empty($tax)) { $tax = get_post_meta($post_id, 'billing_nif', true); } if (empty($tax)) { $tax = get_post_meta($post_id, '_billing_vat', true); } if (!empty($tax)) { update_post_meta($post_id, '_billing_tax_registration_number', $tax); } }, 20); ?>
Thank you for being patient. We are doing some work on the site and will be back shortly.