Commit Graph

30 Commits

Author SHA1 Message Date
e4ecc2c0be Release version 1.2.5 - Parent product default pricing and UI enhancements
Added:
- Parent product default pricing for variable products - set tier/package pricing once on parent, variations inherit unless overridden
- Hide empty table headers in admin until pricing rules are defined

Technical:
- Added parent fallback logic to get_tier_price() and get_package_price() methods
- Created helper methods get_packages_with_fallback() and is_restriction_enabled() in cart class
- Updated all cart methods to support parent product defaults
- Added CSS :has() selectors to hide table headers when tbody is empty
- Fixed cart pricing calls to pass correct product ID for fallback resolution

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 00:23:56 +01:00
937e80fce3 Release version 1.2.4 - Fix admin table borders and checkbox layout
Fixed:
- Admin table borders still visible despite v1.2.3 fix - added !important flags
- Help icon positioning at right edge instead of next to label - changed to flexbox layout
- Increased checkbox margin from 8px to 12px for better spacing

Technical:
- Added border-collapse: collapse !important to force borderless tables
- Changed label layout from float to inline-flex for proper help-tip positioning
- Added comprehensive border removal with !important on all table elements

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 00:02:34 +01:00
04eba21521 Release version 1.2.3 - Admin UI styling improvements
Fixed two admin UI bugs:
- Applied borderless table styling to all tier/package tables for consistency
- Fixed checkbox tooltip display and improved checkbox-label spacing

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 21:06:25 +01:00
ef314e36bc Release version 1.2.2 - Admin UI bugfixes for variations
Fixed three bugs in variation pricing interface:
- Removed table borders for variation pricing to match WooCommerce UI style
- Added missing translations (Min Quantity, Price, Label) to all language files
- Fixed restrict_to_packages checkbox rendering in variation fields

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 20:53:23 +01:00
6733ca5f98 Release version 1.2.1 - Critical bugfixes for v1.2.0
Fixed two critical bugs introduced in v1.2.0:

1. Admin UI table structure mismatch - CSS still had flexbox styling from
   old template structure, breaking new table layout. Updated admin.css to
   properly style table rows with standard table cell padding.

2. Frontend pricing display not showing - Template was checking global
   enable settings before display. Removed those checks so pricing shows
   if configured on product AND display setting is enabled.

Files changed:
- wc-tier-and-package-prices.php - Version bump to 1.2.1
- composer.json - Version bump to 1.2.1
- CLAUDE.md - Updated version and documented fixes
- CHANGELOG.md - Added detailed v1.2.1 entry with root cause analysis
- assets/css/admin.css - Fixed table styling (removed flexbox)
- templates/frontend/pricing-table.twig - Removed global enable checks

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 20:28:28 +01:00
87784f467a Release version 1.2.0 - Add complete variable product support
This major feature release adds full support for WooCommerce variable products with variation-level pricing configuration.

## Key Features
- Each product variation can have independent tier and package pricing
- AJAX-based dynamic pricing table loading on variation selection
- Admin UI integrated into WooCommerce variation panels
- Full backward compatibility with existing simple product functionality
- WooCommerce Blocks compatibility maintained

## Implementation Highlights
- Effective ID pattern throughout codebase for variation handling
- Variation-specific meta boxes with field prefix support
- Template system updated to support both simple and variation products
- JavaScript enhancements for variation selector integration
- Cart logic updated to handle variation pricing correctly

## Files Changed
- Core: wc-tier-and-package-prices.php (version 1.2.0), composer.json
- Cart: includes/class-wc-tpp-cart.php (effective ID logic)
- Frontend: includes/class-wc-tpp-frontend.php (AJAX endpoint, variation detection)
- Admin: includes/class-wc-tpp-product-meta.php (variation hooks and methods)
- Templates: templates/admin/*.twig (field prefix support, table structure)
- JavaScript: assets/js/*.js (variation support)
- Documentation: CHANGELOG.md, README.md, CLAUDE.md

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 20:02:03 +01:00
1e6d86ca10 Release version 1.1.22 - UI improvements and bug documentation
- Increased width of label input fields in admin (short → regular)
- Documented double-install bug workaround in CHANGELOG
- Updated version to 1.1.22 across all files
- Created release package with proper exclusions

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 14:33:42 +01:00
f958c7b640 Release version 1.1.21 - Add multilingual support for Swiss locales
Added translations for Swiss German (formal and informal), Swiss French,
and Swiss Italian locales to support multilingual e-commerce in Switzerland.

New Features:
- Added de_CH (Swiss German - formal "Sie") translation
- Added de_DE_informal (Informal German - "du") translation
- Added fr_CH (Swiss French) translation
- Added it_CH (Swiss Italian) translation

Technical Changes:
- Created 4 new .po translation source files
- Compiled all .po files to .mo format for runtime use
- Updated version to 1.1.21 in plugin header and constant
- Updated composer.json version to 1.1.21
- Swiss locales use CHF currency formatting (e.g., "CHF 50.-")
- German informal translations use "du/dein" instead of "Sie/Ihr"

Documentation:
- Updated CHANGELOG.md with v1.1.21 release notes
- Updated CLAUDE.md with current version and translation status
- Marked roadmap item as completed in CLAUDE.md

Release Package:
- Created wc-tier-and-package-prices-1.1.21.zip (404 KB)
- Generated MD5 checksum: 16813b3ed0d1001d5f60194d61d36fc2
- Generated SHA256 checksum: e0063852a9ac23b1fd994471a2829f9dcbe26316f00ddee2d00f77c7c6a47c8f

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 01:44:41 +01:00
9b7638a7e2 Release version 1.1.19 - Enhanced duplicate detection
Fixed persistent duplicate settings page by improving duplicate detection
to check by class type and ID instead of strict instance comparison.

Issue:
- Strict instance comparison (===) failed to detect duplicates
- Different object instances of same class not caught by previous check
- Settings page still appearing twice despite singleton and instance caching

Solution:
- Changed duplicate detection from instance comparison to type/ID checks
- Added instanceof WC_TPP_Settings check
- Added get_id() method check for ID 'tier_package_prices'
- Added direct id property check as fallback
- Multiple layers of detection to catch duplicates regardless of how created

Fixes:
- Settings page rendering twice in WooCommerce backend
- Duplicate detection failing for different instances of same class

Changes:
- Enhanced add_settings_page() with multi-layer duplicate detection
- Checks: instanceof, get_id(), and id property
- Returns early if any existing page matches criteria

Technical Details:
- Strict comparison only works if exact same object instance
- Different instances (even of same class/ID) fail === check
- instanceof checks class type regardless of which instance
- ID checks ensure no duplicate pages with same identifier
- Fallback checks handle different WooCommerce versions/implementations

Updated Files:
- includes/class-wc-tpp-admin.php (enhanced duplicate detection)
- wc-tier-and-package-prices.php (version 1.1.19)
- composer.json (version 1.1.19)
- CHANGELOG.md (v1.1.19 section)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 23:33:12 +01:00
db9ba2bacd Release version 1.1.18 - Fix root cause of duplicate settings
Identified and fixed the actual root cause of duplicate settings page:
automatic instantiation in settings file being executed multiple times.

Root Cause Analysis:
- Settings file ended with: return new WC_TPP_Settings();
- File is in Composer's classmap for autoloading
- When autoloader loads class, it executes the entire file including instantiation
- Each include/autoload created a NEW instance despite admin singleton pattern
- Admin singleton prevented multiple admin instances but not multiple settings instances

The Fix:
- Removed automatic instantiation (return new) from settings file
- Settings file now only contains class definition
- Admin class explicitly creates instance: new WC_TPP_Settings()
- Changed from include to require_once to prevent multiple file loads
- Settings instance now created exactly once, when filter needs it

Fixes:
- Settings page rendering twice in WooCommerce backend
- Multiple WC_TPP_Settings instances being created
- Composer autoload triggering unintended instantiation

Changes:
- Removed line 145 from class-wc-tpp-settings.php (return new WC_TPP_Settings())
- Modified add_settings_page() to use require_once + explicit new
- Settings file now side-effect free, safe for autoloading

Technical Details:
- Composer classmap autoloader includes files when class is referenced
- Previous code had side effect (instantiation) on every include
- New code separates class definition from instantiation
- Instance creation now controlled explicitly by admin class
- require_once ensures file loaded once even if accessed multiple times

Updated Files:
- includes/class-wc-tpp-settings.php (removed return new line)
- includes/class-wc-tpp-admin.php (explicit instantiation)
- wc-tier-and-package-prices.php (version 1.1.18)
- composer.json (version 1.1.18)
- CHANGELOG.md (v1.1.18 section)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 23:29:35 +01:00
e46372da51 Release version 1.1.17 - Array duplicate prevention
Fixed persistent duplicate settings page by adding array-level duplicate
detection in addition to singleton pattern from v1.1.16.

Root Cause:
- WooCommerce calls woocommerce_get_settings_pages filter multiple times
- Even with singleton pattern, each filter call added settings instance to array
- Singleton prevented multiple class instances but not multiple array entries

Fixes:
- Settings page rendering twice despite singleton pattern in v1.1.16
- Filter adding same settings instance to array on repeated calls

Changes:
- Added duplicate detection loop in add_settings_page() before array append
- Uses strict comparison (===) to check if instance already in array
- Returns early if settings page already present, preventing duplicate

Technical Details:
- foreach loop iterates through existing $settings array
- Compares each element against cached self::$settings_instance
- Only appends to array if instance not found
- Complements singleton pattern with array-level protection
- Handles WooCommerce calling filter multiple times during page load

Updated Files:
- includes/class-wc-tpp-admin.php (added duplicate check in filter)
- wc-tier-and-package-prices.php (version 1.1.17)
- composer.json (version 1.1.17)
- CHANGELOG.md (v1.1.17 section)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 23:05:11 +01:00
2b2c06794b Release version 1.1.16 - Singleton pattern for settings page
Fixed persistent duplicate settings page rendering by implementing proper
singleton pattern for admin class and caching settings instance.

Fixes:
- Settings page still appearing twice despite v1.1.15 fix
- Multiple instantiation of WC_TPP_Admin class
- Duplicate creation of WC_TPP_Settings instances

Changes:
- Implemented singleton pattern for WC_TPP_Admin class
- Added private static $instance property with get_instance() method
- Made WC_TPP_Admin constructor private
- Added static $settings_instance property to cache settings page
- Modified add_settings_page() to check and reuse cached settings instance
- Changed instantiation from new WC_TPP_Admin() to WC_TPP_Admin::get_instance()

Technical Details:
- Ensures only one WC_TPP_Admin instance exists throughout plugin lifecycle
- Prevents duplicate filter registrations even if woocommerce_get_settings_pages called multiple times
- Settings page object created once and reused on subsequent filter calls
- Follows WordPress/WooCommerce best practices for singleton implementation

Updated Files:
- includes/class-wc-tpp-admin.php (singleton pattern implementation)
- wc-tier-and-package-prices.php (version 1.1.16)
- composer.json (version 1.1.16)
- CHANGELOG.md (v1.1.16 section)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 20:01:27 +01:00
959229b9d8 Release version 1.1.15 - Fix duplicate settings page
Fixed settings page appearing twice in WooCommerce settings due to double instantiation of WC_TPP_Settings class.

**Issue:**
- Settings page rendered twice on same page
- WC_TPP_Settings class instantiated twice: once automatically in settings file, once via admin class include

**Fix:**
- Removed conditional wrapper `if (class_exists('WC_TPP_Settings'))` from settings return statement
- Settings class now only instantiated when admin class includes the file via `return new WC_TPP_Settings();`
- Restored v1.1.2 pattern for settings file

**Files Modified:**
- includes/class-wc-tpp-settings.php (simplified return statement)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 19:39:20 +01:00
f0ab2ff755 Release version 1.1.14 - Restore plugin functionality
**CRITICAL FIX:** Restored plugin to working state after v1.1.8-1.1.13 were completely non-functional.

**Root Cause:**
- v1.1.8 moved class instantiation from individual files to init_classes() method
- v1.1.13 wrapped classes in class_exists() guards
- Combination prevented any classes from being instantiated
- Result: No settings, no frontend, no backend functionality

**Solution:**
- Reverted to v1.1.2 pattern (last working version)
- Each class file now instantiates itself with `new ClassName();`
- Removed init_classes() method and woocommerce_loaded hook
- All class_exists() guards remain for redeclaration protection

**What Now Works:**
 WooCommerce Settings → Tier & Package Prices tab
 Product edit pages show tier/package pricing meta boxes
 Frontend displays pricing tables on product pages
 Cart applies tier/package pricing correctly
 All plugin functionality fully operational

**Files Modified:**
- includes/class-wc-tpp-admin.php
- includes/class-wc-tpp-product-meta.php
- includes/class-wc-tpp-frontend.php
- includes/class-wc-tpp-cart.php
- wc-tier-and-package-prices.php (removed init_classes)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 19:32:47 +01:00
4dd9b3cd62 Release version 1.1.13 - Critical class redeclaration fixes
Fixed critical class redeclaration errors affecting all plugin functionality
in version 1.1.12. All plugin component classes now properly guarded.

**CRITICAL FIXES:**
- Plugin completely non-functional in v1.1.12 (no settings, no frontend, no backend)
- Fatal errors for WC_TPP_Admin, WC_TPP_Product_Meta, WC_TPP_Frontend, WC_TPP_Cart, WC_TPP_Settings classes
- All classes now wrapped in class_exists() checks

**Files Modified:**
- includes/class-wc-tpp-admin.php
- includes/class-wc-tpp-product-meta.php
- includes/class-wc-tpp-frontend.php
- includes/class-wc-tpp-cart.php
- includes/class-wc-tpp-settings.php

**Technical Details:**
- Completes comprehensive redeclaration protection started in v1.1.9-1.1.12
- All 2 functions, 4 constants, and 6 classes now protected
- Plugin activates successfully and all features functional
- Settings page, product meta boxes, frontend display, cart integration all working

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 19:02:18 +01:00
9dab123209 Release version 1.1.12 - Final redeclaration fix
Fixed critical class redeclaration error for WC_Tier_Package_Prices
affecting version 1.1.11. This completes all redeclaration protection
by protecting the main plugin class.

Fixes:
- Class redeclaration error for WC_Tier_Package_Prices
- Fatal error "Cannot redeclare class WC_Tier_Package_Prices" when plugin file loaded multiple times
- Plugin activation failures caused by class redeclaration

Technical Changes:
- Wrapped WC_Tier_Package_Prices class declaration in class_exists() check
- Completes comprehensive redeclaration protection for all plugin components
- All functions, constants, and classes now safely guarded against redeclaration
- Plugin now fully protected from all redeclaration scenarios

Protected Components:
- Functions: wc_tpp_woocommerce_missing_notice(), wc_tpp_init()
- Constants: WC_TPP_VERSION, WC_TPP_PLUGIN_DIR, WC_TPP_PLUGIN_URL, WC_TPP_PLUGIN_BASENAME
- Classes: WC_Tier_Package_Prices

Updated Files:
- wc-tier-and-package-prices.php (version 1.1.12, class protection)
- composer.json (version 1.1.12)
- CHANGELOG.md (v1.1.12 section)
- All translation files compiled (.mo files)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 18:52:34 +01:00
3f117ae519 Release version 1.1.11 - Complete redeclaration protection
Fixed critical constant redeclaration warnings/errors for all plugin
constants affecting versions 1.1.3-1.1.10. This completes comprehensive
protection against all redeclaration issues by protecting constants.

Fixes:
- Constant redeclaration warnings/errors for WC_TPP_VERSION, WC_TPP_PLUGIN_DIR, WC_TPP_PLUGIN_URL, WC_TPP_PLUGIN_BASENAME
- Potential errors when plugin constants already defined
- Plugin initialization failures caused by constant redeclaration

Technical Changes:
- Wrapped all define() calls in defined() checks
- Protected WC_TPP_VERSION, WC_TPP_PLUGIN_DIR, WC_TPP_PLUGIN_URL, WC_TPP_PLUGIN_BASENAME
- Prevents warnings/errors during WordPress plugin activation/deactivation cycles
- Comprehensive protection: all global functions and constants now safely guarded
- No more redeclaration issues possible

Updated Files:
- wc-tier-and-package-prices.php (version 1.1.11, all constants protected)
- composer.json (version 1.1.11)
- CHANGELOG.md (v1.1.11 section)
- All translation files compiled (.mo files)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 18:48:01 +01:00
58bbd5164f Release version 1.1.10 - Complete function redeclaration fix
Fixed critical function redeclaration error for wc_tpp_init() affecting
version 1.1.9. This completes the fix started in v1.1.9 by protecting
all global functions from redeclaration during plugin lifecycle events.

Fixes:
- Function redeclaration error for wc_tpp_init()
- Fatal error "Cannot redeclare function wc_tpp_init()" when plugin file loaded multiple times
- Plugin activation failures

Technical Changes:
- Wrapped wc_tpp_init() function in function_exists() check
- Both wc_tpp_woocommerce_missing_notice() and wc_tpp_init() now safely guarded
- Prevents fatal errors during WordPress plugin activation/deactivation cycles
- Comprehensive protection for all global function declarations

Updated Files:
- wc-tier-and-package-prices.php (version 1.1.10, wc_tpp_init safety check)
- composer.json (version 1.1.10)
- CHANGELOG.md (v1.1.10 section)
- All translation files compiled (.mo files)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 18:45:05 +01:00
cfdbfe1504 Release version 1.1.9 - Critical function redeclaration fix
Fixed critical function redeclaration error affecting versions 1.1.3-1.1.8
that caused fatal errors during plugin activation and deactivation.

Fixes:
- Function redeclaration error for wc_tpp_woocommerce_missing_notice()
- Fatal error "Cannot redeclare function" when plugin file loaded multiple times
- Plugin activation/deactivation failures

Technical Changes:
- Wrapped wc_tpp_woocommerce_missing_notice() in function_exists() check
- Moved function declaration before WooCommerce check for better organization
- Prevents fatal errors during WordPress plugin lifecycle events

Updated Files:
- wc-tier-and-package-prices.php (version 1.1.9, function safety check)
- composer.json (version 1.1.9)
- CHANGELOG.md (v1.1.9 section)
- All translation files compiled (.mo files)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 18:40:48 +01:00
e4e4de82cb Release version 1.1.8 - Critical activation fix
Fixed critical plugin activation error that was preventing the plugin from
being activated on WordPress 6.9.x and WooCommerce 10.x.

The issue was introduced in v1.1.3 when admin classes were still being
instantiated immediately at file include time, before WooCommerce was loaded.
While v1.1.6 fixed this for Frontend and Cart classes, the Admin and
Product Meta classes were missed.

Critical Fix:
- Removed immediate instantiation from WC_TPP_Admin class
- Removed immediate instantiation from WC_TPP_Product_Meta class
- Both classes now instantiated via woocommerce_loaded hook
- Ensures all WooCommerce hooks are available before registration

Technical Changes:
- Removed "new WC_TPP_Admin();" from class-wc-tpp-admin.php
- Removed "new WC_TPP_Product_Meta();" from class-wc-tpp-product-meta.php
- Added both classes to init_classes() method in main plugin file
- All four main classes now follow consistent initialization pattern

Impact:
- Plugin now activates correctly on all WordPress/WooCommerce versions
- Resolves fatal errors during plugin activation
- Last working version was v1.1.2, now fixed in v1.1.8

Updated Files:
- includes/class-wc-tpp-admin.php (removed auto-instantiation)
- includes/class-wc-tpp-product-meta.php (removed auto-instantiation)
- wc-tier-and-package-prices.php (version 1.1.8, init_classes updated)
- composer.json (version 1.1.8)
- CHANGELOG.md (v1.1.8 section added)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 00:24:12 +01:00
af532b56eb Release version 1.1.7 - Enhanced user experience features
Added three new customer-facing features to improve product page interaction
and tier pricing functionality.

Features:
- Optional text labels for tier pricing (similar to package labels)
- Clickable tier pricing table rows to auto-populate quantity field
- Add to Cart button auto-disables when quantity is 0 or less

Enhanced User Experience:
- Tier pricing rows now clickable with cursor pointer and hover animation
- Clicking tier row sets quantity and smoothly scrolls to quantity field
- Add to Cart button shows disabled state with reduced opacity
- Tier labels display below quantity in italic gray text

Technical Changes:
- Added optional 'label' field to tier pricing admin meta box
- Updated tier save logic to include label field (sanitized)
- Enhanced tier pricing frontend template to display labels
- Added click handler for tier pricing rows in frontend.js
- Added updateAddToCartButton() function to manage button state
- CSS: .wc-tpp-tier-label styling for tier labels
- CSS: Clickable cursor and hover transform for tier rows
- CSS: Disabled button styling (.single_add_to_cart_button:disabled)

Updated Files:
- templates/admin/tier-row.twig (added label field)
- includes/class-wc-tpp-product-meta.php (save label, template update)
- templates/frontend/tier-pricing-table.twig (display labels)
- assets/js/frontend.js (tier row clicks, button disable logic)
- assets/css/frontend.css (tier label style, clickable rows, disabled button)
- wc-tier-and-package-prices.php (version 1.1.7)
- composer.json (version 1.1.7)
- CHANGELOG.md (v1.1.7 section)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 00:15:48 +01:00
e40830b69b Release version 1.1.6 - Critical fix for plugin activation
Fixed critical bug that prevented plugin activation in v1.1.3, v1.1.4, and v1.1.5.

Root Cause:
- WC_TPP_Cart and WC_TPP_Frontend classes were instantiated immediately when
  their files were loaded (via `new ClassName();` at bottom of files)
- This happened BEFORE WooCommerce was fully loaded
- Hook registration attempted to access WooCommerce functions before they existed
- Result: Fatal error during plugin activation

Solution:
- Removed immediate instantiation from class-wc-tpp-cart.php (line 251)
- Removed immediate instantiation from class-wc-tpp-frontend.php (line 186)
- Added init_classes() method to main plugin class
- Classes now instantiated via woocommerce_loaded hook
- Ensures WooCommerce is fully initialized before any hooks are registered

Changes:
- includes/class-wc-tpp-cart.php - Removed `new WC_TPP_Cart();`
- includes/class-wc-tpp-frontend.php - Removed `new WC_TPP_Frontend();`
- wc-tier-and-package-prices.php - Added init_classes() and woocommerce_loaded hook
- CHANGELOG.md - Added v1.1.6 section
- composer.json - Version 1.1.6
- All translation files updated to 1.1.6
- All .mo files recompiled

This fix ensures proper WordPress plugin lifecycle:
1. Plugin file loaded
2. Classes defined (but not instantiated)
3. WooCommerce loads
4. woocommerce_loaded hook fires
5. Classes instantiated with full WooCommerce availability

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:57:27 +01:00
9765c5f119 Release version 1.1.5 - Critical bug fix for plugin activation
CRITICAL FIX: Resolved fatal error that prevented plugin activation in
versions 1.1.3 and 1.1.4. The add_cart_quantity_css() method was attempting
to access WooCommerce cart object during wp_head action, causing failures
when WooCommerce wasn't fully initialized or on admin pages.

Fixes:
- Plugin activation error in v1.1.3 and v1.1.4
- Fatal error when WooCommerce cart object not available
- Frontend errors on admin pages
- Issues during plugin initialization

Technical Changes:
- Added function_exists('WC') check before accessing WooCommerce
- Added is_admin() check to prevent CSS injection on admin pages
- Enhanced add_cart_quantity_css() with proper guards
- Line 191: if (!function_exists('WC') || !WC()->cart || is_admin())

Root Cause:
The add_cart_quantity_css() method (added in v1.1.3) hooks into wp_head
but didn't properly check if WooCommerce cart was available, causing
errors during plugin activation and on admin pages.

Updated Files:
- includes/class-wc-tpp-cart.php (enhanced error checking)
- wc-tier-and-package-prices.php (version 1.1.5)
- composer.json (version 1.1.5)
- CHANGELOG.md (v1.1.5 section)
- All translation files (.pot, .po, .mo) updated to version 1.1.5

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:49:24 +01:00
88e30d028c Release version 1.1.4 - WooCommerce Blocks support and improved styling
Added comprehensive WooCommerce Blocks support for quantity restrictions
and improved "View Options" button styling to match standard WooCommerce
Add to Cart buttons.

Features:
- WooCommerce Blocks cart/mini-cart quantity restriction support
- Store API integration for block-based carts
- Improved "View Options" button styling with WooCommerce standards
- Enhanced hover effects and transitions

Technical Changes:
- Added woocommerce_store_api_product_quantity_editable filter
- Added block_quantity_editable() method in WC_TPP_Cart class
- Enhanced CSS for .wc-block-components-quantity-selector targeting
- Updated button styling: padding (0.618em × 1em), font-weight (700)
- Added transition effects for smooth hover states

Fixed:
- WooCommerce blocks cart quantity selector now properly hidden
- WooCommerce blocks mini-cart quantity selector visibility
- "View Options" button now matches Add to Cart button appearance

Updated Files:
- includes/class-wc-tpp-cart.php (WooCommerce Blocks support)
- assets/css/frontend.css (enhanced button styling)
- wc-tier-and-package-prices.php (version 1.1.4)
- composer.json (version 1.1.4)
- CHANGELOG.md (v1.1.4 section)
- All translation files (.pot, .po, .mo) updated to version 1.1.4

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:33:34 +01:00
d55ada7924 Release version 1.1.3 - Cart quantity visibility fix
Fixed persistent cart quantity input visibility issues for products with
package quantity restrictions. Enhanced implementation ensures quantity
inputs are properly hidden in both main cart and mini-cart/sidebar.

Fixes:
- Cart quantity inputs now properly hidden with increased filter priority
- Mini-cart quantity inputs correctly replaced with read-only text
- Added fallback CSS injection to handle theme/plugin conflicts
- Enhanced DOM targeting with data attributes and multiple CSS selectors

Technical Changes:
- Increased filter priority to 999 for woocommerce_cart_item_quantity
- Added woocommerce_widget_cart_item_quantity filter for mini-cart support
- Added add_cart_quantity_css() method for dynamic CSS injection
- Added maybe_hide_mini_cart_quantity_input() method
- Enhanced quantity spans with data-product-id attribute
- Added wc-tpp-restricted-qty CSS class
- Implemented sibling (+) and general sibling (~) CSS selectors

Updated Files:
- includes/class-wc-tpp-cart.php (enhanced with mini-cart support)
- wc-tier-and-package-prices.php (version 1.1.3)
- composer.json (version 1.1.3)
- CHANGELOG.md (v1.1.3 section)
- All translation files (.pot, .po, .mo) updated to version 1.1.3

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:19:18 +01:00
4ece4dd69e Release version 1.1.2 - Catalog button modification
Enhanced package quantity restriction enforcement by replacing "Add to Cart"
buttons with "View Options" links on catalog pages for products with
quantity restrictions. This prevents customers from attempting to add
restricted products directly from shop/category pages.

Changes:
- Added catalog button modification for restricted products
- Implemented "View Options" button with eye icon styling
- Created has_quantity_restriction() helper method
- Extended CSS loading to all WooCommerce pages
- Added modify_catalog_add_to_cart_button() filter method
- Updated translations with 2 new strings (en_US, de_DE, de_CH_informal)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:04:41 +01:00
3e06137559 Release version 1.1.1 - Cart quantity field hiding
Enhanced package quantity restriction enforcement by hiding the cart
quantity input field when restrictions are enabled. This prevents
customers from modifying quantities in the cart to bypass package
restrictions.

Changes:
- Added cart quantity input hiding for restricted products
- Implemented woocommerce_cart_item_quantity filter hook
- Created maybe_hide_cart_quantity_input() method in WC_TPP_Cart
- Fixed cart quantity bypass vulnerability
- Cart displays quantity as read-only text for restricted products

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 17:21:40 +01:00
e0a32821ee Release version 1.1.0 - Package quantity restriction feature
Added comprehensive package quantity restriction functionality that allows
limiting product purchases to predefined package sizes only.

Features:
- Global setting to enable package quantity restrictions
- Per-product override for quantity restrictions
- Automatic hiding of quantity input field when restricted
- Frontend validation with package selection UI
- Server-side cart validation
- User-friendly error messages
- Complete translations for all supported languages

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 15:54:04 +01:00
dea2c5f0b3 Release version 1.0.2
- Migrate settings to WooCommerce Settings page
- Add WC_TPP_Settings class for proper WooCommerce integration
- Remove standalone settings submenu
- Improve UX with native WooCommerce settings UI
2025-12-21 05:14:19 +01:00
7273c9cde7 Release version 1.0.1
- Add Twig template engine integration
- Migrate all templates to Twig format
- Add German (Switzerland, Informal) translation
- Improve template organization and security
- Add Composer dependency management
- Create comprehensive changelog
2025-12-21 04:56:50 +01:00