Commit Graph

12 Commits

Author SHA1 Message Date
f26574aa4b Release version 1.2.8 - Currency display and data deletion fixes
Fixed two important bugs reported in v1.2.7:

Bug 1: Currency Symbol Missing in Admin Headers and Placeholders
- Table headers now show "Price (CURRENCY)" instead of just "Price"
- Input placeholders include currency symbol (e.g., "9.99 $")
- Better UX for multi-currency stores

Bug 2: Variation Pricing Data Not Deleted Properly (Critical)
- Empty pricing arrays were being saved instead of deleted
- Fixed save logic to check if arrays are empty after filtering
- Properly deletes post meta when all entries are removed
- Affects simple products, variable parents, and variations

Technical changes:
- Updated all table headers with currency symbol display
- Modified all render methods to pass currency_symbol to templates
- Updated Twig templates to use currency in placeholders
- Fixed save_tier_package_fields() and save_variation_pricing_fields()
- Added !empty() checks before update_post_meta() calls

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 01:23:55 +01:00
e5aca708cc Release version 1.2.7 - Fix v1.2.6 regressions (both issues still not working)
Fixed both critical issues that were not resolved in v1.2.6:

1. Variable Product Forms Still Not Showing (Critical)
   - v1.2.6 used wrong hook (woocommerce_product_options_pricing)
   - That hook only fires for simple products, not variable products
   - Changed to woocommerce_product_options_general_product_data
   - This hook fires for all product types after general tab
   - Forms now appear correctly for variable product parents

2. Table Headers Still Visible When Empty (Critical)
   - CSS :has() pseudo-class wasn't working reliably
   - Implemented JavaScript + CSS class approach instead
   - Added updateTableHeaders() function that toggles has-rows class
   - Headers hide by default, show only when table has rows
   - Function called on page load and after all add/remove operations
   - Works across all browsers without modern CSS requirements

Changed files:
- includes/class-wc-tpp-product-meta.php - Fixed WooCommerce hook
- assets/css/admin.css - Class-based header visibility
- assets/js/admin.js - Added updateTableHeaders() and parent handlers

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 00:48:46 +01:00
78101baf88 Release version 1.2.6 - Critical bugfixes for v1.2.5 features
Fixed two critical issues that prevented v1.2.5 features from working:

1. Parent Product Pricing Forms Not Visible (Critical)
   - Variable products were missing admin UI for parent pricing configuration
   - v1.2.5 implemented backend logic but forgot the admin forms
   - Added add_variable_parent_pricing_fields() method
   - Modified existing methods to skip variable products (simple only)
   - Parent pricing now fully functional with matching UI

2. Table Headers Not Hiding When Empty
   - CSS sibling selector ~ doesn't work when thead comes before tbody
   - Removed incorrect selector, kept only :has() pseudo-class
   - Added !important flag for proper specificity
   - Modern browser support (Chrome 105+, Firefox 121+, Safari 15.4+)

Changed files:
- includes/class-wc-tpp-product-meta.php - Added parent pricing forms
- assets/css/admin.css - Fixed header hiding CSS
- wc-tier-and-package-prices.php - Version 1.2.6
- composer.json - Version 1.2.6
- CHANGELOG.md - Detailed release notes

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 00:38:29 +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
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
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
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
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
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