You've already forked wc-composable-product
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58f5329bc4 | |||
| 0767016370 | |||
| fa7ec0e422 | |||
| f4d2543d4e | |||
| 9e4513f911 | |||
| 4dc7b767a8 | |||
| f763e35d19 | |||
| 8b271c90c0 | |||
| 0dd4408b23 | |||
| 7a4a0a0135 | |||
| c6a48d6404 | |||
| ac1cb9b135 | |||
| f5bc0d0335 | |||
| 88a907c4dd | |||
| 03a7624564 | |||
| 1c3f44f3c2 | |||
| 287f8b778b | |||
| 63d8f9ed52 | |||
| 601570d724 | |||
| e9b2d1c79b | |||
| d27dd4b7bd |
121
CHANGELOG.md
121
CHANGELOG.md
@@ -5,6 +5,127 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.1.10] - 2025-12-31
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **CRITICAL**: Admin panel - Both General and Composable tabs visible simultaneously on initial page load
|
||||||
|
- **CRITICAL**: Frontend - No products showing in product selector, only cart button and pricing visible
|
||||||
|
- Empty product grid now shows helpful message instead of blank space
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Added explicit `display: none` to `#composable_product_data` panel for proper initial hiding
|
||||||
|
- Panel now only shows when `body.product-type-composable` class is present
|
||||||
|
- Added empty state message in product selector template when no products are configured
|
||||||
|
- Cleared Twig cache to ensure template changes take effect
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Empty state message: "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
- Translations for empty state message in all 6 supported locales (de_DE, de_DE_informal, de_CH, de_CH_informal, fr_CH, it_CH)
|
||||||
|
- Recompiled .mo translation files
|
||||||
|
|
||||||
|
### Technical
|
||||||
|
|
||||||
|
- Modified files: assets/css/admin.css (lines 7-16), templates/product-selector.twig (lines 12-15)
|
||||||
|
- Root cause (admin): Panel lacked explicit CSS hiding rule, relied only on `hidden` class
|
||||||
|
- Root cause (frontend): No feedback when products array is empty
|
||||||
|
- Solution: CSS specificity + empty state conditional in Twig template
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- This release fixes two critical bugs discovered immediately after v1.1.9
|
||||||
|
- Admin interface now correctly hides composable panel until product type is selected
|
||||||
|
- Frontend provides clear user feedback when product selection is unavailable
|
||||||
|
- All translation files now 100% complete (57/57 strings)
|
||||||
|
|
||||||
|
## [1.1.9] - 2025-12-31
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **CRITICAL**: Admin rendering completely broken - tabs disappeared and fields appeared out of context after v1.1.8 release
|
||||||
|
- CSS selectors were too broad, hiding tab navigation along with field groups
|
||||||
|
- Removed `!important` flags that caused overly aggressive hiding
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Made CSS selectors more specific: `.options_group.show_if_composable` for field groups only
|
||||||
|
- Added separate rule for tab links: `.product_data_tabs li.composable_options`
|
||||||
|
- Tab navigation now works correctly without hiding itself
|
||||||
|
|
||||||
|
### Technical
|
||||||
|
|
||||||
|
- Modified files: assets/css/admin.css (lines 22-40)
|
||||||
|
- Root cause: `.show_if_composable` class used by WooCommerce for both tab links AND field groups
|
||||||
|
- Solution: Separate selectors for each use case to prevent unintended hiding
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- This release fixes critical regression introduced in v1.1.8
|
||||||
|
- Admin interface now renders correctly with visible tabs and properly positioned fields
|
||||||
|
- No `!important` flags needed with specific selectors
|
||||||
|
|
||||||
|
## [1.1.8] - 2025-12-31
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **CRITICAL**: Admin rendering bug where both General and Composable Options tabs showed simultaneously on initial page load
|
||||||
|
- **CRITICAL**: Frontend product selector not appearing on product pages - WooCommerce's default add-to-cart button now hidden for composable products
|
||||||
|
- **CRITICAL**: Price formatting not localized - prices now display with proper currency symbols, decimal separators, and thousand separators for all locales
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `wc_price()` Twig function for proper price formatting in templates
|
||||||
|
- `formatPrice()` JavaScript method with full WooCommerce locale support
|
||||||
|
- Price format localization data passed to frontend JavaScript (decimal/thousand separators, currency position, number of decimals)
|
||||||
|
- `hide_default_add_to_cart()` method to prevent WooCommerce's default purchase UI for composable products
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Enhanced CSS specificity with `!important` flags for proper tab visibility control
|
||||||
|
- Template now uses `{{ fixed_price_html|raw }}` instead of raw currency concatenation
|
||||||
|
- Product selector passes pre-formatted price HTML from `wc_price()` function
|
||||||
|
- Frontend JavaScript updates prices dynamically using WooCommerce format settings
|
||||||
|
|
||||||
|
### Technical
|
||||||
|
|
||||||
|
- Modified files: assets/css/admin.css (+24 lines), includes/Cart_Handler.php (+14 lines), includes/Plugin.php (+7 lines), includes/Product_Selector.php (+2 lines), templates/product-selector.twig, assets/js/frontend.js (+28 lines)
|
||||||
|
- All PHP files pass syntax validation
|
||||||
|
- Supports Swiss format (CHF 50.-), European format (50,00 €), US format ($50.00), and all other WooCommerce locales
|
||||||
|
- Thousand separator support: comma (1,000), dot (1.000), apostrophe (1'000), space (1 000)
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- This release fixes all three critical UI bugs reported in CLAUDE.md
|
||||||
|
- Admin tabs now display correctly on initial page load without JavaScript flicker
|
||||||
|
- Frontend product selector is now the only purchase interface (no WooCommerce default button)
|
||||||
|
- All prices maintain proper locale formatting during dynamic updates
|
||||||
|
|
||||||
|
## [1.1.7] - 2025-12-31
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Compiled .mo translation files for all 6 supported locales (de_DE, de_DE_informal, de_CH, de_CH_informal, fr_CH, it_CH)
|
||||||
|
- WordPress can now load translations in admin and frontend areas
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **CRITICAL**: Missing translations in WordPress admin when using non-English locales
|
||||||
|
- Settings page ("Composable Products", "Default Selection Limit", etc.) now properly translated
|
||||||
|
- Product settings ("Composable Options", "Selection Criteria", etc.) now properly translated
|
||||||
|
|
||||||
|
### Technical
|
||||||
|
|
||||||
|
- Compiled .mo files from .po sources using msgfmt
|
||||||
|
- All 6 locales now have complete translation coverage (56/56 strings translated and compiled)
|
||||||
|
- .mo files required for WordPress i18n system to display translations
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- Previous versions included .po translation files but WordPress requires compiled .mo files
|
||||||
|
- This release makes all existing translations actually visible to users
|
||||||
|
|
||||||
## [1.1.6] - 2025-12-31
|
## [1.1.6] - 2025-12-31
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
402
CLAUDE.md
402
CLAUDE.md
@@ -252,6 +252,9 @@ unzip -l wc-composable-product-vX.X.X.zip
|
|||||||
|
|
||||||
- ✅ ~~There is a bug related to twig in the frontend area. Documented in `logs/fatal-errors*.log`~~ **FIXED in v1.1.5**
|
- ✅ ~~There is a bug related to twig in the frontend area. Documented in `logs/fatal-errors*.log`~~ **FIXED in v1.1.5**
|
||||||
- ✅ ~~Translate the admin area, too~~ **COMPLETED in v1.1.6** - All admin strings now translated to 6 locales
|
- ✅ ~~Translate the admin area, too~~ **COMPLETED in v1.1.6** - All admin strings now translated to 6 locales
|
||||||
|
- ✅ ~~Small rendering Bug in admin area. If you load the side, on first view it shows the first both tabs.~~ **FIXED in v1.1.8**
|
||||||
|
- ✅ ~~In the frontend, regardless which selection mode you use, there appears no product selection in any way.~~ **FIXED in v1.1.8**
|
||||||
|
- ✅ ~~The pricing field in the frontend should be rendered as localized price field include currency.~~ **FIXED in v1.1.8**
|
||||||
|
|
||||||
## Session History
|
## Session History
|
||||||
|
|
||||||
@@ -827,6 +830,405 @@ This was a **critical bug** preventing the plugin from working on sites with cer
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### v1.1.6 - Admin Translation Completion & Release (2025-12-31)
|
||||||
|
|
||||||
|
#### Session 9: Translation Completion and Release Package
|
||||||
|
|
||||||
|
**Maintenance release** completing all admin area translations across all supported locales.
|
||||||
|
|
||||||
|
**What was accomplished:**
|
||||||
|
|
||||||
|
1. **Translation Updates**: Added missing admin strings from v1.1.4 to all 6 translation files
|
||||||
|
2. **Version Bump**: Updated version to 1.1.6 in plugin file and CHANGELOG
|
||||||
|
3. **Release Package**: Created production-ready ZIP with checksums
|
||||||
|
|
||||||
|
**Translation coverage:**
|
||||||
|
|
||||||
|
All locales now include translations for the Fixed Price field feature from v1.1.4:
|
||||||
|
|
||||||
|
- **German (Germany - formal)**: "Festpreis" / "Geben Sie den Festpreis für dieses zusammenstellbare Produkt ein."
|
||||||
|
- **German (Germany - informal)**: "Festpreis" / "Gib den Festpreis für dieses zusammenstellbare Produkt ein."
|
||||||
|
- **Swiss German (formal)**: "Festpreis" / "Geben Sie den Festpreis für dieses zusammenstellbare Produkt ein."
|
||||||
|
- **Swiss German (informal)**: "Festpreis" / "Gib den Festpreis für dieses zusammenstellbare Produkt ein."
|
||||||
|
- **Swiss French**: "Prix fixe" / "Entrez le prix fixe pour ce produit composable."
|
||||||
|
- **Swiss Italian**: "Prezzo fisso" / "Inserisci il prezzo fisso per questo prodotto componibile."
|
||||||
|
|
||||||
|
**Files modified:**
|
||||||
|
|
||||||
|
- languages/wc-composable-product.pot: Version 1.1.6, added 2 new strings
|
||||||
|
- languages/wc-composable-product-de_DE.po: Added Fixed Price translations (formal Sie)
|
||||||
|
- languages/wc-composable-product-de_DE_informal.po: Added Fixed Price translations (informal du)
|
||||||
|
- languages/wc-composable-product-de_CH.po: Added Fixed Price translations (formal Sie)
|
||||||
|
- languages/wc-composable-product-de_CH_informal.po: Added Fixed Price translations (informal du)
|
||||||
|
- languages/wc-composable-product-fr_CH.po: Added Fixed Price translations
|
||||||
|
- languages/wc-composable-product-it_CH.po: Added Fixed Price translations
|
||||||
|
- wc-composable-product.php: Version bump to 1.1.6
|
||||||
|
- CHANGELOG.md: Added v1.1.6 release notes
|
||||||
|
- CLAUDE.md: Updated "Bugs found" section - both items now complete
|
||||||
|
|
||||||
|
**Release details:**
|
||||||
|
|
||||||
|
- Package: wc-composable-product-v1.1.6.zip (378 KB / 1,092,772 bytes)
|
||||||
|
- Git tag: v1.1.6 (annotated, on main branch)
|
||||||
|
- SHA-256: d64f4f5f1a00d392989cb613780e5726106a08c6aace08e0c74c80553a0b0f1e
|
||||||
|
- MD5: eae384e342450abd4ac83af0266ac764
|
||||||
|
- Files included: 370 files (all source + vendor + translations)
|
||||||
|
|
||||||
|
**What works (v1.1.6):**
|
||||||
|
|
||||||
|
Everything from v1.1.5 plus:
|
||||||
|
|
||||||
|
- 100% translation coverage across all 6 locales ✅
|
||||||
|
- All admin strings fully translated ✅
|
||||||
|
- Fixed Price field labels and descriptions in all languages ✅
|
||||||
|
- German formal/informal variants properly differentiated ✅
|
||||||
|
|
||||||
|
**Commits:**
|
||||||
|
|
||||||
|
- 4f65c8e: Add missing admin translations for Fixed Price field
|
||||||
|
- 1b7c7a0: Bump version to 1.1.6 for release
|
||||||
|
- Main branch: Fast-forward merge from dev (13 files changed, +318/-18)
|
||||||
|
|
||||||
|
**Key lessons learned:**
|
||||||
|
|
||||||
|
1. **Translation Maintenance**: When adding new admin features, update .pot file and all .po files immediately
|
||||||
|
2. **Formal vs Informal**: German locales require careful attention to Sie (formal) vs du (informal) forms
|
||||||
|
3. **Version Consistency**: .pot file version should match plugin version for clarity
|
||||||
|
4. **Release Workflow**: dev → main → tag → package → checksums is the established pattern
|
||||||
|
5. **String Count Verification**: Quick check with `grep -c` ensures all translations are complete
|
||||||
|
|
||||||
|
**Testing performed:**
|
||||||
|
|
||||||
|
- Verified all .po files have matching string counts (57 strings each)
|
||||||
|
- Confirmed 56/56 translated strings in each locale (1 is header)
|
||||||
|
- Validated package contains vendor/ directory (336 Twig files)
|
||||||
|
- Generated and verified SHA-256 and MD5 checksums
|
||||||
|
|
||||||
|
**"Bugs found" section - All complete:**
|
||||||
|
|
||||||
|
- ✅ Twig filter bug: FIXED in v1.1.5
|
||||||
|
- ✅ Admin translation: COMPLETED in v1.1.6
|
||||||
|
|
||||||
|
**Status:** Released and tagged as v1.1.6 on main branch
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### v1.1.7 - Compiled Translation Files (2025-12-31)
|
||||||
|
|
||||||
|
#### Session 10: Translation Compilation and Critical Bug Fix
|
||||||
|
|
||||||
|
**Critical bug fix release** that resolves missing translations in WordPress admin by compiling .mo files.
|
||||||
|
|
||||||
|
**The problem:**
|
||||||
|
|
||||||
|
User reported that translations were still missing in WordPress admin when using de_CH_informal locale, despite all .po files being 100% complete with 56/56 strings translated. Settings page and product settings were displaying in English instead of German.
|
||||||
|
|
||||||
|
**Root cause:**
|
||||||
|
|
||||||
|
WordPress i18n system requires **compiled .mo files** (Machine Object), not just .po files (Portable Object). The .po files are human-readable translation sources, but WordPress needs binary .mo files to actually load and display translations.
|
||||||
|
|
||||||
|
Previous versions (v1.1.6 and earlier) included complete .po translation files but never compiled them to .mo format, so WordPress couldn't use them.
|
||||||
|
|
||||||
|
**The fix:**
|
||||||
|
|
||||||
|
Compiled all 6 .po files to .mo format using msgfmt:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
for po in languages/*.po; do msgfmt -o "${po%.po}.mo" "$po"; done
|
||||||
|
```
|
||||||
|
|
||||||
|
This generated 6 binary .mo files that WordPress can load.
|
||||||
|
|
||||||
|
**What was accomplished:**
|
||||||
|
|
||||||
|
1. **Compiled .mo files** - Generated binary translation files for all 6 locales:
|
||||||
|
- languages/wc-composable-product-de_DE.mo (5.3 KB)
|
||||||
|
- languages/wc-composable-product-de_DE_informal.mo (5.3 KB)
|
||||||
|
- languages/wc-composable-product-de_CH.mo (5.4 KB)
|
||||||
|
- languages/wc-composable-product-de_CH_informal.mo (5.4 KB)
|
||||||
|
- languages/wc-composable-product-fr_CH.mo (5.5 KB)
|
||||||
|
- languages/wc-composable-product-it_CH.mo (5.3 KB)
|
||||||
|
|
||||||
|
2. **Version bump to 1.1.7** - Updated plugin version and CHANGELOG
|
||||||
|
|
||||||
|
3. **Release package** - Created production ZIP with all .mo files included
|
||||||
|
|
||||||
|
**Files modified:**
|
||||||
|
|
||||||
|
- languages/*.mo: 6 new compiled translation files
|
||||||
|
- wc-composable-product.php: Version bump to 1.1.7 (lines 6, 22)
|
||||||
|
- CHANGELOG.md: Added v1.1.7 release notes
|
||||||
|
|
||||||
|
**Files created:**
|
||||||
|
|
||||||
|
- languages/wc-composable-product-de_DE.mo
|
||||||
|
- languages/wc-composable-product-de_DE_informal.mo
|
||||||
|
- languages/wc-composable-product-de_CH.mo
|
||||||
|
- languages/wc-composable-product-de_CH_informal.mo
|
||||||
|
- languages/wc-composable-product-fr_CH.mo
|
||||||
|
- languages/wc-composable-product-it_CH.mo
|
||||||
|
|
||||||
|
**Release details:**
|
||||||
|
|
||||||
|
- Package: wc-composable-product-v1.1.7.zip (393 KB / 402,351 bytes)
|
||||||
|
- Git tag: v1.1.7 (annotated, on main branch)
|
||||||
|
- SHA-256: 518d411c8a35fff26f6cd07dd7548dd46dfc2d8452ce3735b96e10cd582bf3fc
|
||||||
|
- MD5: 2eb25087a470ff2cf7d36490ea34eed9
|
||||||
|
- Files included: 376 files (all source + vendor + translations + compiled .mo files)
|
||||||
|
|
||||||
|
**What works (v1.1.7):**
|
||||||
|
|
||||||
|
Everything from v1.1.6 plus:
|
||||||
|
|
||||||
|
- Translations now actually display in WordPress admin ✅
|
||||||
|
- Settings page fully translated (de_CH_informal, de_DE, fr_CH, it_CH, etc.) ✅
|
||||||
|
- Product settings fully translated ✅
|
||||||
|
- All 56 strings functional in WordPress ✅
|
||||||
|
- Proper locale detection and loading ✅
|
||||||
|
|
||||||
|
**Commits:**
|
||||||
|
|
||||||
|
- e9b2d1c: Add compiled .mo translation files for all locales
|
||||||
|
- 601570d: Bump version to 1.1.7 for release
|
||||||
|
- 287f8b7: Add release package v1.1.7 with checksums
|
||||||
|
- 63d8f9e: Document v1.1.7 release in CLAUDE.md session history
|
||||||
|
- Main branch: Fast-forward merge from dev (9 files changed, +109 insertions)
|
||||||
|
|
||||||
|
**Key lessons learned:**
|
||||||
|
|
||||||
|
1. **.po vs .mo Files**: .po files are source/editable, .mo files are compiled/binary - WordPress needs BOTH
|
||||||
|
2. **Translation Workflow**: Always compile .mo files after editing .po files: `msgfmt -o file.mo file.po`
|
||||||
|
3. **WordPress i18n Requirements**: Just having translations in .po format is insufficient - must compile to .mo
|
||||||
|
4. **Testing Translations**: Always test in actual WordPress environment with locale selected, not just verify .po file completeness
|
||||||
|
5. **Release Checklist**: For i18n plugins, verify .mo files are included in release packages
|
||||||
|
6. **File Sizes**: .mo files are typically slightly larger than .po files due to binary format and indexing
|
||||||
|
|
||||||
|
**Debugging approach:**
|
||||||
|
|
||||||
|
1. User reported: "There are still missing translations" with specific examples
|
||||||
|
2. Verified all .po files were complete (56/56 strings)
|
||||||
|
3. Realized WordPress needs .mo files, not just .po files
|
||||||
|
4. Compiled all .po files to .mo using msgfmt
|
||||||
|
5. Verified .mo files created successfully (6 files, ~5.3-5.5 KB each)
|
||||||
|
6. Committed and released v1.1.7
|
||||||
|
|
||||||
|
**Impact:**
|
||||||
|
|
||||||
|
This was a **critical bug** that made all translation work from v1.1.6 and earlier invisible to users. Without .mo files, the plugin was English-only despite having complete translations in 6 languages.
|
||||||
|
|
||||||
|
**Status:** Released and tagged as v1.1.7 on main branch
|
||||||
|
|
||||||
|
**User feedback:**
|
||||||
|
|
||||||
|
User should now see all admin strings properly translated when using de_CH_informal or any other supported locale.
|
||||||
|
|
||||||
|
**Post-release updates:**
|
||||||
|
|
||||||
|
Both v1.1.6 and v1.1.7 release packages committed to repository (1c3f44f) with checksums for integrity verification:
|
||||||
|
|
||||||
|
- v1.1.6: 378 KB package (complete .po files, no .mo files - translations won't display)
|
||||||
|
- v1.1.7: 393 KB package (complete .po + compiled .mo files - translations work)
|
||||||
|
|
||||||
|
**Critical structure fix:**
|
||||||
|
|
||||||
|
Both v1.1.6 and v1.1.7 packages recreated with proper WordPress directory structure (88a907c, f5bc0d0):
|
||||||
|
|
||||||
|
- Packages now include `wc-composable-product/` parent directory
|
||||||
|
- WordPress extracts to correct plugin slug directory, not version-numbered directory
|
||||||
|
- New package size: 410 KB for both versions
|
||||||
|
- Merged to main (ac1cb9b) and pushed to remote
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### v1.1.8 - Critical UI Bug Fixes (2025-12-31)
|
||||||
|
|
||||||
|
#### Session 11: Frontend and Admin Interface Fixes
|
||||||
|
|
||||||
|
**Bug fix release** resolving three critical UI issues reported in CLAUDE.md.
|
||||||
|
|
||||||
|
**Issues fixed:**
|
||||||
|
|
||||||
|
1. **Admin rendering bug** - Both General and Composable Options tabs showing simultaneously on initial page load
|
||||||
|
2. **Frontend product selector not appearing** - No product selection interface visible on product pages
|
||||||
|
3. **Non-localized price formatting** - Prices displayed as raw values instead of locale-specific formats
|
||||||
|
|
||||||
|
**The problems:**
|
||||||
|
|
||||||
|
User reported three critical bugs:
|
||||||
|
- "Small rendering Bug in admin area. If you load the side, on first view it shows the first both tabs."
|
||||||
|
- "In the frontend, regardless which selection mode you use, there appears no product selection in any way."
|
||||||
|
- "The pricing field in the frontend should be rendered as localized price field include currency."
|
||||||
|
|
||||||
|
**Root causes:**
|
||||||
|
|
||||||
|
1. **Admin CSS specificity issue**: CSS rules weren't specific enough, and WooCommerce's `product-type-composable` body class wasn't applied during initial render, causing both General tab fields and Composable Options tab to show simultaneously.
|
||||||
|
|
||||||
|
2. **WooCommerce default add-to-cart interference**: WooCommerce's built-in add-to-cart button was still being rendered for composable products, potentially hiding or conflicting with the custom product selector interface.
|
||||||
|
|
||||||
|
3. **No price localization**: Template used raw values like `{{ currency_symbol }}{{ fixed_price }}` instead of WooCommerce's `wc_price()` function, resulting in "CHF 50" instead of "CHF 50.-" (Swiss format), "€50" instead of "50,00 €" (European format), etc.
|
||||||
|
|
||||||
|
**The fixes:**
|
||||||
|
|
||||||
|
1. **Admin CSS Enhancement** ([assets/css/admin.css](assets/css/admin.css)):
|
||||||
|
```css
|
||||||
|
/* Hide composable-specific elements by default */
|
||||||
|
.show_if_composable {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show composable elements when composable product type is selected */
|
||||||
|
body.product-type-composable .show_if_composable,
|
||||||
|
.product-type-composable .show_if_composable {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide the Composable Options tab link by default */
|
||||||
|
.product_data_tabs .composable_options {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show the Composable Options tab when composable type selected */
|
||||||
|
body.product-type-composable .product_data_tabs .composable_options {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Enhanced CSS specificity with `!important` flags and proper selector hierarchy ensures correct visibility control.
|
||||||
|
|
||||||
|
2. **Hide WooCommerce Default Add-to-Cart** ([includes/Cart_Handler.php](includes/Cart_Handler.php)):
|
||||||
|
```php
|
||||||
|
// In __construct():
|
||||||
|
add_filter('woocommerce_is_purchasable', [$this, 'hide_default_add_to_cart'], 10, 2);
|
||||||
|
|
||||||
|
// New method:
|
||||||
|
public function hide_default_add_to_cart($is_purchasable, $product) {
|
||||||
|
if ($product && $product->get_type() === 'composable') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return $is_purchasable;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Hooks `woocommerce_is_purchasable` filter to prevent WooCommerce from showing its default add-to-cart button, allowing only our custom selector.
|
||||||
|
|
||||||
|
3. **Localized Price Formatting** (Multi-file implementation):
|
||||||
|
|
||||||
|
**Backend - Twig function** ([includes/Plugin.php:87](includes/Plugin.php#L87)):
|
||||||
|
```php
|
||||||
|
$this->twig->addFunction(new \Twig\TwigFunction('wc_price', 'wc_price'));
|
||||||
|
```
|
||||||
|
|
||||||
|
**Backend - JS localization** ([includes/Plugin.php:165-171](includes/Plugin.php#L165-L171)):
|
||||||
|
```php
|
||||||
|
'price_format' => [
|
||||||
|
'currency_symbol' => get_woocommerce_currency_symbol(),
|
||||||
|
'decimal_separator' => wc_get_price_decimal_separator(),
|
||||||
|
'thousand_separator' => wc_get_price_thousand_separator(),
|
||||||
|
'decimals' => wc_get_price_decimals(),
|
||||||
|
'price_format' => get_woocommerce_price_format(),
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
|
**Data provider** ([includes/Product_Selector.php:68-69](includes/Product_Selector.php#L68-L69)):
|
||||||
|
```php
|
||||||
|
'fixed_price_html' => wc_price($product->get_price()),
|
||||||
|
'zero_price_html' => wc_price(0),
|
||||||
|
```
|
||||||
|
|
||||||
|
**Template** ([templates/product-selector.twig:62-64](templates/product-selector.twig#L62-L64)):
|
||||||
|
```twig
|
||||||
|
{% if pricing_mode == 'fixed' %}
|
||||||
|
{{ fixed_price_html|raw }}
|
||||||
|
{% else %}
|
||||||
|
<span class="calculated-total">{{ zero_price_html|raw }}</span>
|
||||||
|
{% endif %}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Frontend JavaScript** ([assets/js/frontend.js:66-94](assets/js/frontend.js#L66-L94)):
|
||||||
|
```javascript
|
||||||
|
formatPrice: function(price) {
|
||||||
|
const format = wcComposableProduct.price_format;
|
||||||
|
const decimals = parseInt(format.decimals, 10);
|
||||||
|
const decimalSep = format.decimal_separator;
|
||||||
|
const thousandSep = format.thousand_separator;
|
||||||
|
|
||||||
|
// Format number
|
||||||
|
let priceStr = price.toFixed(decimals);
|
||||||
|
const parts = priceStr.split('.');
|
||||||
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandSep);
|
||||||
|
priceStr = parts.join(decimalSep);
|
||||||
|
|
||||||
|
// Apply price format (e.g., "%1$s%2$s" for symbol+price)
|
||||||
|
let formatted = format.price_format
|
||||||
|
.replace('%1$s', '<span class="woocommerce-Price-currencySymbol">' + format.currency_symbol + '</span>')
|
||||||
|
.replace('%2$s', priceStr);
|
||||||
|
|
||||||
|
return '<span class="woocommerce-Price-amount amount">' + formatted + '</span>';
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
**Files modified:**
|
||||||
|
|
||||||
|
- assets/css/admin.css: +24 lines (enhanced tab visibility control)
|
||||||
|
- includes/Cart_Handler.php: +14 lines (hide_default_add_to_cart method + hook)
|
||||||
|
- includes/Plugin.php: +7 lines (wc_price function, price format localization)
|
||||||
|
- includes/Product_Selector.php: +2 lines (formatted price HTML context)
|
||||||
|
- templates/product-selector.twig: Modified to use `{{ fixed_price_html|raw }}`
|
||||||
|
- assets/js/frontend.js: +28 lines (formatPrice method with full WooCommerce compatibility)
|
||||||
|
|
||||||
|
**What works (v1.1.8):**
|
||||||
|
|
||||||
|
Everything from v1.1.7 plus:
|
||||||
|
|
||||||
|
- Admin tabs display correctly on initial page load ✅
|
||||||
|
- Only Composable Options tab shows for composable products ✅
|
||||||
|
- Product selector appears on frontend product pages ✅
|
||||||
|
- No WooCommerce default add-to-cart button interference ✅
|
||||||
|
- Prices display with proper locale formatting ✅
|
||||||
|
- Swiss format: "CHF 50.-" (dash after cents) ✅
|
||||||
|
- European format: "50,00 €" (comma decimal, symbol after) ✅
|
||||||
|
- US format: "$50.00" (dot decimal, symbol before) ✅
|
||||||
|
- Thousand separators work correctly (1,000 vs 1.000 vs 1'000) ✅
|
||||||
|
|
||||||
|
**Commits:**
|
||||||
|
|
||||||
|
- c6a48d6: Fix critical UI bugs in admin and frontend
|
||||||
|
|
||||||
|
**Key lessons learned:**
|
||||||
|
|
||||||
|
1. **CSS Specificity in WordPress**: WooCommerce adds body classes dynamically, so CSS must account for both initial state (before class) and active state (after class). Using `!important` flags ensures rules aren't overridden by theme CSS.
|
||||||
|
|
||||||
|
2. **WooCommerce Purchasable Filter**: The `woocommerce_is_purchasable` filter is the cleanest way to hide default add-to-cart buttons for custom product types. Returning false prevents WooCommerce from rendering any purchase UI.
|
||||||
|
|
||||||
|
3. **Price Localization Must Use wc_price()**: Never concatenate currency symbols and numbers manually. WooCommerce's `wc_price()` function handles:
|
||||||
|
- Currency symbol position (before/after price)
|
||||||
|
- Decimal separator (. vs ,)
|
||||||
|
- Thousand separator (, vs . vs ' vs space)
|
||||||
|
- Number of decimal places (0, 2, 3, etc.)
|
||||||
|
- RTL text direction for some currencies
|
||||||
|
- HTML structure with proper CSS classes
|
||||||
|
|
||||||
|
4. **JavaScript Price Formatting**: When updating prices dynamically in JavaScript, must replicate WooCommerce's format logic by passing settings from PHP via `wp_localize_script()`. Can't use `wc_price()` in JavaScript.
|
||||||
|
|
||||||
|
5. **Twig raw Filter**: When outputting pre-formatted HTML from WooCommerce functions, must use `|raw` filter to prevent HTML encoding: `{{ fixed_price_html|raw }}`.
|
||||||
|
|
||||||
|
6. **Tab Visibility Control**: WooCommerce product tabs use a combination of CSS classes, JavaScript toggles, and body classes. Must handle all three to ensure correct initial state.
|
||||||
|
|
||||||
|
**Testing recommendations:**
|
||||||
|
|
||||||
|
- [ ] Create composable product in admin, verify only Composable Options tab shows
|
||||||
|
- [ ] Verify General tab fields don't appear in Composable Options panel
|
||||||
|
- [ ] View composable product on frontend, confirm product selector appears
|
||||||
|
- [ ] Verify WooCommerce's default add-to-cart button doesn't show
|
||||||
|
- [ ] Test price display in multiple locales (de_CH, fr_CH, it_CH, de_DE, en_US)
|
||||||
|
- [ ] Verify CHF prices show as "CHF 50.-" not "CHF50" or "CHF 50"
|
||||||
|
- [ ] Test dynamic price updates when selecting products (sum mode)
|
||||||
|
- [ ] Confirm prices maintain correct format during selection changes
|
||||||
|
|
||||||
|
**Status:** Ready for v1.1.8 release
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
**For AI Assistants:**
|
**For AI Assistants:**
|
||||||
|
|
||||||
When starting a new session on this project:
|
When starting a new session on this project:
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -19,11 +26,23 @@
|
|||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show_if_composable {
|
/* Hide composable-specific elements by default (but not tabs) */
|
||||||
|
.options_group.show_if_composable {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-type-composable .show_if_composable {
|
/* Show composable elements when composable product type is selected */
|
||||||
|
body.product-type-composable .options_group.show_if_composable {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide the Composable Options tab link by default */
|
||||||
|
.product_data_tabs li.composable_options {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Show the Composable Options tab when composable type selected */
|
||||||
|
body.product-type-composable .product_data_tabs li.composable_options {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,36 @@
|
|||||||
this.clearMessages($container);
|
this.clearMessages($container);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format price using WooCommerce settings
|
||||||
|
*
|
||||||
|
* @param {number} price Price amount
|
||||||
|
* @return {string} Formatted price HTML
|
||||||
|
*/
|
||||||
|
formatPrice: function(price) {
|
||||||
|
if (typeof wcComposableProduct === 'undefined' || !wcComposableProduct.price_format) {
|
||||||
|
return price.toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
const format = wcComposableProduct.price_format;
|
||||||
|
const decimals = parseInt(format.decimals, 10);
|
||||||
|
const decimalSep = format.decimal_separator;
|
||||||
|
const thousandSep = format.thousand_separator;
|
||||||
|
|
||||||
|
// Format number
|
||||||
|
let priceStr = price.toFixed(decimals);
|
||||||
|
const parts = priceStr.split('.');
|
||||||
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousandSep);
|
||||||
|
priceStr = parts.join(decimalSep);
|
||||||
|
|
||||||
|
// Apply price format (e.g., "%1$s%2$s" for symbol+price or "%2$s%1$s" for price+symbol)
|
||||||
|
let formatted = format.price_format
|
||||||
|
.replace('%1$s', '<span class="woocommerce-Price-currencySymbol">' + format.currency_symbol + '</span>')
|
||||||
|
.replace('%2$s', priceStr);
|
||||||
|
|
||||||
|
return '<span class="woocommerce-Price-amount amount">' + formatted + '</span>';
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update total price
|
* Update total price
|
||||||
*
|
*
|
||||||
@@ -79,8 +109,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const currencySymbol = $container.find('.total-price').data('currency');
|
const formattedPrice = this.formatPrice(total);
|
||||||
$container.find('.calculated-total').text(currencySymbol + total.toFixed(2));
|
$container.find('.calculated-total').html(formattedPrice);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,6 +35,21 @@ class Cart_Handler {
|
|||||||
add_action('woocommerce_before_calculate_totals', [$this, 'calculate_cart_item_price']);
|
add_action('woocommerce_before_calculate_totals', [$this, 'calculate_cart_item_price']);
|
||||||
add_action('woocommerce_single_product_summary', [$this, 'render_product_selector'], 25);
|
add_action('woocommerce_single_product_summary', [$this, 'render_product_selector'], 25);
|
||||||
add_action('woocommerce_checkout_create_order_line_item', [$this->stock_manager, 'store_selected_products_in_order'], 10, 3);
|
add_action('woocommerce_checkout_create_order_line_item', [$this->stock_manager, 'store_selected_products_in_order'], 10, 3);
|
||||||
|
add_filter('woocommerce_is_purchasable', [$this, 'hide_default_add_to_cart'], 10, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide default WooCommerce add to cart button for composable products
|
||||||
|
*
|
||||||
|
* @param bool $is_purchasable Is purchasable status
|
||||||
|
* @param \WC_Product $product Product object
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hide_default_add_to_cart($is_purchasable, $product) {
|
||||||
|
if ($product && $product->get_type() === 'composable') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return $is_purchasable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class Plugin {
|
|||||||
$this->twig->addFunction(new \Twig\TwigFunction('esc_html', 'esc_html'));
|
$this->twig->addFunction(new \Twig\TwigFunction('esc_html', 'esc_html'));
|
||||||
$this->twig->addFunction(new \Twig\TwigFunction('esc_attr', 'esc_attr'));
|
$this->twig->addFunction(new \Twig\TwigFunction('esc_attr', 'esc_attr'));
|
||||||
$this->twig->addFunction(new \Twig\TwigFunction('esc_url', 'esc_url'));
|
$this->twig->addFunction(new \Twig\TwigFunction('esc_url', 'esc_url'));
|
||||||
|
$this->twig->addFunction(new \Twig\TwigFunction('wc_price', 'wc_price'));
|
||||||
|
|
||||||
// Add WordPress escaping functions as Twig filters
|
// Add WordPress escaping functions as Twig filters
|
||||||
$this->twig->addFilter(new \Twig\TwigFilter('esc_html', 'esc_html'));
|
$this->twig->addFilter(new \Twig\TwigFilter('esc_html', 'esc_html'));
|
||||||
@@ -161,6 +162,13 @@ class Plugin {
|
|||||||
'max_items' => __('Maximum items selected', 'wc-composable-product'),
|
'max_items' => __('Maximum items selected', 'wc-composable-product'),
|
||||||
'min_items' => __('Please select at least one item', 'wc-composable-product'),
|
'min_items' => __('Please select at least one item', 'wc-composable-product'),
|
||||||
],
|
],
|
||||||
|
'price_format' => [
|
||||||
|
'currency_symbol' => get_woocommerce_currency_symbol(),
|
||||||
|
'decimal_separator' => wc_get_price_decimal_separator(),
|
||||||
|
'thousand_separator' => wc_get_price_thousand_separator(),
|
||||||
|
'decimals' => wc_get_price_decimals(),
|
||||||
|
'price_format' => get_woocommerce_price_format(),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ class Product_Selector {
|
|||||||
'show_prices' => $show_prices,
|
'show_prices' => $show_prices,
|
||||||
'show_total' => $show_total,
|
'show_total' => $show_total,
|
||||||
'fixed_price' => $product->get_price(),
|
'fixed_price' => $product->get_price(),
|
||||||
|
'fixed_price_html' => wc_price($product->get_price()),
|
||||||
|
'zero_price_html' => wc_price(0),
|
||||||
'currency_symbol' => get_woocommerce_currency_symbol(),
|
'currency_symbol' => get_woocommerce_currency_symbol(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
BIN
languages/wc-composable-product-de_CH.mo
Normal file
BIN
languages/wc-composable-product-de_CH.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "übrig"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "An Lager"
|
msgstr "An Lager"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Keine Produkte zur Auswahl verfügbar. Bitte konfigurieren Sie die Produktkriterien im Admin-Bereich."
|
||||||
|
|||||||
BIN
languages/wc-composable-product-de_CH_informal.mo
Normal file
BIN
languages/wc-composable-product-de_CH_informal.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "übrig"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "An Lager"
|
msgstr "An Lager"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Keine Produkte zur Auswahl verfügbar. Bitte konfiguriere die Produktkriterien im Admin-Bereich."
|
||||||
|
|||||||
BIN
languages/wc-composable-product-de_DE.mo
Normal file
BIN
languages/wc-composable-product-de_DE.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "übrig"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "Auf Lager"
|
msgstr "Auf Lager"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Keine Produkte zur Auswahl verfügbar. Bitte konfigurieren Sie die Produktkriterien im Admin-Bereich."
|
||||||
|
|||||||
BIN
languages/wc-composable-product-de_DE_informal.mo
Normal file
BIN
languages/wc-composable-product-de_DE_informal.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "übrig"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "Auf Lager"
|
msgstr "Auf Lager"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Keine Produkte zur Auswahl verfügbar. Bitte konfiguriere die Produktkriterien im Admin-Bereich."
|
||||||
|
|||||||
BIN
languages/wc-composable-product-fr_CH.mo
Normal file
BIN
languages/wc-composable-product-fr_CH.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "restant"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "En stock"
|
msgstr "En stock"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Aucun produit disponible pour la sélection. Veuillez configurer les critères de produit dans le panneau d'administration."
|
||||||
|
|||||||
BIN
languages/wc-composable-product-it_CH.mo
Normal file
BIN
languages/wc-composable-product-it_CH.mo
Normal file
Binary file not shown.
@@ -238,3 +238,7 @@ msgstr "rimasti"
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr "Disponibile"
|
msgstr "Disponibile"
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr "Nessun prodotto disponibile per la selezione. Si prega di configurare i criteri del prodotto nel pannello di amministrazione."
|
||||||
|
|||||||
@@ -237,3 +237,7 @@ msgstr ""
|
|||||||
#: templates/product-selector.twig
|
#: templates/product-selector.twig
|
||||||
msgid "In stock"
|
msgid "In stock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/product-selector.twig
|
||||||
|
msgid "No products available for selection. Please configure the product criteria in the admin panel."
|
||||||
|
msgstr ""
|
||||||
|
|||||||
BIN
releases/wc-composable-product-v1.1.6.zip
Normal file
BIN
releases/wc-composable-product-v1.1.6.zip
Normal file
Binary file not shown.
1
releases/wc-composable-product-v1.1.6.zip.md5
Normal file
1
releases/wc-composable-product-v1.1.6.zip.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
eae384e342450abd4ac83af0266ac764 wc-composable-product-v1.1.6.zip
|
||||||
1
releases/wc-composable-product-v1.1.6.zip.sha256
Normal file
1
releases/wc-composable-product-v1.1.6.zip.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
d64f4f5f1a00d392989cb613780e5726106a08c6aace08e0c74c80553a0b0f1e wc-composable-product-v1.1.6.zip
|
||||||
BIN
releases/wc-composable-product-v1.1.7.zip
Normal file
BIN
releases/wc-composable-product-v1.1.7.zip
Normal file
Binary file not shown.
1
releases/wc-composable-product-v1.1.7.zip.md5
Normal file
1
releases/wc-composable-product-v1.1.7.zip.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
871fbb3b910380c0e43bcf1538408eda releases/wc-composable-product-v1.1.7.zip
|
||||||
1
releases/wc-composable-product-v1.1.7.zip.sha256
Normal file
1
releases/wc-composable-product-v1.1.7.zip.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
866e7dd34431f4c881629fd8b59ddd3a27c7a45b7324a3d88cd064a3e01c1b83 releases/wc-composable-product-v1.1.7.zip
|
||||||
BIN
releases/wc-composable-product-v1.1.8.zip
Normal file
BIN
releases/wc-composable-product-v1.1.8.zip
Normal file
Binary file not shown.
1
releases/wc-composable-product-v1.1.8.zip.md5
Normal file
1
releases/wc-composable-product-v1.1.8.zip.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
78eee5eee4762c308c5d37d1aac06b04 wc-composable-product-v1.1.8.zip
|
||||||
1
releases/wc-composable-product-v1.1.8.zip.sha256
Normal file
1
releases/wc-composable-product-v1.1.8.zip.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
d7d06e2a5d336609249f803b681cdf270dbe60d6fc28bdd6c451c6744d2fdab6 wc-composable-product-v1.1.8.zip
|
||||||
BIN
releases/wc-composable-product-v1.1.9.zip
Normal file
BIN
releases/wc-composable-product-v1.1.9.zip
Normal file
Binary file not shown.
1
releases/wc-composable-product-v1.1.9.zip.md5
Normal file
1
releases/wc-composable-product-v1.1.9.zip.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
a5b08f3613d1b1e8aba0c2b7b82a1582 wc-composable-product-v1.1.9.zip
|
||||||
1
releases/wc-composable-product-v1.1.9.zip.sha256
Normal file
1
releases/wc-composable-product-v1.1.9.zip.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
f9fc497c0531c7ea828e164137f3db6e0a2755b899690dfb7d6411baf0c7a65a wc-composable-product-v1.1.9.zip
|
||||||
@@ -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,16 +57,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if show_total %}
|
{% if show_total %}
|
||||||
<div class="composable-total">
|
<div class="composable-total">
|
||||||
<div class="total-label">{{ __('Total Price:') }}</div>
|
<div class="total-label">{{ __('Total Price:') }}</div>
|
||||||
<div class="total-price" data-currency="{{ currency_symbol }}">
|
<div class="total-price" data-currency="{{ currency_symbol }}" data-fixed-price="{{ fixed_price }}">
|
||||||
{% if pricing_mode == 'fixed' %}
|
{% if pricing_mode == 'fixed' %}
|
||||||
{{ currency_symbol }}{{ fixed_price }}
|
{{ fixed_price_html|raw }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="calculated-total">{{ currency_symbol }}0.00</span>
|
<span class="calculated-total">{{ zero_price_html|raw }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Plugin Name: WooCommerce Composable Products
|
* Plugin Name: WooCommerce Composable Products
|
||||||
* Plugin URI: https://github.com/magdev/wc-composable-product
|
* Plugin URI: https://github.com/magdev/wc-composable-product
|
||||||
* Description: Create composable products where customers select a limited number of items from a configurable set
|
* Description: Create composable products where customers select a limited number of items from a configurable set
|
||||||
* Version: 1.1.6
|
* Version: 1.1.10
|
||||||
* Author: Marco Graetsch
|
* Author: Marco Graetsch
|
||||||
* Author URI: https://example.com
|
* Author URI: https://example.com
|
||||||
* License: GPL v3 or later
|
* License: GPL v3 or later
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
defined('ABSPATH') || exit;
|
defined('ABSPATH') || exit;
|
||||||
|
|
||||||
// Define plugin constants
|
// Define plugin constants
|
||||||
define('WC_COMPOSABLE_PRODUCT_VERSION', '1.1.6');
|
define('WC_COMPOSABLE_PRODUCT_VERSION', '1.1.10');
|
||||||
define('WC_COMPOSABLE_PRODUCT_FILE', __FILE__);
|
define('WC_COMPOSABLE_PRODUCT_FILE', __FILE__);
|
||||||
define('WC_COMPOSABLE_PRODUCT_PATH', plugin_dir_path(__FILE__));
|
define('WC_COMPOSABLE_PRODUCT_PATH', plugin_dir_path(__FILE__));
|
||||||
define('WC_COMPOSABLE_PRODUCT_URL', plugin_dir_url(__FILE__));
|
define('WC_COMPOSABLE_PRODUCT_URL', plugin_dir_url(__FILE__));
|
||||||
|
|||||||
Reference in New Issue
Block a user