Fix two critical bugs in v1.1.9

Bug 1: Admin - Both General and Composable tabs visible on initial load
- Added explicit display:none to #composable_product_data panel
- Panel now hidden by default, shows only when product-type-composable class is present
- Prevents both tabs showing simultaneously on new product creation

Bug 2: Frontend - No feedback when no products configured
- Added empty state message when products array is empty
- Users now see helpful message instead of blank grid
- Cleared Twig cache to ensure template changes take effect

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-31 22:34:46 +01:00
parent f4d2543d4e
commit fa7ec0e422
2 changed files with 13 additions and 0 deletions

View File

@@ -4,10 +4,17 @@
* @package WC_Composable_Product * @package WC_Composable_Product
*/ */
/* Hide composable panel by default */
#composable_product_data { #composable_product_data {
display: none;
padding: 12px; padding: 12px;
} }
/* Show composable panel when composable type is selected */
body.product-type-composable #composable_product_data {
display: block;
}
.composable_criteria_group { .composable_criteria_group {
border-top: 1px solid #eee; border-top: 1px solid #eee;
padding-top: 12px; padding-top: 12px;

View File

@@ -9,6 +9,11 @@
</div> </div>
<div class="composable-products-grid"> <div class="composable-products-grid">
{% if products is empty %}
<div class="composable-no-products">
<p>{{ __('No products available for selection. Please configure the product criteria in the admin panel.') }}</p>
</div>
{% else %}
{% for product in products %} {% for product in products %}
<div class="composable-product-item{% if not product.in_stock %} out-of-stock{% endif %}" data-product-id="{{ product.id }}" data-price="{{ product.price }}" data-stock-status="{{ product.stock_status }}"> <div class="composable-product-item{% if not product.in_stock %} out-of-stock{% endif %}" data-product-id="{{ product.id }}" data-price="{{ product.price }}" data-stock-status="{{ product.stock_status }}">
<div class="product-item-inner"> <div class="product-item-inner">
@@ -52,6 +57,7 @@
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% endif %}
</div> </div>
{% if show_total %} {% if show_total %}