feat: WooCommerce-first sync + location code filter
Reversed the product sync direction: instead of pulling all 60k+ items from BC and matching against WooCommerce (600+ paginated API calls that timeout), now iterates the ~100 WooCommerce products and queries BC for each one by GTIN/item number (1-2 API calls per product). Added Location Code setting (e.g. "ICP") to filter stock by BC location. Uses Item Ledger Entries endpoint to sum per-location stock. Falls back to total inventory if the endpoint is unavailable. Also registered wbc_location_code in sync settings group and uninstall. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ $options_to_delete = array(
|
||||
'wbc_default_payment_terms_id',
|
||||
'wbc_default_shipment_method_id',
|
||||
'wbc_shipping_item_number',
|
||||
'wbc_location_code',
|
||||
'wbc_last_sync_time',
|
||||
'wbc_encryption_key',
|
||||
'wbc_delete_data_on_uninstall',
|
||||
|
||||
Reference in New Issue
Block a user