Version History

🔧 Version 2.1.8 (2026-03-04) - LICENSE, DIAGNOSTIC AND CRON FIXES

🔑 License and validation
  • Database license validation: Legacy endpoint now uses the centralized database — Shopify Billing licenses are properly recognized
  • Aligned diagnostics: License diagnostic now uses the same logic as the License tab (shop_domain priority)
🐛 Bug fixes
  • Order CRON: Fixed crash with stdClass treated as array + missing setLoggerPrefix method
  • CRON diagnostic: Now respects actual module configuration
  • OAuth: Accept non-RFC domain names with trailing hyphen
  • SQL: information_schema pattern compatible with MySQL 5.7+ / MariaDB
  • Migration: Idempotent update script (checks source table existence)

💳🏪 Version 2.1.7 (2026-01-29) - SHOPIFY BILLING API + DUAL-CHANNEL ARCHITECTURE

💳 Shopify Billing API
  • Central server: MySQL database + REST API + Billing webhooks
    • 5 SQL tables (licenses, subscriptions, billing_events, download_tokens, license_domains)
    • Complete billing API (check, link-serial, status, generate-download-token)
    • Webhooks: app_subscriptions/update, app/uninstalled, billing_attempts
  • Web admin interface: Dashboard, license management, subscriptions, events, migration
  • Shopify Embedded App: Subscription choice, payment callback, secure ZIP download
🔗 Dual-Channel Architecture
  • New customers: Purchase via Shopify App Store (€250/year or €25/month)
  • DoliStore customers: Link existing serial to avoid double payment
  • DoliStore expiration: Invitation to renew via Shopify Billing
🐛 Bug Fixes
  • Issue #233: Discounts not applied to services during order import
    • Fallback on discountAllocations for global discounts
    • Custom services now included in discount calculation
📚 Documentation
  • Complete Shopify Partner configuration guide (300+ lines)
  • 46 new translation keys × 5 languages

🔒🔄 Version 2.1.6 (2025-12-10) - COMPLETE SECURITY AUDIT + SHOPIFY→DOLIBARR IMPORT

🔴 CRITICAL Issues Fixed (17/17 = 100%)
  • CSRF Tokens: Protection added to 15 admin/ajax files
  • XSS: Complete HTML escaping with htmlspecialchars()
  • GDPR API Key: Externalized (no longer hardcoded)
  • SSL/TLS: SSL verification re-enabled (6 occurrences)
  • Replay Attacks: GDPR webhooks protection
  • Debug Files: Protected by SHOPIFY_DEBUG_MODE
🔵 MAJOR Issues Fixed (~90%)
  • SQL Errors: Generic messages (no technical exposure)
  • Transactions: Added on bulk operations
  • SQL Indexes: 6 new indexes for performance
  • Code Cleanup: -29 unused template lines
🟢 New Feature: Shopify → Dolibarr Import
  • New CRON: ShopifyProductImportCron for automatic import
  • Bidirectional Sync: Complete Dolibarr↔Shopify synchronization

✨📋 Version 2.1.5 (2025-11-22) - COMPANY FIELD SUPPORT + ADDRESS HISTORY + METAFIELDS PAGINATION

🟢 FIX #1 - Full Support for "Company" Field (Business Name)
  • ISSUE: "Company" field enabled in Shopify but not synchronized to Dolibarr
  • CLIENT REQUEST: "I enabled the Shopify field that allows company name retrieval, but it's not coming through"
  • IMPACT: Business customers created with first name + last name instead of company name
✅ Implemented Solution
  • GraphQL: Added company field in 3 addresses (customer.defaultAddress, billingAddress, shippingAddress)
  • Priority logic: company if provided, otherwise firstName + lastName (fallback)
  • Complete integration: Customer name, billing/shipping addresses, contacts (job title field)
  • Files: shopifyapi.class.php (lines 2589, 2608, 2621) + shopifyordermanager.class.php (lines 760-769, 1219-1223, 1244-1248, 2027-2031)
🟢 FIX #2 - Metafields Pagination (Data Loss Protection >250)
  • ISSUE: GraphQL limit of 250 metafields without pagination = silent data loss beyond limit
  • RISK: Pickup points (Boxtal, Mondial Relay, Atlas) in metafields >250 never retrieved
  • IMPACT: Incomplete orders, missing shipping information
✅ Implemented Solution
  • GraphQL pageInfo: Added hasNextPage + endCursor structure in metafields
  • New method: getAllOrderMetafields() - automatic pagination with cursor (92 lines)
  • Smart integration: Automatic detection ≥250 metafields → pagination activation
  • Safety: 100 pages limit (25,000 metafields max) to prevent infinite loops
  • Files: shopifyapi.class.php (lines 2724-2906) + shopifyordermanager.class.php (lines 1041-1063)
🟢 FIX #3 - 10 Dedicated SQL Columns for Pickup Points
  • ISSUE: Pickup point data stored in monolithic JSON → impossible to query in SQL
  • LIMITATION: No statistics, search, or filtering by carrier/city/country possible
  • IMPACT: Degraded performance, impossible reporting
✅ Implemented Solution
  • 10 SQL columns: pickup_provider, pickup_point_id, pickup_point_name, pickup_address_line1, pickup_address_line2, pickup_city, pickup_zip, pickup_country, pickup_phone, pickup_extra_data
  • Index created: pickup_point_id for fast searches
  • Compatibility: Legacy JSON preserved in pickup_extra_data for provider-specific data
  • Extrafields registration: Automatic integration in llx_extrafields
  • Files: sql/update_2.1.4_2.1.5.sql (273 lines) + shopifyordermanager.class.php (lines 2360-2459)
🟠 IMPROVEMENT #4 - GraphQL Limits Monitoring
  • OBJECTIVE: Automatically detect potential GraphQL data truncations
  • MONITORING: lineItems (≥40), shippingLines (≥5), discountApplications (≥10), transactions (≥5)
  • LOGS: Automatic alerts at LOG_WARNING level if limits reached
  • File: shopifyordermanager.class.php (lines 976-997)
🟣 TECHNICAL STATISTICS
  • Core code lines: ~530 lines (4 GraphQL modifications + 1 new method + company logic + pagination + monitoring)
  • SQL lines: 273 lines (10 columns + extrafields + indexes)
  • ChangeLog lines: 160 lines complete documentation
  • Total: 963 lines added
  • Validation: 100% syntax validated + GraphQL tests passed
  • Commit: 4fc6ef2 on branch dev-v2.1.5-corrections
✅ Client Impact
  • Business customers: Company name correctly synchronized
  • Address history: Multiple contacts preserved in customer record
  • Pickup points: 100% data retrieved even for complex orders
  • Performance: Native SQL queries on pickup points (100x faster)
  • Reporting: Statistics by carrier, city, country now possible

🐛✨ Version 2.1.3 (2025-10-31) - BUG FIXES + ORDER DATA ENRICHMENT

🔴 ISSUE #152 - PHP Warning 'Undefined array key ref' (MAJOR BUG)
  • PROBLEM: Repeated PHP Warning in Apache logs during product synchronization with collections
  • CAUSE: Missing c.ref column in 2 SELECT SQL queries (lines 5369 and 5472)
  • FIX: Added c.ref to SQL SELECT queries
  • IMPACT: Clean Apache logs, compliant code
🟠 ISSUE #153 - Sales channels not published on product updates (ENHANCEMENT)
  • PROBLEM: Products updated via productUpdate() not published to sales channels
  • FIX: Added publishProductToConfiguredChannels() after productUpdate()
  • IMPACT: All synchronization flows now publish to configured channels
🔴 ISSUE #154 - Variant product images not syncing (CRITICAL BUG)
  • PROBLEM: 100% product images (simple AND variants) failing since v2.1.0
  • ERROR: HTTP 503 "Bad value for API key. Should not start with dolcrypt:"
  • CAUSE: ConfigurationMigrator returns encrypted API keys instead of decrypting them
  • REGRESSION: Introduced in v2.1.0 with Issue #144 (ConfigurationMigrator)
✅ Fix Implemented
  • SOLUTION: Automatic detection of 4 sensitive API keys + decryption via getDolGlobalString()
  • Whitelist: ACCESS_TOKEN, API_KEY, API_SECRET_KEY, DOLIBARR_API_KEY
  • Other constants: Direct SQL read unchanged (performance)
  • File: class/configurationMigrator.class.php (lines 452-487, +15 lines)
✅ Immediate Impact
  • 100% images synchronized (simple AND variants)
  • ✅ HTTP 200 instead of HTTP 503
  • ✅ Clean logs without API key errors
  • ✅ Zero regression on non-encrypted configurations
🟢 ISSUE #151 - Complete product information retrieval (ENHANCEMENT)
  • PROBLEM: Order lines imported WITHOUT product information from Dolibarr
  • SOLUTION: Automatic retrieval of 11 product fields:
  • ESSENTIALS: pa_ht, accountancy_code_sell, accountancy_code_buy, product_type, fk_unit
  • TRACEABILITY: barcode, fk_barcode_type, ref_ext
  • LOGISTICS: weight, length, surface, volume (+ units)
  • IMPACT: Automatic margin calculation, accounting integration, complete traceability
📦 Statistics v2.1.3
  • Modified files: 3 (importproducts.class.php, shopifyordermanager.class.php, configurationMigrator.class.php)
  • Lines added: +125
  • Issues resolved: 4 (#151, #152, #153, #154)
  • Client impact: Philippe (Click and Play) + All clients (CRITICAL variant images)
🎯 User Impact
  • 100% images synchronized (simple AND variants) - CRITICAL BUG fixed
  • Clean logs without PHP warnings
  • Automatic publication to configured sales channels
  • Automatic margin calculation on all orders
  • Automatic accounting integration with correct codes
  • Complete traceability with barcodes and dimensions

🛡️ Version 2.1.2 (2025-10-19) - CRITICAL FIXES v2.1.0 REGRESSION

🐛 ISSUE #144 - Idempotent SQL Migrations (CRITICAL)
  • PROBLEM: Total loss of Dolibarr-Shopify mappings on module reactivation
  • CAUSE: Destructive SQL scripts (TRUNCATE, DROP) re-executed on every activation
  • CLIENT IMPACT: Complete manual resynchronization required
✅ Implemented Solution
  • MigrationManager: Intelligent migration tracking system (310+ lines class)
  • llx_shopify_migration_history table: Recording of already applied migrations
  • Idempotent SQL scripts: Rewrite of update_2.0.5_2.0.6.sql and update_2.0.22_2.0.23.sql
  • Atomic transactions: Commit/rollback with automatic retry
🐛 ISSUE #148 - v2.1.0 Regression: Inverted Conditions (CRITICAL)
  • BUGS: Prices, stocks and images synchronized DESPITE disabled options
  • CAUSE: Conditions empty() || == 1 ALWAYS true
  • FILE: class/importproducts.class.php (6 conditions fixed)
✅ Implemented Solution
  • Logic correction: !empty() && == 1 to respect configuration
  • Stock simplification: -125 lines of code, using getProductStock()
  • Complete audit: 8 options verified and confirmed correct
⚡ ISSUE #141 - Separated CRON Synchronization (MAJOR)
  • PROBLEM: Historical import blocks real-time sync for days
  • IMPACT: Recent orders not imported during historical import
✅ Implemented Solution
  • 2 independent CRONs: ShopifyOrderSyncCron (15min) + ShopifyHistoricalImportCron (30min)
  • Forced modes: 'normal' for real-time sync, 'historical' for historical import
  • Admin interface: Historical import activation/deactivation with auto-managed CRON
  • Parallelization: Both CRONs can run simultaneously
📊 ISSUE #147 - Consistent Synchronization Statistics
  • PROBLEM: Misleading stats (variants counted twice in "not synced" AND "already synced")
  • CONFUSION: Impossible to know what remains to synchronize
✅ Implemented Solution
  • Rewritten SQL query: 9 new precise counters (3 categories × 3 types)
  • Restructured display: Separate sections NOT synced / ALREADY synced / Failures
  • Zero double counting: Each product/variant counted only once
🔧 ISSUE #146 - Services in Product Purge
  • PROBLEM: Services (fk_product_type = 1) not searchable in purge
  • LIMITATION: Impossible to purge services from Shopify mapping
✅ Implemented Solution
  • Product type filter: Dropdown "Products / Services / All"
  • Visual badges: 📦 Product / 🔧 Service in results
  • AJAX backend: Support for product_type parameter in search
🐛 ISSUE #149 - Critical GraphQL Stock Bug (CRITICAL)
  • PROBLEM: 100% of stock synchronizations were failing silently
  • CAUSE: snake_case vs camelCase incompatibility between PHP and Shopify GraphQL API
  • IMPACT: Stocks never updated on Shopify despite sync enabled
✅ Implemented Solution
  • Automatic conversion: snake_case → camelCase in ShopifyApi::inventorySetQuantities()
  • Key mapping: inventory_item_id → inventoryItemId, location_id → locationId, available_adjustment → quantity
  • Modified file: class/shopifyapi.class.php lines 645-655
  • Tests: Complete validation with multiple products and variants
🛠️ ISSUE #150 - System Diagnostic Improvements
  • PROBLEM 1: False diagnostic errors with hardcoded 'llx_' prefix
  • PROBLEM 2: Support email not displayed in diagnostic
  • PROBLEM 3: Manual-only support validation
✅ Implemented Solutions
  • Dynamic SQL prefix: Using MAIN_DB_PREFIX instead of hardcoded 'llx_'
  • Email display: Added support email in "Support status" section
  • Auto-validation: Automatic triggering of validateSupportByEmail() if email configured
  • Modified file: admin/diagnostic.php lines 413-540
🔧 ISSUE #152 - Auto-Disable CRON Cleanup (MAJOR)
  • PROBLEM: Cleanup CRON never disabled historical import CRON despite completion
  • CAUSE: Architectural inconsistency - Cleanup used ConfigurationMigrator directly (array) instead of ShopifyApi (object)
  • IMPACT: Historical CRON remained active unnecessarily after completion
✅ Implemented Solution
  • Unified architecture: Cleanup CRON now uses ShopifyApi + getDolGlobalInt() like all other CRONs
  • Architecture consistency: 5 CRONs follow the same pattern
  • Modified files: 2 (shopifyhistoricalimportcleanupcron.class.php, configurationMigrator.class.php)
📊 Version Statistics
  • Created files: 3 (MigrationManager, ShopifyHistoricalImportCron, llx_shopify_migration_history.sql)
  • Modified files: 15 (classes, admin, ajax, SQL, translations)
  • Added lines: ~1350 lines
  • Translations: 173 keys (34 keys + 1 update × 5 languages)
  • Resolved issues: 8 (#144, #148, #141, #147, #146, #149, #150, #152)

🛡️ Version 2.1.1 (2025-10-08) - CRITICAL FIXES: CRON Stability + Image Protection

🐛 CRITICAL BUG #139 - Simple Product Image Protection
  • AFFECTED CLIENT: Cheer Moda - Images permanently deleted on simple products
  • PATTERN: Products WITHOUT variants → Images deleted even if sync disabled ❌
  • PATTERN: Products WITH variants → Worked correctly ✅
  • CAUSE: Shopify API deletion BEFORE complete mapping verification
✅ Implemented Solutions
  • DETAILED LOGS: Product type identification (SIMPLE vs WITH VARIANTS)
  • MAPPING VERIFICATION: Check BEFORE any destructive operation
  • IMAGE PRE-CHECK: Verify Dolibarr images available before deletion
  • ERROR HANDLING: Clean return without Exception after deletion
🔴 CRITICAL BUG #140 - Frozen CRON + Stuck Historical Import
  • AFFECTED CLIENT: Eau Exquise - No order synchronization for 10 days
  • SYMPTOM 1: CRON status "In progress or not executed" with empty output
  • SYMPTOM 2: Historical import stuck at 37.7% (1990/5278 orders)
  • SYMPTOM 3: 48+ SQL errors during v2.1.0 migration
  • SYMPTOM 4: 30s PHP timeout insufficient for historical import
✅ Implemented Corrections

1️⃣ Frozen CRON Auto-Detection

  • Mandatory startup log (entity + PHP timeout)
  • Automatic frozen CRON detection (processing=1 > 1h)
  • Automatic unfreeze with warning
  • Error code -1 if configuration incomplete

2️⃣ Historical Import Stuck Detection

  • Progress comparison between CRON executions
  • Automatic skip of problematic order after 3 attempts
  • Detailed logging of blocking order
  • STUCK_COUNTER for traceability

3️⃣ PHP Timeout Protection

  • Time limit increase to 300s (5 minutes) at startup
  • Timer in synchronization loop (max 120s)
  • Resume point save if timeout reached
  • Original time limit restoration at end

4️⃣ SQL Migration Errors Repair

  • New SQL script: sql/update_2.1.0_to_2.1.1.sql
  • Obsolete table removal llx_shopify_dolibarr_storedetails
  • Duplicate indexes cleanup on sync tables
  • Main tables integrity verification
🔴 CRITICAL BUG - Stock Not Updated (Client Philippe)
  • AFFECTED CLIENT: Philazerty - 100% of stocks not synchronized to Shopify
  • SYMPTOM: "Skipping inventory update - empty inventory_item_id"
  • CAUSE: Key naming inconsistency (camelCase vs snake_case) in $inventoryQuantities array
✅ Implemented Solution
  • HARMONIZATION: snake_case keys in array creation (inventory_item_id, location_id, available_adjustment)
  • RESULT: 100% of stocks now synchronized correctly
  • FILE: class/importproducts.class.php line 2566-2571
🟠 IMPORTANT BUG - Collections Outside Tree (Client Philippe)
  • AFFECTED CLIENT: Philazerty - Collections created for ALL product categories
  • PROBLEM: If product in category 359 AND "Video Games" (outside tree 359), both collections created
  • EXPECTED: Only collections for categories in configured tree (359)
✅ Implemented Solution
  • POST-RETRIEVAL FILTERING: Verify configured tree membership before collection creation
  • NEW FUNCTION: isCategoryInTree() climbs parent chain to find configured category
  • DETAILED LOGS: Indication of excluded categories (outside configured tree)
  • FILES: class/importproducts.class.php lines 5436-5456 + 6299-6358
🟠 IMPORTANT BUG - Services + Publications (Issue #141)
  • PROBLEM 1: Services (type=1) with tracked stock in Shopify while services should not have stock
  • PROBLEM 2: Products synchronized but not published to sales channels (Online Store, POS)
✅ Implemented Solutions
  • FIX SERVICES: tracked=false and requiresShipping=false for services (line 2357-2364)
  • NEW FUNCTION: publishProductToConfiguredChannels() for automatic publication (line 6225-6297)
  • CONFIG REUSE: Uses collections sales channels configuration (DOLI2SHOP_COLLECTIONS_SALES_CHANNELS)
  • GRACEFUL DEGRADATION: Works even without write_publications scope
🎯 Total Impact v2.1.1
  • Robust CRON: Automatic detection and unfreeze
  • Reliable Historical Import: Skip problematic orders
  • Image Protection: No deletion without replacement
  • Timeout Protection: No PHP blocking on large volumes
  • Complete Traceability: Detailed logs at each step
  • Clean Migration: Automatic v2.1.0 errors repair
  • Guaranteed Stocks: 100% stock synchronizations functional
  • Filtered Collections: Only configured tree categories
  • Correct Services: No stock or shipping for services
  • Visible Products: Automatic sales channels publication
📊 Implementation Statistics
  • Modified files: 6 PHP files + 1 SQL + ChangeLog
  • Added code lines: ~520 lines
  • Resolved issues: #139, #140, #141 + 2 client bugs
  • Fixed problems: 9 critical/major bugs total

Resolved GitHub Issues: #139 (Images), #140 (CRON), #141 (Services + Publications) + 2 Philippe client bugs (Stocks + Collections)

🚀 Version 2.1.0 (2025-09-30) - MAJOR EVOLUTION: MODERN UX + CRITICAL FIXES

🎨 Modern Interface with Native Toggles
  • UX REVOLUTION: Complete replacement of checkboxes with modern toggles
  • 19 TOGGLES: Implemented across 6 admin pages (setup, webhooks, import_orders, maintenance, support_config, orderstatusmapping)
  • DOLIBARR STYLE: Perfect visual consistency with native interface (green enabled / gray disabled)
  • SMOOTH ANIMATION: 0.3s transition with immediate visual feedback
  • 0 REGRESSION: JavaScript and business logic preserved
🐛 Critical Fix - SQL Extrafields + Marketing Consent
  • ISSUE: Order sync failure with invalid SQL error UPDATE llx_societe_extrafields SET WHERE
  • SOLUTION 1: SQL exception handling to catch empty extrafields errors
  • SOLUTION 2: Correct mapping to native Dolibarr method setNoEmail()
  • IMPACT: CRON Orders now works for all customers + GDPR compliance
🔴 Regression Fixes v2.0.33-35
  • BUG #127 CRITICAL: Images deleted despite sync disabled (Absolute protection added)
  • BUG #128 MAJOR: Stocks synced despite checkbox unchecked (Logic corrected)
  • IMPACTED CLIENTS: Cheer Moda and potentially all active clients
🔧 Urgent Client Issues Fixes
  • FIX CATEGORIES: Customer category assignment not working (getDolGlobalInt → getDolGlobalString)
  • FIX STOCKS: Advanced logging for Shopify stock sync (complete request/response)
  • FIX UX: Category dropdowns with empty selection by default
  • API UPGRADE: Shopify 2025-01 → 2025-07 (inventory bug fixes)
📅 Dual Date Historical Import System
  • NEW: Support for historical import with multiple dates
  • ROBUSTNESS: Advanced handling of long periods (2+ years)
  • PERFORMANCE: Optimized batch size based on volume
🎯 Total Client Impact v2.1.0
  • ✅ Professional and modern interface
  • ✅ 100% reliable order synchronization
  • ✅ Absolute protection against data loss
  • ✅ Strict respect of user configurations
  • ✅ GDPR marketing consent compatibility
  • ✅ Extended support for large volumes

GitHub issues resolved: #125, #126, #127, #128, #130

🚨 Version 2.0.35 (2025-09-22) - CRITICAL FIX + NEW FEATURES

🐛 Critical Issues Fixed
  • HISTORICAL IMPORT BLOCKING: Import remaining perpetually in historical mode
  • ARBITRARY LIMIT: 1000 orders restriction preventing import of 2+ years of history
  • MISSING ORDERS: Orders after configured end date never retrieved
  • ZERO VISIBILITY: No indication of actual progress
💡 Revolutionary Solution: Intelligent GraphQL Count
  • EXACT CALCULATION: New getOrdersCount() method via GraphQL
  • VISIBLE PROGRESS: Detailed logs "X / Y orders (Z%)"
  • PRECISE DETECTION: Triple verification for automatic import completion
  • PERFORMANCE: Adaptive batch size based on volume to process
🔧 Technical Improvements
  • DOLIBARR CONSTANTS: Progress storage with dolibarr_set_const()
  • ERROR RESILIENCE: Robust handling of timeouts and interruptions
  • ENRICHED LOGS: Detailed messages for diagnosis and monitoring
  • COMPATIBILITY: Works with 10 or 100000+ orders
📊 Client Impact
  • CRITICAL URGENCY: Immediate installation for clients with blocked import
  • TOTAL RECOVERY: All missing orders automatically imported
  • AUTO COMPLETION: Automatic switch to normal mode after complete import
  • PRIORITY SUPPORT: Enhanced assistance for this critical fix

🏷️ Automatic Shopify Customer Categorization

  • NEW: "Shopify Customer Category" configuration in Settings tab
  • NEW: Automatic assignment of Dolibarr category to customers created from Shopify
  • NEW: assignCustomerToCategory() method with duplicate management
  • ENHANCED: Complete translations in 5 languages (FR, EN, DE, ES, IT)
  • USAGE: Facilitates identification and management of Shopify customers in Dolibarr

🔧 Search Interface Fixes

  • FIX: Search field in Maintenance tab not working on Dolibarr 20
  • FIX: Problem with product search by numbers in Maintenance interface
  • ENHANCED: Unified behavior between Manual Sync and Maintenance tabs
  • ENHANCED: Search allowed even without configured product category

🚀 Product Title Management Improvements

  • FIX: "Title must be specified" error during sync with descriptions disabled
  • NEW: getProductTitle() method to retrieve titles from Shopify
  • ENHANCED: Smart logic preserving titles modified in Shopify
  • ENHANCED: Respect for bidirectional synchronization choices
🎯 Total Customer Impact v2.0.35
  • ✅ Functional historical import for all order volumes
  • ✅ Better customer organization with automatic categorization
  • ✅ Unified and functional search interface
  • ✅ Synchronization respecting Shopify modifications
  • ✅ Extended Dolibarr 18-22 compatibility

GitHub issues resolved: #123 (v2.0.35) and #124 (v3.0.0)

🔐 Version 2.0.34 (2025-09-20) - ADVANCED SUPPORT SYSTEM

🌐 NEW: Complete Website Restructuring (20/09/2025)
  • OPTIMIZED ORGANIZATION: Redesigned homepage architecture to clarify v2.0.34 vs v3.0.0 offering
  • MULTILINGUAL: Restructuring applied to all 5 languages (FR, EN, DE, ES, IT)
  • CUSTOMER JOURNEY: Problem/solution hero section with optimized purchase CTAs
  • TRANSPARENCY: Distinct sections "v2.0.34 NOW" and "v3.0.0 SOON"
  • WARNINGS: v2.0.34 limitations clearly displayed (not bidirectional, not real-time)
  • NAVIGATION: Links to changelog and roadmap added for better orientation
  • PRICING: Clarified pricing 250€ HT v2.0.34 vs 350-400€ HT v3.0.0
  • DOLISTORE TEXT: New corrected marketing text created
🔐 NEW: Revolutionary Support System
  • INNOVATION: Complete license management platform with intuitive web interface
  • SECURITY: Advanced validation system with domain usage tracking
  • FLEXIBILITY: Support for standard, lifetime and developer licenses
  • AUTOMATION: Automatic generation from CSV + manual creation
🚀 Main Features
  • Modern Web Interface: website/support_manager.php - Complete management dashboard
  • Robust API: website/api/validate_support.php - Real-time validation
  • Secure Configuration: Password externalization (no more hardcoding)
  • Smart Pagination: Optimized display for large databases
  • Domain Management: Automatic tracking + manual authorization
📊 Supported License Types
  • 🔵 Standard: 1 year, 1 production domain + dev/staging
  • 🟡 Lifetime (on request): Unlimited, 1 production domain + dev/staging
  • 🟢 Developer: Unlimited, dev/staging environments only
🛡️ Advanced Security System
  • Strict Validation: Only 1 license per production domain
  • Auto-Detection: Development environments automatically authorized
  • Complete Tracking: Access history with IP, User-Agent, frequency
  • Violations: Real-time detection and alerts for multiple usage
  • Authorized Domains: Manual management + automatic dev authorization
🎯 Extended Dolibarr Compatibility
  • COMPATIBILITY: Extended support to Dolibarr 18.0+ (previously 19+)
  • CLIENT REQUEST: F3DF request for Dolibarr 18.0.4 compatibility resolved
  • SOLUTION: Comprehensive compatibility layer for older Dolibarr versions
🛠️ Technical Implementation
  • NEW: lib/compatibility.lib.php - Centralized compatibility functions
  • POLYFILLS: getDolGlobalString(), getDolGlobalInt(), getDolGlobalFloat(), getDolGlobalBool()
  • AUTO DETECTION: Automatic detection and fallback system for Dolibarr < 16
  • OPTIMIZED: Performance optimized with function_exists() checks
  • DEBUG: Optional logging for compatibility function usage tracking
📋 Files Updated (16 total)
  • CORE: core/modules/modShopifyIntegration.class.php - Minimum version from 11.0 to 18.0
  • CLASSES: Updated all 11 class files with compatibility includes
  • ADMIN: Updated 2 admin files (setup.php, webhooks.php)
  • DOCS: Website documentation updated (5 languages) - Dolibarr 18-21 support
✅ Backward Compatibility Guaranteed
  • MAINTAINED: All existing functionality preserved
  • TESTED: Compatible with Dolibarr 18.0.4 through 22.0.1
  • OPTIMIZED: No performance impact on newer Dolibarr versions
  • FALLBACK: Graceful degradation for unsupported functions
📋 Enhanced Client Support
  • NEW: docs/support/EMAIL_BENJAMIN_DARMON_DOLIBARR18.md - Client response template
  • SUPPORT: 48h delivery timeline for compatibility fix
  • GUARANTEE: Full refund if technical issues on Dolibarr 18.0.4

🚨 Version 2.0.33 (2025-09-16) - CRITICAL IMAGE SYNCHRONIZATION FIX

🚨 Critical Fix: Synchronized Images
  • PROBLEM RESOLVED: Images not synchronized when "Product does not need update"
  • CAUSE IDENTIFIED: syncProduct() function returned false → images never processed
  • TECHNICAL SOLUTION: Modified class/importproducts.class.php:915 - return true for image processing
  • IMPACT: Images synchronized even if product data already up to date
✅ Immediate Benefits
  • Guaranteed synchronization: Images always processed if sync_product_images enabled
  • Full compatibility: Manual AND automatic sync fixed
  • Preserved workflow: No user behavior changes
  • Maintained performance: Images processed only if configured
🔐 Enhancement 2: Shopify Permissions Management for fileCreate
  • NEW SCOPES: Added `write_files`, `write_themes`, `write_images` to required permissions
  • CONDITIONAL LOGIC: Scopes become mandatory when collections or product images enabled
  • AUTOMATIC DIAGNOSTIC: Detection and display of missing file permissions
  • MULTILINGUAL: Complete translations in 5 languages for new permission labels
  • UI IMPROVEMENT: Optional missing rights now display in orange instead of red
  • RESULT: Resolves "Access denied for fileCreate" error when uploading collection/product images
  • LOCATION: class/shopifyapi.class.php:191-212 + class/shopifyrightsChecker.class.php:295
🧠 Preserved v2.0.32 Advantages
  • Advanced logic: 3 automatic modes (INVENTORY_ONLY, VARIANTS_ONLY, PRODUCT_UPDATE)
  • Critical fixes: Localhost API + "deleted" Collections maintained
  • Client resolutions: ALTAIRIS + PHILIPPE preserved

🧠 Version 2.0.32 (2025-09-15) - ADVANCED SYNC LOGIC & CRITICAL FIXES

🧠 NEW: Advanced Synchronization Logic System
  • Auto detection: 3 modes based on checked options (INVENTORY_ONLY, VARIANTS_ONLY, PRODUCT_UPDATE)
  • INVENTORY_ONLY: Stock only - preserves ALL existing Shopify content
  • VARIANTS_ONLY: Price/stock without modifying product content
  • PRODUCT_UPDATE: Selective sync respecting exact selections
🚨 Critical Production Fixes
  • Localhost fix: Resolved API 404 issues on NAT Hairpinning/loopback DNS servers
  • Collections fix: Fixed incorrect "deleted" marking bug on valid categories
  • ALTAIRIS: No more Shopify content overwriting - stock mode respects existing data
  • PHILIPPE: Localhost API functional + perfect collections sync

🚨 Version 2.0.31 (2025-09-11) - CRITICAL FIXES & API DIAGNOSTICS

🚨 Critical Production Fix
  • Issue #91 - CRITICAL: Fixed "ErrorCustomerCodeRequired" blocking order synchronization
  • ROOT CAUSE IDENTIFIED: Hard-coded `$soc->code_client = -1` incompatible with `mod_codeclient_leopard`
  • SOLUTION: Implemented adaptive client code generation based on Dolibarr model detection
  • NEW: `setClientCode()` method with intelligent model-specific strategies
  • Issue #92: Intelligent customer code generation system
🔍 NEW: Dolibarr API Diagnostics System
  • NEW: Integrated diagnostic for Dolibarr API endpoints in admin interface
  • TESTED ENDPOINTS: `/api/index.php/status`, `/documents`, `/documents/download`
  • CONTEXTUAL HELP: Specific solutions for each HTTP error (404, 403, 401, 405)
  • MULTILINGUAL: Full support for 5 languages (FR, EN, DE, ES, IT)
  • ENHANCED: Graceful handling of API documents 404 errors
  • JSON EXPORT: Complete API keys for technical support diagnosis
🛠️ Technical Implementation
  • ADAPTIVE LOGIC: Different strategies per model (leopard=direct, monkey/elephant=auto+fallback)
  • FALLBACK SYSTEM: Triple safety (auto → Shopify ID → timestamp) ensures 100% success
  • PERFECT TRACEABILITY: "SH" prefix clearly identifies Shopify customers
  • COMPREHENSIVE LOGGING: Model detection and code generation fully traced
🧪 Quality Assurance
  • UNIT TESTS: 5 scenarios cover all Dolibarr models and edge cases
  • DOCUMENTATION: Complete technical guide for troubleshooting and configuration
  • MODEL COVERAGE: leopard, monkey, elephant, empty, and custom models supported
🎯 Production Impact
  • Zero failures: ErrorCustomerCodeRequired completely eliminated
  • Universal compatibility: Works with any Dolibarr configuration
  • Enhanced support: Clear logs and traceable customer codes for debugging

🚨 Version 2.0.30 (2025-09-09) - CRITICAL ORDER SYNCHRONIZATION FIXES

🚨 Critical Production Fixes
  • Issue #86 - CRITICAL: Fixed "Failed to fetch company" crash in production environments
  • ROOT CAUSE: createOrUpdateCustomer() method returned mixed types (-1 or Societe object)
  • FIX: Added strict type validation before accessing customer properties
  • Issue #87: Comprehensive logging system for production debugging
  • Issue #88: Automatic CRON user permissions verification
  • Issue #90: Enhanced error handling in customer management
🔧 Code Improvements
  • Type Safety: Strict object and ID validation for all customer operations
  • Error Context: Enhanced error messages with email, entity, and operation details
  • Transaction Safety: Improved database transaction handling with proper rollback
  • Logging Standards: Standardized log levels (DEBUG, INFO, WARNING, ERR) across operations
🎯 Client Impact
  • IMMEDIATE: Resolves "Failed to fetch company" crashes in production
  • RELIABILITY: Enhanced error handling prevents synchronization interruptions
  • SUPPORT: Detailed logs facilitate faster problem resolution
  • MONITORING: CRON permissions verification prevents silent authorization failures
📊 Modified Files
  • class/shopifyordermanager.class.php: Enhanced customer management with strict validation
  • core/modules/modShopifyIntegration.class.php: Version bump to 2.0.30

🐛 Version 2.0.29 (2025-09-05) - CRITICAL MULTI-ENTITY FIXES

🚨 Critical Fixes
  • Issue #83 - CRITICAL: Fixed "Failed to fetch company" error in multi-entity Dolibarr environments
  • Issue #84: Dynamic version retrieval in diagnostic JSON export
✨ Improvements
  • Multi-Entity: Customer search now properly filtered by entity
  • Diagnostics: Version automatically retrieved from module
  • Logging: Enhanced error handling for company fetch() operations
🎯 Client Impact
  • ✅ Order synchronization restored for multi-entity users
  • ✅ Diagnostic export now displays correct version
  • ✅ Enhanced client support with accurate diagnostics

🐛 Version 2.0.28 (2025-09-04) - CRITICAL SYNCHRONIZATION FIXES

🚨 Critical Fixes
  • CRITICAL BUG #80: Orders becoming "paid" after creation not synchronized
  • SOLUTION: Use of updated_at_min instead of created_at_min
  • SECURITY WINDOW: Automatic addition of 24h window to catch missed orders
  • CRITICAL BUG #81: getDolGlobalBool() error on Dolibarr v19-20
  • POLYFILL: Automatic compatibility function for versions prior to v21
✨ Diagnostic Improvements
  • JSON EXPORT: Complete exportable diagnostic for technical support (47 checks + 39 parameters)
  • IMPROVED INTERFACE: CSS classes for Shopify connection status with visual colors
  • SECURE CONFIGURATION: Export with automatic masking of sensitive keys (API keys, tokens)
  • TIMING CORRECTION: JSON export after complete report construction
📝 Support Documentation
  • TECHNICAL EMAILS: Templates for client support with detailed explanations
  • SOLUTIONS: Bug and solution documentation for similar cases
🔄 Universal Compatibility
  • DOLIBARR v19: Full compatibility with polyfill
  • DOLIBARR v20: Full compatibility with polyfill
  • DOLIBARR v21+: Native function used

🎯 Critical version: Installation strongly recommended for all users, especially if you use Dolibarr v19-20 or encounter order synchronization issues.

🚀 Version 2.0.27 (2025-08-28) - CONFIGURATION MIGRATION TO DOLIBARR CONSTANTS

🏗️ Major Architectural Changes
  • ISSUE #73 CRITICAL: Complete migration from custom table to Dolibarr standard constants
  • MAJOR CHANGE: Configuration now stored in llx_const instead of llx_shopify_dolibarr_storedetails
  • NEW CLASS: ConfigurationMigrator for automatic migration and backward compatibility
  • AUTO MIGRATION: Automatic migration on first access with fallback to old table if needed
  • 42 PARAMETERS: All configuration parameters migrated to Dolibarr constants with proper naming
  • MULTI-ENTITY: Improved multi-entity support using Dolibarr standard mechanisms
🔧 Enhanced Diagnostics and Monitoring
  • MIGRATION COUNTER: Migration status display in rights checker (X/42 parameters)
  • VISUAL INDICATORS: Badges for complete/partial/non-migrated configuration
  • DETECTION: Old configuration table presence reporting for cleanup guidance
  • STATISTICS: getConfigurationStats() method for detailed monitoring
  • LOGGING: Comprehensive migration process and error logging
📊 Files Migrated to Constants System
  • admin/setup.php: All saves now use dolibarr_set_const()
  • admin/diagnostic.php: Configuration reading via ConfigurationMigrator
  • admin/sync_products.php: Configuration checks via constants
  • class/importcollections.class.php: loadConfiguration() modernized
  • class/collectionsconflictresolver.class.php: loadConfiguration() modernized
  • class/shopifyordermanager.class.php: Historical import dates via constants
  • lib/doli2shop.lib.php: Admin tabs via constants
🛡️ Backward Compatibility & Security
  • ZERO BREAKING CHANGES: Automatic fallback to old table if constants missing
  • SEAMLESS MIGRATION: No user intervention required
  • FAIL-SAFE: If migration fails, system continues using old table
  • AUTOMATIC: Migration runs on first access after update
  • REVERSIBLE: Old table preserved until manual cleanup
🐛 Critical Fixes (2025-08-29)
  • CRITICAL FIX: ConfigurationMigrator was falsely showing "30/42 parameters migrated"
  • CRITICAL FIX: Migration now properly handles `0` values (excluded by previous `!empty()` condition)
  • CRITICAL FIX: Added missing translations for UserRightsCheck interface (5 languages)
  • FIX: Product synchronization checkboxes now display correctly based on migrated constants
  • FIX: Migration statistics now accurately count only the 42 mapped parameters
  • FIX: Product synchronization options (prices, descriptions, images, stocks, attributes) properly migrated
🚀 Interface Improvements (2025-08-29)
  • NEW: Force migration button in diagnostic interface for incomplete migrations (< 42 parameters)
  • NEW: Automatic Shopify API connection test with rights verification on page load
  • NEW: Unified diagnostic interface combining all verification functionalities
  • NEW: Complete translations added for all new diagnostic features (14 keys × 5 languages = 70 translations)
  • ENHANCED: Diagnostic page now includes migration status, rights check, and API connectivity in single view
  • IMPROVED: forceMigration() method to re-migrate all parameters even if already present
  • IMPROVED: testShopifyConnection() method with GraphQL shop query and scope detection
  • REMOVED: Separate rights_check.php tab - functionality integrated into main diagnostic
🩺 User Rights Diagnostic System (2025-08-31)
  • ISSUE #74 NEW: Complete user rights verification system for support acceleration
  • NEW CLASS: ShopifyRightsChecker for comprehensive permissions analysis
  • REAL-TIME VERIFICATION: Checks 15+ required Dolibarr rights (products, orders, invoices, stocks, admin)
  • CRITICAL/OPTIONAL DISTINCTION: Missing critical rights = red, missing optional = orange
  • VISUAL INDICATORS: Automatic color coding (green/orange/red)
  • IMPACT ANALYSIS: Detailed impact for each missing right with corrective guidance
  • MULTILINGUAL SUPPORT: Compatibility via data-* attributes (FR/EN/DE/ES/IT)
  • UNIFIED INTEGRATION: All checks in single admin/diagnostic.php page
🔧 Major Diagnostic Interface Improvements (2025-08-31)
  • CRITICAL FIX: HTML structure corrected - "Configuration Status" section properly closed
  • CRITICAL FIX: JavaScript detection via data-* attributes instead of language-dependent text
  • CRITICAL FIX: User rights calculation using correct data structure (status['current'] vs status['status'])
  • NEW: Collapsible sections with automatic expand/collapse based on status
  • NEW: Visual color coding with CSS classes (has-success, has-warning, has-error)
  • NEW: Complete consistency between displayed values and JavaScript calculations
  • ENHANCED: Auto-collapse success sections, auto-expand warnings/errors
  • IMPROVED: Shopify connection test with detailed scopes analysis (required vs optional)
🎯 Benefits: Performance (native Dolibarr caching), Standards (convention compliance), Multi-entity (improved support), Maintenance (no more custom table), Debugging (Dolibarr tools integration), Future-proof (prepared for future versions)

🔧 Version 2.0.26 (2025-08-26) - COMPLETE COLLECTIONS PATCH

🚨 Critical Session Fixes
  • DIAGNOSTIC CONSTRUCTOR: Fixed missing $langs parameter causing PHP Fatal error
  • HTML DISPLAY: Fixed HTML buttons showing as raw text in diagnostic interface
  • JSON EXPORT: Fixed JSON export displaying in browser instead of downloading
  • CRON ACTIVATION: Fixed CRON activation using proper Dolibarr API instead of SQL
  • CONFIGURATION DISPLAY: Fixed "non défini" values by reading complete configuration
  • PARENT CATEGORY EXCLUSION: Organizational anchor category no longer syncs to Shopify
  • PACKAGE GENERATION: Fixed dist folder cleanup forcing complete regeneration
🆕 Enhanced Diagnostic System
  • SYSTEM INFORMATION: Complete environment analysis (Dolibarr, PHP, database versions)
  • ADVANCED STATISTICS: Products, orders, collections with parent exclusion tracking
  • ONE-CLICK FIXES: CRON activation, duplicate cleanup, configuration validation
  • SUPPORT EXPORT: JSON diagnostic export for technical support
  • COLLECTIONS RESTORED: Issue #70 - Full collections synchronization functionality
  • BIDIRECTIONAL SYNC: 3 configurable directions with intelligent conflict resolution
  • PARENT EXCLUSION: Organizational category serves only as anchor, not synced
  • MAPPING INTERFACE: Administrative interface for collection-category management
🏗️ Technical Architecture
  • CLASS: ShopifyDiagnostic enhanced with complete system analysis
  • CLASS: CollectionsUtils - Mapping management with CRUD operations
  • CLASS: ImportCollections - Shopify to Dolibarr import system
  • CLASS: CollectionsConflictResolver - Intelligent conflict resolution
  • ENHANCED: ImportProducts with parent category exclusion logic
  • ENHANCED: ShopifyApi with 4 GraphQL methods for collections
📊 Professional Tools
  • TABLE: llx_shopify_collections_mapping for complete traceability
  • DIAGNOSTIC: Professional system information display
  • STATISTICS: Real-time sync metrics with parent category exclusion
  • TROUBLESHOOTING: One-click solutions for common issues
  • MULTILINGUAL: Complete translations in 5 languages for all features
  • EXPORT: JSON diagnostic download for technical support
📈 Impact
  • FIXES: Critical diagnostic system errors preventing support
  • ENABLES: Professional diagnostic and troubleshooting capabilities
  • IMPROVES: Collection synchronization with parent exclusion logic
  • PROVIDES: Complete system information for better support

🚨 Version 2.0.25 (2025-08-04) - CRITICAL HOTFIX

🔧 Critical Fixes
  • CRITICAL BUG: Fixed first synchronization failing to retrieve recent orders when no previous sync exists
  • ROOT CAUSE: When MAX(tms) returns NULL (empty table), no date filter was applied to GraphQL query, causing Shopify to return oldest orders instead of recent ones
  • SOLUTION: Implemented intelligent fallback using module installation date when no previous sync exists
  • NEW METHOD: SqlUtils::getModuleInstallationDate() with hierarchical fallback logic:
    • Priority 1: Module activation date from llx_const table
    • Priority 2: Table creation date from information_schema
    • Priority 3: First configuration date from store details
    • Priority 4: Default fallback (6 months ago)
  • ENHANCED: ShopifyOrderManager::getLastSuccessfulSync() now guarantees valid reference date for all synchronizations
📈 Impact
  • FIXES: Clients on v2.0.23/2.0.24 experiencing "no orders synced" on fresh installations
  • ENSURES: First synchronization correctly retrieves recent orders since module installation
  • MAINTAINS: Full backward compatibility with existing synchronizations

🚀 Version 2.0.24 (2025-01-08) - HISTORICAL IMPORT AND AUTO-ACTIVATION

🆕 New Features
  • Issue #60: Historical order import functionality integrated into CRON system
  • Issue #60: Automatic CRON activation when product and order configurations are complete
  • NEW: Intelligent CRON management with configuration completeness checks
  • NEW: Historical order import via ShopifyOrderSyncCron with automatic customer creation
  • NEW: Auto-deactivation of CRONs when configuration is incomplete to prevent API errors
🔧 Critical Fixes
  • Issue #61: Fixed manual synchronization search displaying products but unable to sync them (S001 case)
  • Issue #62: Fixed services being synchronized as physical products instead of services
  • CRITICAL: Fixed parameter handling inconsistency between search and sync interfaces
  • CRITICAL: Fixed service type detection - services now correctly set requiresShipping: false in Shopify
⚡ Improvements
  • ENHANCED: Unified parameter handling using GETPOST('search_ref', 'aZ09') to preserve leading zeros in SKUs
  • ENHANCED: Proper service vs product differentiation in Shopify sync (fk_product_type detection)
  • ENHANCED: CRON tasks disabled by default on installation to prevent premature API calls
  • ENHANCED: Configuration validation before CRON execution in both ImportProductsCron and ShopifyOrderSyncCron
  • SIMPLIFIED: Removed separate import_orders interface - functionality integrated into CRON system
  • MULTILINGUAL: Added translations for new features in 5 languages (FR/EN/DE/ES/IT)
🏗️ Technical Improvements
  • ARCHITECTURE: Integrated historical order import into existing CRON workflow
  • RELIABILITY: Added configuration completeness checks before CRON execution
  • USABILITY: Automatic CRON activation feedback messages to users
  • MAINTENANCE: Removed redundant import_orders.php interface file

🚨 Version 2.0.23 - Session 16 (2025-05-31) - CRITICAL VARIANTS PENDING STATUS FIX

🐛 Critical Fixes
  • CRITICAL: Fixed variants remaining in 'pending' status by implementing cascade status updates from parent products
  • CRITICAL: Added automatic variant status synchronization using fk_product_parent relationship
  • CRITICAL: When parent product status changes, all variants now automatically inherit the same status
  • CRITICAL: Resolved inconsistent variant behavior where variants stayed pending while parents succeeded
✨ Enhancements
  • IMPROVED: Variants now follow parent product status automatically (success, failed, skipped, pending)
  • IMPROVED: Added updateVariantsStatusFromParent() function for cascade status management
  • IMPROVED: TMS timestamp logic applied consistently to both parent and variant products
  • IMPROVED: Enhanced logging for variant cascade operations
🏗️ Technical Architecture
  • ARCHITECTURE: Leverages fk_product_parent relationship for automatic variant status management
  • ARCHITECTURE: Single parent status change triggers automatic update of all child variants
  • PERFORMANCE: Eliminates need to individually process each variant status
  • PERFORMANCE: Reduced database operations through cascade updates
🔄 Workflow
  • BEHAVIOR: Parent product sync success → All variants automatically marked as success
  • BEHAVIOR: Parent product sync failure → All variants automatically marked as failed
  • BEHAVIOR: Parent product skipped → All variants automatically marked as skipped
  • CONSISTENCY: Unified status management ensures parent and variants always have consistent states

🏗️ Version 2.0.23 - Session 15 (2025-05-31) - SYNCHRONIZATION TABLE MANAGEMENT UNIFICATION

🔧 Critical Refactoring
  • CRITICAL: Unified table management functions for llx_dolibarr_shopify_products_save table
  • CRITICAL: Created single manageProductMapping() function replacing three separate functions (releaseSyncLock, saveProductMapping, updateProductTimestamp)
  • CRITICAL: Fixed TMS timestamp logic - now only updates on 'success' status as requested
  • CRITICAL: Resolved inconsistent behavior between manual and automatic synchronization modes
✨ Enhancements
  • IMPROVED: Single consistent logic for all table operations eliminates behavioral differences
  • IMPROVED: Proper TMS initialization for new records - uses table default (CURRENT_TIMESTAMP) unless status is 'success'
  • IMPROVED: Enhanced error handling and logging in unified function
  • IMPROVED: Better code maintainability with reduced duplication and unified approach
🏗️ Technical Architecture
  • ARCHITECTURE: manageProductMapping() handles creation, updates, status management, and TMS logic
  • ARCHITECTURE: releaseSyncLock() now uses unified function with releaseLock=true parameter
  • ARCHITECTURE: saveProductMapping() now uses unified function with 'pending' status
  • ARCHITECTURE: updateProductTimestamp() now uses unified function with 'success' status
  • PERFORMANCE: Optimized database operations with smart UPDATE/INSERT logic
🐛 Fixes
  • CRITICAL: Fixed potential NULL TMS issues during record creation
  • CRITICAL: Eliminated inconsistent table management causing sync behavior differences
  • CRITICAL: Corrected TMS update logic to only trigger on successful synchronizations

🚨 Version 2.0.23 - Session 14 (2025-05-31) - SIMPLE PRODUCTS STATUS FIX

🐛 Critical fixes
  • CRITICAL: Fixed simple products remaining in 'pending' status after successful synchronization
  • CRITICAL: Corrected early exit logic in checkProductNeedsUpdate() to mark status as 'skipped' when products don't need updates but sync was successful
  • CRITICAL: Resolved issue where products like "PullColMontantTorsade202004" stayed in pending status indefinitely
🆕 New features
  • NEW: Added 'skipped' status to last_sync_status enum for products that don't need updates
  • NEW: Enhanced status distinction: 'success' (updated), 'skipped' (no update needed), 'failed' (error), 'pending' (in progress)
✨ Improvements
  • IMPROVED: Enhanced sync status management - products that don't need updates are now correctly marked as 'skipped' instead of preserving 'pending'
  • IMPROVED: Better distinction between products that failed sync vs products that were successfully processed but didn't need changes
  • IMPROVED: Database schema updated to support 'skipped' status in enum

🚨 Version 2.0.23 - Session 13 (2025-05-31) - CRITICAL FK_PRODUCT_PARENT FIX

🐛 Critical fixes
  • CRITICAL: Fixed fk_product_parent NULL issue during manual variant synchronization
  • CRITICAL: Corrected saveProductMapping() calls for variants to include parent product ID
  • CRITICAL: Resolved variants being created with fk_product_parent=NULL instead of correct parent ID
  • CRITICAL: Enhanced mapVariantsToShopify() method to properly handle parent-variant relationships
🔧 Technical improvements
  • NEW: Reorganized table columns for better readability and logical grouping
  • IMPROVED: Column organization in groups: Dolibarr, Shopify, Synchronization, Timestamps
  • IMPROVED: Unified migration script with automatic column reorganization

🏗️ Version 2.0.23 - Session 12 (2025-05-31) - ISSUE #56 PARENT-VARIANT ARCHITECTURE

🚀 New features
  • ISSUE #56: Added fk_product_parent column for better parent-variant relationships
  • NEW: Enhanced database schema with parent-variant relationship tracking
  • NEW: Foreign key constraints for data integrity between parent and variant products
  • NEW: Automatic data migration to populate existing parent-variant relationships
✨ Improvements
  • IMPROVED: saveProductMapping() method now supports fk_product_parent parameter for variants
  • IMPROVED: releaseSyncLock() method updated to work with new parent-variant architecture
  • IMPROVED: Database queries optimized to distinguish between parent products and variants
  • IMPROVED: SQL table creation script updated with new column and constraints
🔧 Technical
  • DATABASE: Added fk_product_parent column to llx_dolibarr_shopify_products_save table
  • DATABASE: Added idx_fk_product_parent index for performance optimization
  • DATABASE: Added fk_dolibarr_shopify_products_parent foreign key constraint
  • MIGRATION: Smart data population to identify and link existing variants to their parents
  • COMPATIBILITY: Full backward compatibility maintained with existing installations
🏛️ Architecture
  • DESIGN: Clear distinction between simple products (fk_product_parent IS NULL), parent products (fk_product_parent IS NULL), and variant products (fk_product_parent IS NOT NULL)
  • PERFORMANCE: Optimized WHERE clauses using fk_product_parent for targeted parent/variant operations
  • INTEGRITY: Cascade deletion ensures clean removal of variants when parent products are deleted

🚨 Version 2.0.23 - Session 11 (2025-05-30) - SYNC STATUS OVERWRITE FIX

🐛 Critical fixes
  • CRITICAL: Fixed sync status overwrite issue where 'success' was incorrectly replaced by 'skipped'
  • CRITICAL: Corrected releaseSyncLock() to preserve existing status when products don't need updates
  • Fixed database fields last_sync_status and last_sync_error not being maintained correctly
  • Enhanced releaseSyncLock() method to conditionally update status instead of systematic overwrite
✨ Enhancements
  • NEW: Intelligent status preservation in releaseSyncLock() - only updates when explicitly needed
  • NEW: Enhanced logging to trace status preservation vs updates
  • Better database field consistency for synchronization tracking
  • Improved cron execution status management

🚨 Version 2.0.23 - Session 10 (2025-05-30) - FINDPRODUCTBYSKU REGRESSION FIX

🐛 Critical regression fixes
  • CRITICAL REGRESSION: Fixed findProductBySku() not finding existing products due to GraphQL syntax changes
  • ROOT CAUSE: Added quotes in GraphQL queries broke Shopify search API (sku:"DEVIDOIR_6" vs sku:DEVIDOIR_6)
  • SOLUTION: Reverted to simple GraphQL syntax from v2.0.21 that was proven to work
  • ARCHITECTURAL FIX: Shopify parent products don't have SKU - only variants do, corrected search logic accordingly
  • Fixed parent product search strategy to prioritize variant-based lookup over unreliable title search
  • Enhanced parent/variant detection logic with isProductVariant() method
✨ Enhancements
  • NEW: Intelligent parent vs variant search strategies (P1-P4 for parents, V1-V3 for variants)
  • NEW: Enhanced variant-based parent product discovery with multiple SKU patterns
  • NEW: Comprehensive diagnostic search for troubleshooting missing products
  • NEW: Smart product type detection to avoid searching parents by SKU (which don't exist in Shopify)
  • Better error reporting and detailed logging for search strategy debugging
  • Restored reliable product discovery that worked in v2.0.21

🚨 Version 2.0.23 - Session 9 (2025-05-30) - VARIANT STATUS FIXES

🐛 Critical fixes
  • CRITICAL: Added missing releaseSyncLock() calls for variants to prevent permanent pending status
  • CRITICAL: Fixed variant sync status management with proper success/failed handling
  • Fixed statistics interface not counting variant sync results correctly
  • Enhanced error handling in variant mapping with detailed logging
✨ Enhancements
  • NEW: Complete sync status lifecycle for both parent products and variants
  • NEW: Robust variant mapping with success/failure status tracking
  • Better error reporting for variant synchronization issues
  • Improved logging for variant sync status workflow

🚨 Version 2.0.23 - Session 8 (2025-05-30) - TEMP_LOCK SKU SEARCH RESTORATION

🐛 Critical fixes
  • CRITICAL: Restored SKU search logic for products with TEMP_LOCK IDs to prevent duplicate creation
  • CRITICAL: Updated SQL creation schema with missing v2.0.23 columns and constraints
  • Fixed product detection logic to systematically search by SKU when no valid mapping exists
  • Enhanced findProductBySku() calls even with temporary lock records
✨ Enhancements
  • NEW: Comprehensive product existence detection combining mapping and SKU search
  • NEW: Updated table creation script with entity, sync_lock, last_sync_status columns
  • Better duplicate prevention through systematic SKU verification
  • Improved logging for product detection workflow

🔄 Version 2.0.23 - Session 7 (2025-05-30) - RETRY AND STATISTICS FIXES

🐛 Critical fixes
  • CRITICAL: Fixed TEMP_LOCK IDs incorrectly treated as Shopify updates causing retry failures
  • CRITICAL: Harmonized sync status between 'failed' and 'error' for consistent statistics display
  • Fixed statistics interface not counting sync failures due to status inconsistency
  • Improved product mapping logic to filter temporary lock IDs
✨ Enhancements
  • NEW: Intelligent filtering of temporary lock IDs to avoid invalid Shopify API calls
  • NEW: Harmonized sync status terminology throughout codebase and interface
  • Improved error reporting accuracy in admin dashboard
  • Better distinction between new products and actual updates

🚨 Version 2.0.23 - Session 6 (2025-05-30) - SYNC FIXES

🐛 Critical fixes
  • CRITICAL: Fixed sync lock mechanism to prevent database NOT NULL constraint violations
  • CRITICAL: Fixed concurrent synchronization protection with temporary lock IDs
  • CRITICAL: Fixed imprecise UPDATE query affecting multiple variant records
  • Fixed synchronization failure for new products due to empty Shopify IDs in lock creation
  • Enhanced updateProductTimestamp() precision by adding shopifyVariantId to WHERE clause
✨ Enhancements
  • NEW: Intelligent temporary lock system using unique TEMP_LOCK_[timestamp]_[productId] format
  • NEW: Improved concurrent sync protection for both manual and cron synchronization
  • NEW: Enhanced variant mapping precision to prevent cross-contamination between variants
  • Better error handling and logging for sync lock operations
  • Comprehensive analysis and fix of product-variant relationship handling

🚨 Version 2.0.23 - Session 5 (2025-05-30) - CRITICAL FIXES

🐛 Critical fixes
  • CRITICAL: Fixed manual synchronization not working - missing isManualSync=true parameter
  • CRITICAL: Fixed setSyncLock() creating empty string IDs instead of NULL values in database
  • Bug: Fixed "No products to synchronize" message blocking manual synchronization
  • Bug: Removed database pollution with invalid Shopify IDs
⚡ New features
  • NEW: Sync failure tracking with last_sync_status and last_sync_error fields
  • NEW: Failure statistics display in admin interface with visual alerts
  • NEW: Enhanced sync lock management with status tracking ('success', 'error', 'skipped', 'pending')
  • Enhancement: Database schema with automatic cleanup of invalid records
  • Enhancement: Comprehensive error messaging for failed synchronizations

🔧 Version 2.0.23 - Session 4 (2025-05-30) - CODE OPTIMIZATION

⚡ Major Improvements
  • Code factorization: Created getProductVariants() method to eliminate code duplication between importProducts() and importProductsManual()
  • Transaction handling: Added complete transactional management with begin...commit/rollback in importProductsManual()
  • Maintainability: Unified variant processing logic between automatic and manual synchronization
  • Improved logs: Added detailed logs for transaction tracking and error monitoring
🔧 Critical Fixes
  • Undefined variable: Fixed critical bug where $product was undefined in importProductsManual()
  • Synchronization counter: Fixed missing logic for incrementing $numSynced
  • Error handling: Improved error handling with automatic rollback
Technical Impact: This update significantly improves robustness and maintainability of synchronization code, with a reduction of more than 30 lines of duplicated code.

✅ Version 2.0.23 - Session 3 (2025-05-27) - FINALIZATION

🔧 Final Fixes
  • Numeric SKUs: Fixed search for purely numeric SKUs (e.g., 00667) in manual interface (Issue #51)
  • Unwanted synchronization: Fixed synchronization of products without tags/categories (Issue #52)
  • Fixed GETPOST('term', 'alphanohtml') corrupting numeric SKUs in ajax/search_products.php
  • Added specialized search logic for numeric SKUs with multiple approaches
  • Implemented mandatory category filtering in synchronization
🆕 Major New Feature
  • Category preview interface: Complete preview before manual synchronization (Issue #50)
  • Complete category analysis system and synchronization preview
  • Enhanced interface with category details, progress bars and summary statistics
  • Real-time analysis via AJAX endpoint ajax/preview_sync.php
  • Full support for French translations for preview functionality

Version 2.0.23 - May 2025

🔧 Refactoring
  • Code cleanup: Removed obsolete synchronization methods after unification
  • Removed deprecated synchronizeProductsToShopify() method (239 lines)
  • Removed unused syncProductWithVariants() and syncProductAsVariant() methods
  • Removed redundant getShopifyProductId() helper method
  • Streamlined codebase by eliminating duplicate synchronization logic
  • Unified all synchronization to use proven importProductsManual() method
🐛 Corrections critiques
  • CRITIQUE: Correction de la duplication infinie des produits et variants lors de la synchronisation (Issue #42)
  • Correction du double nettoyage des IDs dans la méthode updateProductTimestamp() causant l'échec de recherche dans la table de mapping
  • Suppression des transactions imbriquées dans updateProductTimestamp() empêchant la mise à jour correcte des enregistrements
  • Correction de la cohérence du format des IDs entre les IDs Shopify et le stockage en base de données
  • Amélioration des logs de débogage pour les opérations de mapping et mise à jour des timestamps
  • Résolution de la régression introduite dans la v2.0.22 lors du merge des commits v2.0.21
💡 Améliorations techniques
  • Refactorisation de updateProductTimestamp() pour utiliser la transaction parent au lieu de transactions imbriquées
  • Standardisation de la gestion du format des IDs Shopify dans toutes les méthodes de synchronisation
  • Ajout de logs détaillés pour déboguer les échecs de recherche dans la table de mapping
  • Amélioration de la gestion d'erreur pour la création de mapping quand les enregistrements sont manquants

Version 2.0.22 - Mai 2025

✨ Nouvelles fonctionnalités
  • Interface de synchronisation manuelle des produits dans l'administration (Issue #40)
  • Recherche en temps réel de produits Dolibarr avec autocomplétion
  • Synchronisation individuelle ou par lot directement depuis l'interface
  • Feedback visuel immédiat du statut de synchronisation
  • Support multilingue complet (FR, EN, DE, ES, IT)
🐛 Corrections de bugs
  • CRITIQUE: Correction des erreurs d'arrondi des prix (.95€ devenant .96€) affectant 13 références produits (Issue #38)
  • Les prix privilégient maintenant les prix TTC stockés au lieu de recalculer HT + TVA
  • CRITIQUE: Correction de la duplication des produits lors des synchronisations (Issue #37)
  • Mécanisme de verrou temporel (5 minutes) pour empêcher les synchronisations concurrentes
  • Protection par session pour éviter les doublons dans une même requête
  • Libération automatique des verrous même en cas d'erreur
💡 Améliorations techniques
  • Standardisation des en-têtes PHP et déclarations de licence dans tout le projet
  • Amélioration de la détection des modes d'exécution (CLI/web) pour les crons
  • Nouvelle option de configuration pour la priorité des prix TTC en mode multi-prix
  • Amélioration des logs de calcul de prix pour un meilleur débogage
  • Optimisation de l'organisation des requêtes SQL
  • Guide de configuration: Amélioration de la hiérarchie visuelle des options du chapitre 6
  • Sections hiérarchiques avec icônes : Configuration Prix, Contenu, Stocks
  • Indentation visuelle pour les options dépendantes avec indicateurs conditionnels
  • Interface plus claire avec en-têtes colorés et mise en page structurée
  • Filtrage des catégories: Correction pour utiliser uniquement la catégorie configurée et ses enfants
  • Récupération corrigée de la configuration des catégories depuis la base de données
  • Calcul amélioré des statistiques produits pour les catégories configurées uniquement
  • Interface de synchronisation manuelle avec structure hiérarchique des catégories basée sur la configuration
  • Mode debug: Ajout mode debug complet (?debug=1) pour diagnostiquer les problèmes de filtrage
  • Correction SQL critique: Correction des références de colonnes dans l'interface de synchronisation manuelle
  • - Changement de `p.fk_product_parent` vers `p.fk_parent` pour le filtrage des produits parents
  • - Changement de `dsp.dolibarr_product_id` vers `dsp.fk_product` pour les jointures de la table de synchronisation
  • Amélioration variants: Ajout support des produits parents de variants dans l'interface de synchronisation
  • - Inclusion des produits sans variants (fk_parent IS NULL OR fk_parent = 0)
  • - Inclusion des produits parents de variants (sous-requête EXISTS p2.fk_parent = p.rowid)
  • Simplification des requêtes SQL pour de meilleures performances et fiabilité
  • Validation du schéma de base de données et logs détaillés des requêtes SQL pour le dépannage
  • Correction des statistiques retournant 0 produit par correction des requêtes complexes

Version 2.0.21 - Mai 2025

🐛 Corrections de bugs
  • Correction de la logique de synchronisation des images qui se lançait même quand désactivée
  • Correction de la logique empty() vs isset() pour le paramètre sync_product_images
  • Suppression des vérifications redondantes de configuration dans syncProductAllImages()
  • La synchronisation d'images respecte maintenant correctement le paramètre "sync_product_images" (0=désactivé, 1=activé)
💡 Améliorations techniques
  • Simplification de la logique de synchronisation d'images en supprimant les vérifications de configuration dupliquées
  • Amélioration de la validation des paramètres pour la configuration de synchronisation d'images
  • Amélioration de la maintenabilité du code en centralisant les vérifications de synchronisation

Version 2.0.20 - Mai 2025

🐛 Corrections de bugs
  • Correction du problème de stocks négatifs lors de la synchronisation avec Shopify
  • Amélioration de la gestion des caractères spéciaux dans les noms de fichiers d'images
  • Correction de la recherche de produits dans la fonction de purge pour les produits dans les catégories et sous-catégories
  • Ajout du dossier ajax dans la configuration de construction du module
  • Correction des erreurs PHP fatales dans le script de recherche AJAX
  • Correction de la vérification du token CSRF dans search_products.php
  • Implémentation correcte du système de logs dans les endpoints AJAX
  • Amélioration de la gestion et des logs des stocks dans importproducts.class.php
  • Correction du problème de synchronisation des stocks quand la propriété stock est vide
💡 Améliorations techniques
  • Ajout d'un mécanisme de fallback pour les erreurs 404 avec encodage alternatif
  • Amélioration des logs pour faciliter le débogage des problèmes d'images
  • Restructuration de la recherche AJAX de produits en classe OOP avec LoggerTrait
  • Amélioration de l'interface utilisateur pour la recherche avec indicateur de chargement et messages d'erreur
  • Meilleure gestion des erreurs dans la recherche de produits
  • Ajout d'un mécanisme de fallback pour la récupération des sous-catégories (get_all_ways/get_all_childs)
  • Standardisation des logs dans l'ensemble du module avec LoggerTrait
  • Ajout du chargement préventif du stock avant calcul dans la mise à jour des inventaires de variantes
  • Amélioration des logs de stock avec une différenciation claire entre les types de stock

Version 2.0.19 - Mai 2025

🐛 Corrections de bugs
  • Correction complète pour sauvegarder le champ "dolibarr_hosturl" dans les paramètres du module
  • Résolution des erreurs SQL dans la gestion de la correspondance des méthodes d'expédition
💡 Améliorations techniques
  • Mise en place d'un système LoggerTrait centralisé pour tous les messages de log du module
  • Amélioration du format des logs avec ajout automatique du nom de la classe et de la méthode
  • Amélioration du debugging de configuration avec masquage sécurisé des tokens

Version 2.0.18 - Mai 2025

🐛 Corrections de bugs
  • Corrigé l'erreur "Unable to parse URI: https:///" dans le contexte des crons
  • Amélioration du chargement de configuration dans les contextes cron
  • Gestion robuste de l'entity avec fallback automatique à l'entity 1
💡 Améliorations techniques
  • Centralisation de la gestion de configuration dans ShopifyApi
  • Amélioration du logging pour le débogage des contextes cron
  • Refactorisation de toutes les classes pour utiliser la configuration centralisée
  • Les crons passent maintenant explicitement l'entity aux classes métier

Version 2.0.17 - Mai 2025

✨ Nouvelles fonctionnalités
  • Options de synchronisation des produits configurables dans l'interface d'administration
  • Support complet des niveaux de prix multiples de Dolibarr avec sélection configurable
  • Déplacement de l'option stock virtuel vers l'onglet produits pour une meilleure organisation
  • Activation/désactivation automatique des options dépendantes dans l'interface
  • Nouveau système de purge de la table de synchronisation avec réinitialisation auto_increment
🐛 Corrections de bugs
  • Correction de la synchronisation des variantes de produits (utilisation correcte de Product::id)
  • Résolution des problèmes de synchronisation lorsque le prix est zéro ou null
  • Amélioration de la gestion des erreurs pour le téléchargement d'images
  • Résolution des problèmes de validation des variantes avec métachamps Shopify
  • Support amélioré des métachamps spécifiques comme 'shopify.color-pattern'
💡 Améliorations
  • Interface utilisateur plus intuitive avec options contextuelles
  • Journalisation détaillée des niveaux de prix multiples
  • Système de validation extensible pour les options et métachamps
  • Guide de configuration mis à jour avec toutes les nouvelles fonctionnalités

Version 2.0.16 - Novembre 2024

✨ Nouvelles fonctionnalités
  • Support du stock virtuel pour la synchronisation des stocks
  • Intégration des pourboires Shopify dans les commandes
  • Amélioration de la gestion des remises sur les commandes
🐛 Corrections de bugs
  • Correction du calcul des prix TTC à partir des prix HT
  • Amélioration de la gestion des erreurs SQL
  • Résolution des problèmes de synchronisation multi-entités

Version 2.0.15 - Octobre 2024

✨ Nouvelles fonctionnalités
  • Gestion des variantes marquées "Hors ventes"
  • Import sélectif par référence de produit
  • Option pour garder les titres et descriptions existants
🐛 Corrections de bugs
  • Correction de la gestion des erreurs de connexion API
  • Amélioration de la stabilité du cron
Return to main page