You've already forked wc-licensed-product
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user