You've already forked wc-tier-and-package-prices
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>
6.4 KiB
6.4 KiB
Changelog
All notable changes to WooCommerce Tier and Package Prices will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.1.3] - 2025-12-21
Fixed
- Cart quantity input visibility issue in cart and cart sidebar for restricted products
- Enhanced filter priority (999) to ensure quantity hiding runs after other plugins
- Mini-cart quantity input now properly hidden for restricted products
Added
woocommerce_widget_cart_item_quantityfilter support for mini-cartadd_cart_quantity_css()method for dynamic CSS injectiondata-product-idattribute to quantity spans for targeted CSS selectors- CSS class
wc-tpp-restricted-qtyfor improved targeting
Technical
- Increased filter priority from 10 to 999 for
woocommerce_cart_item_quantity - Added
maybe_hide_mini_cart_quantity_input()method in WC_TPP_Cart class - Dynamic CSS injection via
wp_headaction as fallback - Used both sibling (+) and general sibling (~) CSS selectors for DOM variations
[1.1.2] - 2025-12-21
Added
- Catalog "View Options" button for products with quantity restrictions
- Automatic button replacement in shop/category/archive pages
- Eye icon (Dashicons) for "View Options" button styling
Changed
- "Add to Cart" button replaced with "View Options" link on catalog pages for restricted products
- CSS now loads on all WooCommerce pages (shop, cart, checkout, product)
- Catalog buttons now direct to product page instead of adding to cart
Technical
- Added
has_quantity_restriction()static method in WC_TPP_Frontend class - Added
modify_catalog_add_to_cart_button()method in WC_TPP_Frontend class - Extended
woocommerce_loop_add_to_cart_linkfilter hook - CSS classes:
wc-tpp-view-options,wc-tpp-cart-quantity,wc-tpp-restriction-notice - Updated
enqueue_scripts()to load CSS on all WooCommerce pages
Translations
- Added 2 new translatable strings
- Updated all translations (en_US, de_DE, de_CH_informal)
- Compiled all .mo files with new strings
[1.1.1] - 2025-12-21
Added
- Cart quantity field hiding when package restriction is enabled
- Automatic read-only quantity display in cart for restricted products
Changed
- Cart quantity input replaced with plain text when restrictions apply
- Enhanced cart display to prevent quantity modification for restricted products
Fixed
- Cart quantity bypass vulnerability for package-restricted products
Technical
- Added
maybe_hide_cart_quantity_input()method in WC_TPP_Cart class - Extended
woocommerce_cart_item_quantityfilter hook - CSS class
wc-tpp-cart-quantityfor styled quantity display
[1.1.0] - 2025-12-21
Added
- Package quantity restriction feature
- Global setting to restrict quantities to defined package sizes
- Per-product setting to restrict quantities to defined package sizes
- Frontend validation preventing non-package quantities
- Server-side cart validation for package quantities
- User-friendly error messages showing available package sizes
- Automatic quantity field hiding when restriction is enabled
- Package selection UI with highlighted states
Changed
- Enhanced package pricing display template with restriction mode support
- Improved JavaScript to handle restricted mode package selection
- Updated frontend to show "Choose a package size below" notice in restricted mode
Technical
- Added
validate_package_quantity()method in WC_TPP_Cart class - Added
maybe_hide_quantity_input()method in WC_TPP_Frontend class - Extended
woocommerce_add_to_cart_validationfilter hook - Added
wc-tpp-restricted-modeCSS class for styling - New product meta:
_wc_tpp_restrict_to_packages - New global option:
wc_tpp_restrict_package_quantities
Translations
- Added 7 new translatable strings
- Updated all translations (en_US, de_DE, de_CH_informal)
- Compiled all .mo files with new strings
[1.0.2] - 2025-12-21
Changed
- Migrated settings to WooCommerce Settings page as dedicated tab
- Settings now appear under WooCommerce > Settings > Tier & Package Prices
- Improved integration with WooCommerce native settings API
Added
- WC_TPP_Settings class extending WC_Settings_Page
- Better integration with WooCommerce settings system
- Consistent UI with other WooCommerce settings tabs
Removed
- Standalone settings submenu (WooCommerce > Tier & Package Prices)
- Custom settings template (templates/admin/settings-page.twig)
Technical
- Implemented WooCommerce settings filter hook (woocommerce_get_settings_pages)
- Uses WC_Admin_Settings for rendering and saving
- Automatic settings persistence via WooCommerce API
[1.0.1] - 2025-12-21
Added
- Twig template engine integration for all templates
- Template loader class with WordPress integration
- German (Switzerland, Informal) translation (de_CH_informal)
- Composer dependency management
- Comprehensive translation support in Twig templates
- Template caching support (disabled in debug mode)
Changed
- Migrated all PHP templates to Twig format (.twig)
- Improved template organization and separation of concerns
- Enhanced security with automatic HTML escaping in templates
- Updated composer.json with complete package metadata
Removed
- Old PHP template files (replaced with Twig)
Technical
- Added Twig v3.22.2 dependency
- Created WC_TPP_Template_Loader class for centralized template rendering
- Integrated WordPress functions (__(), e(), esc*, wc_price()) into Twig
- Added Swiss German localization with informal address form
- Organized templates into admin/ and frontend/ directories
[1.0.0] - 2025-12-21
Added
- Initial release
- Tier pricing functionality (quantity-based discounts)
- Package pricing functionality (fixed-price bundles)
- Admin settings page for plugin configuration
- Product meta boxes for configuring tier and package prices
- Frontend pricing tables display
- Cart integration for automatic price calculation
- WooCommerce HPOS compatibility
- Multilingual support with text domain
- German (Germany) translation (de_DE)
- English (US) translation (en_US)
Features
- Volume discounts based on quantity thresholds
- Fixed-price packages with custom labels
- Configurable display positions (before/after cart button, after price)
- Real-time price updates in cart
- Responsive pricing tables
- Admin-friendly interface for price management