Implement version 0.0.1 - Licensed Product type for WooCommerce

Add complete plugin infrastructure for selling software with license keys:

- New "Licensed Product" WooCommerce product type
- License key generation (XXXX-XXXX-XXXX-XXXX format) on order completion
- Domain-based license validation system
- REST API endpoints (validate, status, activate, deactivate)
- Customer My Account "Licenses" page
- Admin license management under WooCommerce > Licenses
- Checkout domain field for licensed products
- Custom database tables for licenses and product versions
- Twig template engine integration
- Full i18n support with German (de_CH) translation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 18:55:18 +01:00
parent 8a4802248c
commit 404083f023
22 changed files with 3746 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
{% if not has_licenses %}
<p>{{ __('You have no licenses yet.') }}</p>
{% else %}
<table class="woocommerce-licenses-table shop_table shop_table_responsive">
<thead>
<tr>
<th>{{ __('License Key') }}</th>
<th>{{ __('Product') }}</th>
<th>{{ __('Domain') }}</th>
<th>{{ __('Status') }}</th>
<th>{{ __('Expires') }}</th>
</tr>
</thead>
<tbody>
{% for item in licenses %}
<tr>
<td data-title="{{ __('License Key') }}">
<code>{{ item.license.licenseKey }}</code>
</td>
<td data-title="{{ __('Product') }}">
{% if item.product_url %}
<a href="{{ esc_url(item.product_url) }}">{{ esc_html(item.product_name) }}</a>
{% else %}
{{ esc_html(item.product_name) }}
{% endif %}
</td>
<td data-title="{{ __('Domain') }}">
{{ esc_html(item.license.domain) }}
</td>
<td data-title="{{ __('Status') }}">
<span class="license-status license-status-{{ item.license.status }}">
{{ item.license.status|capitalize }}
</span>
</td>
<td data-title="{{ __('Expires') }}">
{% if item.license.expiresAt %}
{{ item.license.expiresAt|date('Y-m-d') }}
{% else %}
{{ __('Never') }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}