9 Commits

Author SHA1 Message Date
9826c8181e Fix frontend error on licensed variable products without attributes (v0.5.9)
- Added null checks for get_variation_attributes(), get_available_variations(), get_default_attributes()
- Show informative message when product has no variations configured
- Changed product type check from instanceof to is_type() for better compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:40:50 +01:00
fa972ceaf0 Add release package v0.5.8
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:36:24 +01:00
3abf05cff3 Update translations for v0.5.8
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:35:02 +01:00
169eed65eb Fix critical error and variants tab on licensed variable products (v0.5.8)
- Fixed critical error on frontend product pages for licensed variable products
- Variable product add-to-cart template now passes required variables
- Variants tab no longer disappears when saving attributes
- Added WooCommerce AJAX event listeners for tab visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:34:27 +01:00
90cb8d97bd Update CLAUDE.md with v0.5.6 and v0.5.7 session history
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:59:48 +01:00
fc281f7f4a Add release package v0.5.7
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:56:26 +01:00
962368d35f Update translations for v0.5.7
- Updated POT template with 388 strings
- All German (de_CH) strings translated
- Recompiled .mo file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:55:18 +01:00
4dcace6f06 Remove Default prefix from settings labels (v0.5.7)
- Max Activations (was "Default Max Activations")
- License Validity (Days) (was "Default License Validity (Days)")
- Bind to Major Version (was "Default Bind to Major Version")

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:54:31 +01:00
62aecc0240 Add release package v0.5.6
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:38:54 +01:00
14 changed files with 362 additions and 214 deletions

View File

@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [0.5.9] - 2026-01-27
### Fixed
- Fixed frontend error on licensed variable products when no attributes are defined
- Added null checks for `get_variation_attributes()`, `get_available_variations()`, and `get_default_attributes()`
- Show informative message instead of error when product has no variations configured
- Changed product type check from `instanceof` to `is_type()` for better compatibility
## [0.5.8] - 2026-01-27
### Fixed
- **CRITICAL:** Fixed critical error on frontend product pages for licensed variable products
- Variable product add-to-cart template now passes required variables (`available_variations`, `attributes`, `selected_attributes`)
- Variants tab no longer disappears when saving attributes on licensed variable products
- Added WooCommerce AJAX event listeners to maintain tab visibility during attribute operations
### Changed
- Improved JavaScript event handling for licensed-variable product type in admin
- Added listeners for `woocommerce_variations_loaded`, `woocommerce_variations_added`, `woocommerce_variations_saved` events
- Added AJAX complete handler for attribute save operations
## [0.5.7] - 2026-01-27
### Changed
- Removed "Default" prefix from setting labels on Default Settings page for cleaner UI
- Labels now read "Max Activations", "License Validity (Days)", and "Bind to Major Version"
## [0.5.6] - 2026-01-27 ## [0.5.6] - 2026-01-27
### Fixed ### Fixed

View File

@@ -1437,3 +1437,61 @@ Critical bug fix for response signing. The key derivation algorithm was incompat
- Length: 32 bytes (256 bits) - Length: 32 bytes (256 bits)
- Info: license_key (context-specific info) - Info: license_key (context-specific info)
- **Breaking change for existing signatures** - customer secrets will change after upgrade - **Breaking change for existing signatures** - customer secrets will change after upgrade
### 2026-01-27 - Version 0.5.6 - License Settings Tab Visibility Fix
**Overview:**
Fixed License Settings tab visibility for non-licensed product types and updated README with v0.5.x features.
**Bug Fix:**
- License Settings tab now only shows for Licensed Product and Licensed Variable Product types
- Previously the tab was visible on all product types due to CSS `!important` override forcing `display: block`
**Modified files:**
- `assets/css/admin.css` - Changed from `display: block !important` to `display: none` for `.show_if_licensed` and `.show_if_licensed-variable`
- `src/Product/LicensedProductType.php` - Added consolidated `toggleLicensedProductOptions()` JavaScript function
- `README.md` - Updated with complete feature documentation for v0.5.x features
**Technical notes:**
- CSS now hides License Settings tab by default
- JavaScript `toggleLicensedProductOptions()` function shows/hides tab based on product type selector
- Function is called both on page load and on product type change
- README updated with: Variable Licensed Products, Multi-Domain Licensing, Per-License Secrets, Download Statistics, Configurable Rate Limiting
**Release v0.5.6:**
- Created release package: `releases/wc-licensed-product-0.5.6.zip` (1.1 MB)
- SHA256: `4d35a319fe4cb4e7055bae17fc030487ca05e5e9ac905f76d0ac62002bde4336`
- Tagged as `v0.5.6` and pushed to `main` branch
### 2026-01-27 - Version 0.5.7 - Settings UI Cleanup
**Overview:**
Removed redundant "Default" prefix from setting labels on the Default Settings page for cleaner UI.
**Changed:**
- "Max Activations" (was "Default Max Activations")
- "License Validity (Days)" (was "Default License Validity (Days)")
- "Bind to Major Version" (was "Default Bind to Major Version")
**Modified files:**
- `src/Admin/SettingsController.php` - Removed "Default" prefix from three setting labels
**Technical notes:**
- Labels are cleaner since the page section itself is already named "Default Settings"
- No functional changes, purely UI improvement
- Updated all translations (388 strings)
**Release v0.5.7:**
- Created release package: `releases/wc-licensed-product-0.5.7.zip` (856 KB)
- SHA256: `ceb4d57598f576f4f172153ff80df8c180ecd4dca873cf109327fc5ac718930f`
- Tagged as `v0.5.7` and pushed to `main` branch

View File

@@ -4,8 +4,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WC Licensed Product 0.5.0\n" "Project-Id-Version: WC Licensed Product 0.5.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: magdev3.0@gmail.com\n"
"POT-Creation-Date: 2026-01-27 11:29+0100\n" "POT-Creation-Date: 2026-01-27 13:34+0100\n"
"PO-Revision-Date: 2026-01-25T18:30:00+00:00\n" "PO-Revision-Date: 2026-01-25T18:30:00+00:00\n"
"Last-Translator: Marco Graetsch <magdev3.0@gmail.com>\n" "Last-Translator: Marco Graetsch <magdev3.0@gmail.com>\n"
"Language-Team: German (Switzerland) <de_CH@li.org>\n" "Language-Team: German (Switzerland) <de_CH@li.org>\n"
@@ -310,10 +310,11 @@ msgstr "Speichern"
#: src/Admin/AdminController.php:1373 src/Admin/AdminController.php:1613 #: src/Admin/AdminController.php:1373 src/Admin/AdminController.php:1613
#: src/Admin/DashboardWidgetController.php:136 #: src/Admin/DashboardWidgetController.php:136
#: src/Admin/OrderLicenseController.php:260 #: src/Admin/OrderLicenseController.php:260
#: src/Admin/SettingsController.php:192 src/Product/LicensedProductType.php:136 #: src/Admin/SettingsController.php:192
#: src/Product/LicensedProductType.php:184
#: src/Product/LicensedProductType.php:385
#: src/Product/LicensedProductVariation.php:139 #: src/Product/LicensedProductVariation.php:139
#: src/Product/LicensedProductType.php:136
#: src/Product/LicensedProductType.php:184
#: src/Product/LicensedProductType.php:403
#: src/Frontend/AccountController.php:286 #: src/Frontend/AccountController.php:286
msgid "Lifetime" msgid "Lifetime"
msgstr "Lebenslang" msgstr "Lebenslang"
@@ -1165,17 +1166,18 @@ msgstr ""
"Diese Einstellungen dienen als Standard für neue lizensierte Produkte. " "Diese Einstellungen dienen als Standard für neue lizensierte Produkte. "
"Individuelle Produkteinstellungen überschreiben diese Standards." "Individuelle Produkteinstellungen überschreiben diese Standards."
#: src/Admin/SettingsController.php:176 #: src/Admin/SettingsController.php:176 src/Product/LicensedProductType.php:154
msgid "Default Max Activations" #: src/Product/LicensedProductType.php:420
msgstr "Standard Max. Aktivierungen" msgid "Max Activations"
msgstr "Max. Aktivierungen"
#: src/Admin/SettingsController.php:178 #: src/Admin/SettingsController.php:178
msgid "Default maximum number of domain activations per license." msgid "Default maximum number of domain activations per license."
msgstr "Standard maximale Anzahl der Domain-Aktivierungen pro Lizenz." msgstr "Standard maximale Anzahl der Domain-Aktivierungen pro Lizenz."
#: src/Admin/SettingsController.php:187 #: src/Admin/SettingsController.php:187 src/Product/LicensedProductType.php:172
msgid "Default License Validity (Days)" msgid "License Validity (Days)"
msgstr "Standard Lizenz-Gültigkeit (Tage)" msgstr "Lizenz-Gültigkeit (Tage)"
#: src/Admin/SettingsController.php:189 #: src/Admin/SettingsController.php:189
msgid "" msgid ""
@@ -1185,9 +1187,9 @@ msgstr ""
"Standard Anzahl Tage, die eine Lizenz gültig ist. Leer lassen oder auf 0 " "Standard Anzahl Tage, die eine Lizenz gültig ist. Leer lassen oder auf 0 "
"setzen für lebenslange Lizenzen." "setzen für lebenslange Lizenzen."
#: src/Admin/SettingsController.php:199 #: src/Admin/SettingsController.php:199 src/Product/LicensedProductType.php:190
msgid "Default Bind to Major Version" msgid "Bind to Major Version"
msgstr "Standard An Hauptversion binden" msgstr "An Hauptversion binden"
#: src/Admin/SettingsController.php:201 #: src/Admin/SettingsController.php:201
msgid "" msgid ""
@@ -1441,97 +1443,6 @@ msgstr "Anhangs-Datei nicht gefunden."
msgid "File checksum does not match. Expected: %1$s, Got: %2$s" msgid "File checksum does not match. Expected: %1$s, Got: %2$s"
msgstr "Datei-Prüfsumme stimmt nicht überein. Erwartet: %1$s, Erhalten: %2$s" msgstr "Datei-Prüfsumme stimmt nicht überein. Erwartet: %1$s, Erhalten: %2$s"
#: src/Product/LicensedProductType.php:72
msgid "Licensed Product"
msgstr "Lizensiertes Produkt"
#: src/Product/LicensedProductType.php:73
msgid "Licensed Variable Product"
msgstr "Lizensiertes variables Produkt"
#: src/Product/LicensedProductType.php:108
msgid "License Settings"
msgstr "Lizenz-Einstellungen"
#: src/Product/LicensedProductType.php:135
#: src/Product/LicensedProductType.php:384
#, php-format
msgid "%d days"
msgstr "%d Tage"
#: src/Product/LicensedProductType.php:145
#, php-format
msgid "Leave fields empty to use default settings from %s."
msgstr "Felder leer lassen, um Standardeinstellungen von %s zu verwenden."
#: src/Product/LicensedProductType.php:147
msgid "WooCommerce > Settings > Licensed Products"
msgstr "WooCommerce > Einstellungen > Lizensierte Produkte"
#: src/Product/LicensedProductType.php:154
#: src/Product/LicensedProductType.php:402
msgid "Max Activations"
msgstr "Max. Aktivierungen"
#: src/Product/LicensedProductType.php:157
#, php-format
msgid "Maximum number of domain activations per license. Default: %d"
msgstr "Maximale Anzahl der Domain-Aktivierungen pro Lizenz. Standard: %d"
#: src/Product/LicensedProductType.php:172
msgid "License Validity (Days)"
msgstr "Lizenz-Gültigkeit (Tage)"
#: src/Product/LicensedProductType.php:175
#, php-format
msgid "Number of days the license is valid. Leave empty for default (%s)."
msgstr "Anzahl Tage, die die Lizenz gültig ist. Leer lassen für Standard (%s)."
#: src/Product/LicensedProductType.php:190
msgid "Bind to Major Version"
msgstr "An Hauptversion binden"
#: src/Product/LicensedProductType.php:193
#, php-format
msgid ""
"If enabled, licenses are bound to the major version at purchase time. "
"Default: %s"
msgstr ""
"Falls aktiviert, werden Lizenzen an die Hauptversion zum Kaufzeitpunkt "
"gebunden. Standard: %s"
#: src/Product/LicensedProductType.php:194
msgid "Yes"
msgstr "Ja"
#: src/Product/LicensedProductType.php:194
msgid "No"
msgstr "Nein"
#: src/Product/LicensedProductType.php:327
msgid "Version:"
msgstr "Version:"
#: src/Product/LicensedProductType.php:355
msgid "Licensed products are always virtual"
msgstr "Lizenzierte Produkte sind immer virtuell"
#: src/Product/LicensedProductType.php:357
msgid "Virtual"
msgstr "Virtuell"
#: src/Product/LicensedProductType.php:390
msgid "License Duration (Days)"
msgstr "Lizenz-Gültigkeit (Tage)"
#: src/Product/LicensedProductType.php:399
msgid "Leave empty for parent default. 0 = Lifetime."
msgstr "Leer lassen für übergeordneten Standard. 0 = Lebenslang."
#: src/Product/LicensedProductType.php:411
msgid "Leave empty for parent default."
msgstr "Leer lassen für übergeordneten Standard."
#: src/Product/LicensedProductVariation.php:143 #: src/Product/LicensedProductVariation.php:143
msgid "Monthly" msgid "Monthly"
msgstr "Monatlich" msgstr "Monatlich"
@@ -1551,6 +1462,84 @@ msgid_plural "%d days"
msgstr[0] "%d Tag" msgstr[0] "%d Tag"
msgstr[1] "%d Tage" msgstr[1] "%d Tage"
#: src/Product/LicensedProductType.php:72
msgid "Licensed Product"
msgstr "Lizensiertes Produkt"
#: src/Product/LicensedProductType.php:73
msgid "Licensed Variable Product"
msgstr "Lizensiertes variables Produkt"
#: src/Product/LicensedProductType.php:108
msgid "License Settings"
msgstr "Lizenz-Einstellungen"
#: src/Product/LicensedProductType.php:135
#: src/Product/LicensedProductType.php:402
#, php-format
msgid "%d days"
msgstr "%d Tage"
#: src/Product/LicensedProductType.php:145
#, php-format
msgid "Leave fields empty to use default settings from %s."
msgstr "Felder leer lassen, um Standardeinstellungen von %s zu verwenden."
#: src/Product/LicensedProductType.php:147
msgid "WooCommerce > Settings > Licensed Products"
msgstr "WooCommerce > Einstellungen > Lizensierte Produkte"
#: src/Product/LicensedProductType.php:157
#, php-format
msgid "Maximum number of domain activations per license. Default: %d"
msgstr "Maximale Anzahl der Domain-Aktivierungen pro Lizenz. Standard: %d"
#: src/Product/LicensedProductType.php:175
#, php-format
msgid "Number of days the license is valid. Leave empty for default (%s)."
msgstr "Anzahl Tage, die die Lizenz gültig ist. Leer lassen für Standard (%s)."
#: src/Product/LicensedProductType.php:193
#, php-format
msgid ""
"If enabled, licenses are bound to the major version at purchase time. "
"Default: %s"
msgstr ""
"Falls aktiviert, werden Lizenzen an die Hauptversion zum Kaufzeitpunkt "
"gebunden. Standard: %s"
#: src/Product/LicensedProductType.php:194
msgid "Yes"
msgstr "Ja"
#: src/Product/LicensedProductType.php:194
msgid "No"
msgstr "Nein"
#: src/Product/LicensedProductType.php:329
msgid "Version:"
msgstr "Version:"
#: src/Product/LicensedProductType.php:373
msgid "Licensed products are always virtual"
msgstr "Lizenzierte Produkte sind immer virtuell"
#: src/Product/LicensedProductType.php:375
msgid "Virtual"
msgstr "Virtuell"
#: src/Product/LicensedProductType.php:408
msgid "License Duration (Days)"
msgstr "Lizenz-Gültigkeit (Tage)"
#: src/Product/LicensedProductType.php:417
msgid "Leave empty for parent default. 0 = Lifetime."
msgstr "Leer lassen für übergeordneten Standard. 0 = Lebenslang."
#: src/Product/LicensedProductType.php:429
msgid "Leave empty for parent default."
msgstr "Leer lassen für übergeordneten Standard."
#: src/Frontend/DownloadController.php:77 #: src/Frontend/DownloadController.php:77
#: src/Frontend/DownloadController.php:101 #: src/Frontend/DownloadController.php:101
msgid "Invalid download link." msgid "Invalid download link."
@@ -1916,6 +1905,15 @@ msgstr ""
"WC Licensed Product benötigt WooCommerce als installierte und aktivierte " "WC Licensed Product benötigt WooCommerce als installierte und aktivierte "
"Erweiterung." "Erweiterung."
#~ msgid "Default Max Activations"
#~ msgstr "Standard Max. Aktivierungen"
#~ msgid "Default License Validity (Days)"
#~ msgstr "Standard Lizenz-Gültigkeit (Tage)"
#~ msgid "Default Bind to Major Version"
#~ msgstr "Standard An Hauptversion binden"
#~ msgid "API Verification Secret" #~ msgid "API Verification Secret"
#~ msgstr "API-Verifizierungs-Secret" #~ msgstr "API-Verifizierungs-Secret"

View File

@@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WC Licensed Product 0.5.6\n" "Project-Id-Version: WC Licensed Product 0.5.8\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: magdev3.0@gmail.com\n"
"POT-Creation-Date: 2026-01-27 11:29+0100\n" "POT-Creation-Date: 2026-01-27 13:34+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -303,10 +303,11 @@ msgstr ""
#: src/Admin/AdminController.php:1373 src/Admin/AdminController.php:1613 #: src/Admin/AdminController.php:1373 src/Admin/AdminController.php:1613
#: src/Admin/DashboardWidgetController.php:136 #: src/Admin/DashboardWidgetController.php:136
#: src/Admin/OrderLicenseController.php:260 #: src/Admin/OrderLicenseController.php:260
#: src/Admin/SettingsController.php:192 src/Product/LicensedProductType.php:136 #: src/Admin/SettingsController.php:192
#: src/Product/LicensedProductType.php:184
#: src/Product/LicensedProductType.php:385
#: src/Product/LicensedProductVariation.php:139 #: src/Product/LicensedProductVariation.php:139
#: src/Product/LicensedProductType.php:136
#: src/Product/LicensedProductType.php:184
#: src/Product/LicensedProductType.php:403
#: src/Frontend/AccountController.php:286 #: src/Frontend/AccountController.php:286
msgid "Lifetime" msgid "Lifetime"
msgstr "" msgstr ""
@@ -1132,16 +1133,17 @@ msgid ""
"product settings override these defaults." "product settings override these defaults."
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:176 #: src/Admin/SettingsController.php:176 src/Product/LicensedProductType.php:154
msgid "Default Max Activations" #: src/Product/LicensedProductType.php:420
msgid "Max Activations"
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:178 #: src/Admin/SettingsController.php:178
msgid "Default maximum number of domain activations per license." msgid "Default maximum number of domain activations per license."
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:187 #: src/Admin/SettingsController.php:187 src/Product/LicensedProductType.php:172
msgid "Default License Validity (Days)" msgid "License Validity (Days)"
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:189 #: src/Admin/SettingsController.php:189
@@ -1150,8 +1152,8 @@ msgid ""
"lifetime licenses." "lifetime licenses."
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:199 #: src/Admin/SettingsController.php:199 src/Product/LicensedProductType.php:190
msgid "Default Bind to Major Version" msgid "Bind to Major Version"
msgstr "" msgstr ""
#: src/Admin/SettingsController.php:201 #: src/Admin/SettingsController.php:201
@@ -1392,95 +1394,6 @@ msgstr ""
msgid "File checksum does not match. Expected: %1$s, Got: %2$s" msgid "File checksum does not match. Expected: %1$s, Got: %2$s"
msgstr "" msgstr ""
#: src/Product/LicensedProductType.php:72
msgid "Licensed Product"
msgstr ""
#: src/Product/LicensedProductType.php:73
msgid "Licensed Variable Product"
msgstr ""
#: src/Product/LicensedProductType.php:108
msgid "License Settings"
msgstr ""
#: src/Product/LicensedProductType.php:135
#: src/Product/LicensedProductType.php:384
#, php-format
msgid "%d days"
msgstr ""
#: src/Product/LicensedProductType.php:145
#, php-format
msgid "Leave fields empty to use default settings from %s."
msgstr ""
#: src/Product/LicensedProductType.php:147
msgid "WooCommerce > Settings > Licensed Products"
msgstr ""
#: src/Product/LicensedProductType.php:154
#: src/Product/LicensedProductType.php:402
msgid "Max Activations"
msgstr ""
#: src/Product/LicensedProductType.php:157
#, php-format
msgid "Maximum number of domain activations per license. Default: %d"
msgstr ""
#: src/Product/LicensedProductType.php:172
msgid "License Validity (Days)"
msgstr ""
#: src/Product/LicensedProductType.php:175
#, php-format
msgid "Number of days the license is valid. Leave empty for default (%s)."
msgstr ""
#: src/Product/LicensedProductType.php:190
msgid "Bind to Major Version"
msgstr ""
#: src/Product/LicensedProductType.php:193
#, php-format
msgid ""
"If enabled, licenses are bound to the major version at purchase time. "
"Default: %s"
msgstr ""
#: src/Product/LicensedProductType.php:194
msgid "Yes"
msgstr ""
#: src/Product/LicensedProductType.php:194
msgid "No"
msgstr ""
#: src/Product/LicensedProductType.php:327
msgid "Version:"
msgstr ""
#: src/Product/LicensedProductType.php:355
msgid "Licensed products are always virtual"
msgstr ""
#: src/Product/LicensedProductType.php:357
msgid "Virtual"
msgstr ""
#: src/Product/LicensedProductType.php:390
msgid "License Duration (Days)"
msgstr ""
#: src/Product/LicensedProductType.php:399
msgid "Leave empty for parent default. 0 = Lifetime."
msgstr ""
#: src/Product/LicensedProductType.php:411
msgid "Leave empty for parent default."
msgstr ""
#: src/Product/LicensedProductVariation.php:143 #: src/Product/LicensedProductVariation.php:143
msgid "Monthly" msgid "Monthly"
msgstr "" msgstr ""
@@ -1500,6 +1413,82 @@ msgid_plural "%d days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Product/LicensedProductType.php:72
msgid "Licensed Product"
msgstr ""
#: src/Product/LicensedProductType.php:73
msgid "Licensed Variable Product"
msgstr ""
#: src/Product/LicensedProductType.php:108
msgid "License Settings"
msgstr ""
#: src/Product/LicensedProductType.php:135
#: src/Product/LicensedProductType.php:402
#, php-format
msgid "%d days"
msgstr ""
#: src/Product/LicensedProductType.php:145
#, php-format
msgid "Leave fields empty to use default settings from %s."
msgstr ""
#: src/Product/LicensedProductType.php:147
msgid "WooCommerce > Settings > Licensed Products"
msgstr ""
#: src/Product/LicensedProductType.php:157
#, php-format
msgid "Maximum number of domain activations per license. Default: %d"
msgstr ""
#: src/Product/LicensedProductType.php:175
#, php-format
msgid "Number of days the license is valid. Leave empty for default (%s)."
msgstr ""
#: src/Product/LicensedProductType.php:193
#, php-format
msgid ""
"If enabled, licenses are bound to the major version at purchase time. "
"Default: %s"
msgstr ""
#: src/Product/LicensedProductType.php:194
msgid "Yes"
msgstr ""
#: src/Product/LicensedProductType.php:194
msgid "No"
msgstr ""
#: src/Product/LicensedProductType.php:329
msgid "Version:"
msgstr ""
#: src/Product/LicensedProductType.php:373
msgid "Licensed products are always virtual"
msgstr ""
#: src/Product/LicensedProductType.php:375
msgid "Virtual"
msgstr ""
#: src/Product/LicensedProductType.php:408
msgid "License Duration (Days)"
msgstr ""
#: src/Product/LicensedProductType.php:417
msgid "Leave empty for parent default. 0 = Lifetime."
msgstr ""
#: src/Product/LicensedProductType.php:429
msgid "Leave empty for parent default."
msgstr ""
#: src/Frontend/DownloadController.php:77 #: src/Frontend/DownloadController.php:77
#: src/Frontend/DownloadController.php:101 #: src/Frontend/DownloadController.php:101
msgid "Invalid download link." msgid "Invalid download link."

Binary file not shown.

View File

@@ -0,0 +1 @@
4d35a319fe4cb4e7055bae17fc030487ca05e5e9ac905f76d0ac62002bde4336 releases/wc-licensed-product-0.5.6.zip

Binary file not shown.

View File

@@ -0,0 +1 @@
ceb4d57598f576f4f172153ff80df8c180ecd4dca873cf109327fc5ac718930f wc-licensed-product-0.5.7.zip

Binary file not shown.

View File

@@ -0,0 +1 @@
670c2f5182ea7140ccf9533c2b4179daf7890019a244973f467f2a5c7622b9f4 wc-licensed-product-0.5.8.zip

View File

@@ -173,7 +173,7 @@ final class SettingsController
'id' => 'wc_licensed_product_section_defaults', 'id' => 'wc_licensed_product_section_defaults',
], ],
'default_max_activations' => [ 'default_max_activations' => [
'name' => __('Default Max Activations', 'wc-licensed-product'), 'name' => __('Max Activations', 'wc-licensed-product'),
'type' => 'number', 'type' => 'number',
'desc' => __('Default maximum number of domain activations per license.', 'wc-licensed-product'), 'desc' => __('Default maximum number of domain activations per license.', 'wc-licensed-product'),
'id' => 'wc_licensed_product_default_max_activations', 'id' => 'wc_licensed_product_default_max_activations',
@@ -184,7 +184,7 @@ final class SettingsController
], ],
], ],
'default_validity_days' => [ 'default_validity_days' => [
'name' => __('Default License Validity (Days)', 'wc-licensed-product'), 'name' => __('License Validity (Days)', 'wc-licensed-product'),
'type' => 'number', 'type' => 'number',
'desc' => __('Default number of days a license is valid. Leave empty or set to 0 for lifetime licenses.', 'wc-licensed-product'), 'desc' => __('Default number of days a license is valid. Leave empty or set to 0 for lifetime licenses.', 'wc-licensed-product'),
'id' => 'wc_licensed_product_default_validity_days', 'id' => 'wc_licensed_product_default_validity_days',
@@ -196,7 +196,7 @@ final class SettingsController
], ],
], ],
'default_bind_to_version' => [ 'default_bind_to_version' => [
'name' => __('Default Bind to Major Version', 'wc-licensed-product'), 'name' => __('Bind to Major Version', 'wc-licensed-product'),
'type' => 'checkbox', 'type' => 'checkbox',
'desc' => __('If enabled, licenses are bound to the major version at purchase time by default.', 'wc-licensed-product'), 'desc' => __('If enabled, licenses are bound to the major version at purchase time by default.', 'wc-licensed-product'),
'id' => 'wc_licensed_product_default_bind_to_version', 'id' => 'wc_licensed_product_default_bind_to_version',

View File

@@ -201,19 +201,21 @@ final class LicensedProductType
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
// Show/hide panels based on product type // Show/hide panels based on product type for license settings tab
function toggleLicensedProductOptions() { function toggleLicensedProductOptions() {
var productType = $('#product-type').val(); var productType = $('#product-type').val();
var isLicensed = productType === 'licensed'; var isLicensed = productType === 'licensed';
var isLicensedVariable = productType === 'licensed-variable'; var isLicensedVariable = productType === 'licensed-variable';
if (isLicensed || isLicensedVariable) { if (isLicensed || isLicensedVariable) {
// Show license settings tab
$('.show_if_licensed').show(); $('.show_if_licensed').show();
$('.show_if_licensed-variable').show(); $('.show_if_licensed-variable').show();
$('.general_options').show(); $('.general_options').show();
$('.pricing').show(); $('.pricing').show();
$('.general_tab').show(); $('.general_tab').show();
} else { } else {
// Hide license settings tab for other product types
$('.show_if_licensed').hide(); $('.show_if_licensed').hide();
$('.show_if_licensed-variable').hide(); $('.show_if_licensed-variable').hide();
} }
@@ -334,7 +336,49 @@ final class LicensedProductType
*/ */
public function variableAddToCartTemplate(): void public function variableAddToCartTemplate(): void
{ {
wc_get_template('single-product/add-to-cart/variable.php'); global $product;
// Check if product is a variable type (includes LicensedVariableProduct which extends WC_Product_Variable)
if (!$product || !$product->is_type('licensed-variable')) {
return;
}
// Get attributes - ensure we have an array even if no attributes are set
$attributes = $product->get_variation_attributes();
if (!is_array($attributes)) {
$attributes = [];
}
// If no attributes defined, show a message instead of broken form
if (empty($attributes)) {
echo '<p class="woocommerce-info">' . esc_html__('This product has no variations available.', 'wc-licensed-product') . '</p>';
return;
}
// Get variations count to determine if we should load them via AJAX
$children = $product->get_children();
$getVariations = count($children) <= apply_filters('woocommerce_ajax_variation_threshold', 30, $product);
// Get available variations - ensure we have an array
$availableVariations = $getVariations ? $product->get_available_variations() : false;
if ($getVariations && !is_array($availableVariations)) {
$availableVariations = [];
}
// Get default/selected attributes - ensure we have an array
$selectedAttributes = $product->get_default_attributes();
if (!is_array($selectedAttributes)) {
$selectedAttributes = [];
}
wc_get_template(
'single-product/add-to-cart/variable.php',
[
'available_variations' => $availableVariations,
'attributes' => $attributes,
'selected_attributes' => $selectedAttributes,
]
);
} }
/** /**
@@ -507,9 +551,13 @@ final class LicensedProductType
// Show general and variations tabs // Show general and variations tabs
$('.general_tab').show(); $('.general_tab').show();
$('.variations_tab').show(); $('.variations_tab').show();
$('.variations_options').show();
// Hide shipping tab (virtual products) // Hide shipping tab (virtual products)
$('.shipping_tab').hide(); $('.shipping_tab').hide();
// Ensure the variations panel can be displayed
$('#variable_product_options').show();
} }
} }
@@ -518,8 +566,29 @@ final class LicensedProductType
// On product type change // On product type change
$('#product-type').on('change', function() { $('#product-type').on('change', function() {
toggleLicensedVariableOptions(); // Use setTimeout to let WooCommerce finish its own processing first
setTimeout(toggleLicensedVariableOptions, 100);
}); });
// Re-apply after WooCommerce AJAX operations that may reset visibility
$(document).on('woocommerce_variations_loaded', toggleLicensedVariableOptions);
$(document).on('woocommerce_variations_added', toggleLicensedVariableOptions);
$(document).on('woocommerce_variations_saved', toggleLicensedVariableOptions);
// Handle AJAX complete events for attribute saving
$(document).ajaxComplete(function(event, xhr, settings) {
// Check if this was a product data save or attribute action
if (settings.data && (
settings.data.indexOf('action=woocommerce_save_attributes') !== -1 ||
settings.data.indexOf('action=woocommerce_load_variations') !== -1 ||
settings.data.indexOf('action=woocommerce_add_variation') !== -1
)) {
setTimeout(toggleLicensedVariableOptions, 100);
}
});
// Also listen for the WooCommerce product type show/hide trigger
$('body').on('woocommerce-product-type-change', toggleLicensedVariableOptions);
}); });
</script> </script>
<?php <?php

View File

@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Licensed Product * Plugin Name: WooCommerce Licensed Product
* Plugin URI: https://src.bundespruefstelle.ch/magdev/wc-licensed-product * Plugin URI: https://src.bundespruefstelle.ch/magdev/wc-licensed-product
* Description: WooCommerce plugin to sell software products using license keys with domain-based validation. * Description: WooCommerce plugin to sell software products using license keys with domain-based validation.
* Version: 0.5.6 * Version: 0.5.9
* Author: Marco Graetsch * Author: Marco Graetsch
* Author URI: https://src.bundespruefstelle.ch/magdev * Author URI: https://src.bundespruefstelle.ch/magdev
* License: GPL-2.0-or-later * License: GPL-2.0-or-later
@@ -28,7 +28,7 @@ if (!defined('ABSPATH')) {
} }
// Plugin constants // Plugin constants
define('WC_LICENSED_PRODUCT_VERSION', '0.5.6'); define('WC_LICENSED_PRODUCT_VERSION', '0.5.9');
define('WC_LICENSED_PRODUCT_PLUGIN_FILE', __FILE__); define('WC_LICENSED_PRODUCT_PLUGIN_FILE', __FILE__);
define('WC_LICENSED_PRODUCT_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('WC_LICENSED_PRODUCT_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('WC_LICENSED_PRODUCT_PLUGIN_URL', plugin_dir_url(__FILE__)); define('WC_LICENSED_PRODUCT_PLUGIN_URL', plugin_dir_url(__FILE__));