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>
10 KiB
WooCommerce Tier and Package Prices - Release 1.1.2
Release Date: December 21, 2025 Version: 1.1.2 Package Size: 405 KB Git Tag: v1.1.2
Download
File: wc-tier-and-package-prices-1.1.2.zip
Checksums
SHA256:
40ffd29ebc6af635f689472040acd220ae1c8df2f0d852fab4b43ce0fb5fe739
MD5:
eee69fcf391b3f3df9380306ffb31b1b
What's New in 1.1.2
This is a patch release that completes the package quantity restriction feature by preventing catalog page add-to-cart attempts for restricted products.
New Features
- Catalog "View Options" Button - NEW
- "Add to Cart" buttons replaced with "View Options" links on shop/category/archive pages
- Eye icon (Dashicons) styling for visual distinction
- Direct link to product page for package selection
- Prevents customer confusion from attempting invalid cart additions
Enhanced User Experience
- Products with quantity restrictions now clearly indicate "View Options" instead of "Add to Cart"
- Customers are guided to product page where they must select a valid package
- No more failed add-to-cart attempts from catalog pages
- Consistent restriction enforcement across all touchpoints
Technical Improvements
- Added
has_quantity_restriction()static helper 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 - Updated CSS loading to all WooCommerce pages (shop, cart, checkout, product)
- New CSS classes:
wc-tpp-view-options,wc-tpp-cart-quantity,wc-tpp-restriction-notice
What's Changed
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
Translations
- Added 2 new translatable strings:
- "View Options" → "Optionen ansehen" (German)
- "View options for %s" → "Optionen für %s ansehen" (German)
- Updated all translations (en_US, de_DE, de_CH_informal)
- Compiled all .mo files with new strings
Installation
New Installation
- Download the ZIP file:
wc-tier-and-package-prices-1.1.2.zip - Log in to your WordPress admin panel
- Navigate to Plugins > Add New > Upload Plugin
- Choose the downloaded ZIP file
- Click Install Now
- After installation, click Activate Plugin
- Go to WooCommerce > Settings > Tier & Package Prices to configure
Upgrade from 1.1.1
This is a patch release with improved user experience. No configuration changes needed.
Steps:
- Deactivate version 1.1.1
- Upload and activate version 1.1.2
- All existing settings and data will be automatically preserved
- No additional configuration required
Upgrade from 1.1.0 or Earlier
Safe to upgrade directly. This version includes all features from v1.1.0 and v1.1.1 plus catalog button enhancements.
Steps:
- Deactivate the current version
- Upload and activate version 1.1.2
- All existing settings and data will be automatically preserved
- Review the package restriction features if desired
Requirements
- WordPress: 6.0 or higher
- PHP: 7.4 or higher
- WooCommerce: 8.0 or higher
Complete Package Restriction Feature (v1.1.0 + v1.1.1 + v1.1.2)
The package quantity restriction feature now provides complete enforcement across all customer touchpoints:
Catalog Pages (v1.1.2 - NEW)
- ✅ "View Options" button instead of "Add to Cart" for restricted products
- ✅ Eye icon for visual distinction
- ✅ Direct link to product page
- ✅ Prevents invalid add-to-cart attempts from shop/category pages
Product Page (v1.1.0)
- ✅ Quantity field automatically hidden when restriction enabled
- ✅ "Choose a package size below" notice displayed
- ✅ Visual package selection with highlighted states
- ✅ JavaScript validation prevents form submission without package selection
Add to Cart Validation (v1.1.0)
- ✅ Server-side validation on add-to-cart
- ✅ User-friendly error messages showing available package sizes
- ✅ Prevents manual quantity manipulation via form fields
Cart Page (v1.1.1)
- ✅ Quantity field hidden/replaced with read-only text
- ✅ Prevents cart quantity modification
- ✅ Consistent restriction enforcement
- ✅ No bypass via cart updates
Settings
- ✅ Global setting to enable restrictions site-wide
- ✅ Per-product override for individual products
- ✅ Located in: WooCommerce > Settings > Tier & Package Prices
User Flow Comparison
Before v1.1.2
Shop Page: "Add to Cart" button → Result: Ajax add fails with error OR quantity validation error
After v1.1.2
Shop Page: "View Options" button → Product Page: Select package → Add to Cart: Success
The improved flow eliminates customer confusion and failed add-to-cart attempts.
Use Cases
Scenario 1: Bulk-Only Product Catalog
Enable restriction globally. Shop pages show "View Options" for all products.
Customer Experience:
- Browse shop → See "View Options" on bulk products
- Click "View Options" → Product page opens
- Select from available packages (e.g., 100, 250, 500 units)
- Add to cart → Success with no errors
Scenario 2: Mixed Catalog
Some products restricted, others not. Shop page shows appropriate buttons.
Customer Experience:
- Browse shop → See mix of "Add to Cart" and "View Options"
- Regular products: "Add to Cart" works normally
- Restricted products: "View Options" → Product page → Package selection
Scenario 3: Sample Pack Products
Products sold only in fixed sample packs.
Customer Experience:
- Browse samples → All show "View Options"
- Click button → Product page shows package choices
- Select "Starter Pack (10)", "Trial Pack (25)", or "Full Pack (50)"
- Quantity cannot be modified in cart
Modified Files in 1.1.2
Core Files Updated
wc-tier-and-package-prices.php- Version updated to 1.1.2composer.json- Version updated to 1.1.2CHANGELOG.md- Added v1.1.2 section
PHP Classes Modified
includes/class-wc-tpp-frontend.php- Added catalog button modification methods
CSS Files Modified
assets/css/frontend.css- Added.wc-tpp-view-optionsbutton styling, eye icon
Translation Files Updated
languages/wc-tier-package-prices.pot- Version updated to 1.1.2, 2 new stringslanguages/wc-tier-package-prices-en_US.po- Version updated, 2 new stringslanguages/wc-tier-package-prices-de_DE.po- Version updated, 2 new stringslanguages/wc-tier-package-prices-de_CH_informal.po- Version updated, 2 new strings- All
.mofiles recompiled
Complete Feature Set
Tier Pricing
- ✅ Quantity-based discount tiers
- ✅ Automatic price calculation
- ✅ Volume discount display
Package Pricing
- ✅ Fixed-price bundles
- ✅ Custom package labels
- ✅ Multiple package options per product
- ✅ Quantity restriction to packages only (v1.1.0)
- ✅ Cart quantity enforcement (v1.1.1)
- ✅ Catalog button modification (v1.1.2 - NEW)
Admin Features
- ✅ WooCommerce Settings integration
- ✅ Easy-to-use product meta boxes
- ✅ Configurable display positions
- ✅ Native WooCommerce UI
- ✅ Global restriction setting
- ✅ Per-product restriction override
Frontend Features
- ✅ Beautiful pricing tables (Twig templates)
- ✅ Real-time cart updates
- ✅ Responsive design
- ✅ 3 languages supported
- ✅ Package-only selection mode
- ✅ Automatic quantity field hiding (product page & cart)
- ✅ Visual package selection
- ✅ Read-only cart quantity display
- ✅ Catalog "View Options" button (NEW)
Validation & Security
- ✅ Client-side JavaScript validation
- ✅ Server-side cart validation
- ✅ Cart quantity bypass prevention
- ✅ Catalog add-to-cart prevention (NEW)
- ✅ User-friendly error messages
- ✅ WooCommerce HPOS compatible
Breaking Changes
None. This release is fully backward compatible with v1.1.1, v1.1.0 and v1.0.x.
Migration Notes
From 1.1.1
- No migration needed
- Catalog button changes are automatic when restrictions are enabled
- No new settings or configuration required
From 1.1.0 or Earlier
- All v1.1.1 and v1.1.2 features included automatically
- New restriction features are disabled by default
- Must be explicitly enabled in settings
Settings Location
All settings remain in: WooCommerce > Settings > Tier & Package Prices
Data Preservation
- All existing tier pricing data preserved
- All existing package pricing data preserved
- All product meta data preserved
- No database changes required
Known Limitations
Current Version
- Restriction only works when packages are defined
- Cannot restrict to tier quantities (only packages)
- Restriction applies to entire product (no variation-level control)
- Cart quantity is read-only text (not a dropdown of package options)
- "View Options" button uses standard WooCommerce button styling
Future Enhancements
These features may be added in future versions:
- Customizable "View Options" button text
- Cart package quantity dropdown selector
- Variation-level restriction control
- Restrict to tier quantities option
- Minimum/maximum package selection limits
Changelog Summary
Version History
- v1.1.2 (2025-12-21) - Catalog button modification
- v1.1.1 (2025-12-21) - Cart quantity bypass fix
- v1.1.0 (2025-12-21) - Package quantity restriction feature
- v1.0.2 (2025-12-21) - WooCommerce Settings integration
- v1.0.1 (2025-12-21) - Twig template engine integration
- v1.0.0 (2025-12-21) - Initial release
Support
- Documentation: See README.md and CHANGELOG.md
- Previous Release: See RELEASE-INFO-1.1.1.md
- Issues: https://src.bundespruefstelle.ch/wc-tier-package-prices/issues
- Author: Marco Graetsch
License
GPL v2 or later - https://www.gnu.org/licenses/gpl-2.0.html
Production Ready: This package includes optimized autoloader and no development dependencies.
Recommended Update: Version 1.1.2 is recommended for all users to provide the best customer experience when using package quantity restrictions. The catalog button modification eliminates customer confusion and failed add-to-cart attempts.