Implement version 0.0.10 features

- Add license meta box on WooCommerce order edit pages
- Add editable order domain field with AJAX inline editing
- Add editable license domains directly from order page
- Add licenses table showing all licenses for an order
- Support both classic orders and HPOS

New files:
- src/Admin/OrderLicenseController.php
- assets/js/order-licenses.js

New method: LicenseManager::getLicensesByOrder()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 22:18:27 +01:00
parent c4b1df8a22
commit f22ae95d6e
7 changed files with 710 additions and 5 deletions

View File

@@ -161,6 +161,25 @@ class LicenseManager
return $row ? License::fromArray($row) : null;
}
/**
* Get all licenses for an order
*/
public function getLicensesByOrder(int $orderId): array
{
global $wpdb;
$tableName = Installer::getLicensesTable();
$rows = $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM {$tableName} WHERE order_id = %d ORDER BY created_at DESC",
$orderId
),
ARRAY_A
);
return array_map(fn(array $row) => License::fromArray($row), $rows ?: []);
}
/**
* Get all licenses for a customer
*/