You've already forked wc-licensed-product
Fix license generation and checkout domain field bugs
- Add WooCommerce Checkout Blocks support for domain field - Create CheckoutBlocksIntegration for block-based checkout - Create StoreApiExtension for Store API domain handling - Add checkout-blocks.js for frontend domain field in blocks - Fix LicenseManager product type check in generateLicense() - Add multiple order status hooks for reliable license generation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,10 +56,15 @@ class LicenseManager
|
||||
}
|
||||
|
||||
$product = wc_get_product($productId);
|
||||
if (!$product instanceof LicensedProduct) {
|
||||
if (!$product || !$product->is_type('licensed')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Ensure we have the LicensedProduct instance for type hints
|
||||
if (!$product instanceof LicensedProduct) {
|
||||
$product = new LicensedProduct($productId);
|
||||
}
|
||||
|
||||
// Generate unique license key
|
||||
$licenseKey = $this->generateLicenseKey();
|
||||
while ($this->getLicenseByKey($licenseKey)) {
|
||||
|
||||
Reference in New Issue
Block a user