diff --git a/CHANGELOG.md b/CHANGELOG.md index 7701221..86c896a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.15] - 2026-01-27 + +### Fixed + +- Fixed tab rendering bug in WooCommerce product edit page when switching to licensed or licensed-variable product types +- Simplified JavaScript to avoid conflicts with WooCommerce's native show/hide logic +- Removed conflicting CSS rule for `.hide_if_licensed` that was causing layout issues +- License Settings tab now uses CSS class toggle (`.wclp-active`) instead of jQuery `.show()/.hide()` for proper display +- Variations tab now properly shows for licensed-variable products via `woocommerce_product_data_tabs` filter + ## [0.5.14] - 2026-01-27 ### Fixed diff --git a/assets/css/admin.css b/assets/css/admin.css index 4a615b1..ab0d451 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -50,22 +50,20 @@ code.file-hash { color: #666; } -/* License Product Tab - Hidden by default, shown via JS based on product type */ -#woocommerce-product-data ul.wc-tabs li.show_if_licensed, -#woocommerce-product-data ul.wc-tabs li.show_if_licensed-variable { +/* License Settings Tab - Hidden by default, shown via JS based on product type */ +/* WooCommerce creates tab with class: {tab_key}_options (licensed_product_options) */ +#woocommerce-product-data ul.wc-tabs li.licensed_product_options { display: none; } /* When shown, restore proper display for tab list items */ -#woocommerce-product-data ul.wc-tabs li.show_if_licensed.wclp-active, -#woocommerce-product-data ul.wc-tabs li.show_if_licensed-variable.wclp-active { +#woocommerce-product-data ul.wc-tabs li.licensed_product_options.wclp-active { display: block; } -/* Hide elements for non-licensed products */ -#woocommerce-product-data .hide_if_licensed { - display: none !important; -} +/* Variations tab visibility for licensed-variable is handled by WooCommerce */ +/* We add show_if_licensed-variable class to the variations tab via PHP filter */ + /* Action Buttons */ .wp-list-table .button-link-delete { diff --git a/src/Product/LicensedProductType.php b/src/Product/LicensedProductType.php index c0de937..86f192f 100644 --- a/src/Product/LicensedProductType.php +++ b/src/Product/LicensedProductType.php @@ -141,15 +141,23 @@ final class LicensedProductType /** * Add product data tab for license settings + * Also modify variations tab to show for licensed-variable products */ public function addProductDataTab(array $tabs): array { + // Add our License Settings tab $tabs['licensed_product'] = [ 'label' => __('License Settings', 'wc-licensed-product'), 'target' => 'licensed_product_data', 'class' => ['show_if_licensed', 'show_if_licensed-variable'], 'priority' => 21, ]; + + // Make Variations tab also show for licensed-variable products + if (isset($tabs['variations'])) { + $tabs['variations']['class'][] = 'show_if_licensed-variable'; + } + return $tabs; } @@ -643,77 +651,63 @@ final class LicensedProductType ?>