feat: customer lookup by NIF with default customer fallback

- Search BC customers by taxRegistrationNumber (NIF/CIF from _nif meta)
- If NIF found in BC, use that customer; if not, create with NIF
- If no NIF on order, use configurable default customer number
- Add Default Customer Number setting in Order Settings tab

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 16:06:42 +01:00
parent 6bc70afaf1
commit 782681b30f
3 changed files with 57 additions and 20 deletions

View File

@@ -94,6 +94,9 @@ class WBC_Admin {
register_setting( 'wbc_orders', 'wbc_shipping_item_number', array(
'sanitize_callback' => 'sanitize_text_field',
) );
register_setting( 'wbc_orders', 'wbc_default_customer_number', array(
'sanitize_callback' => 'sanitize_text_field',
) );
}
/**