magdev 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
2025-12-21 04:56:50 +01:00
2025-12-21 04:56:50 +01:00
2025-12-21 04:56:50 +01:00

WooCommerce Tier and Package Prices

THIS PROJECT IS 100% VIBE-CODED USING CLAUDE.AI

A powerful WooCommerce plugin that adds tier pricing and package pricing functionality to your products with configurable quantities at fixed prices.

Features

Tier Pricing (Volume Discounts)

  • Set quantity-based pricing tiers
  • Automatic discounts when customers buy in larger quantities
  • Display savings percentage and amount
  • Dynamically updates price based on quantity selected

Package Pricing

  • Create fixed-price packages with specific quantities
  • Example: 10 pieces for $50, 25 pieces for $100
  • Custom labels for packages (e.g., "Starter Pack", "Value Bundle")
  • One-click package selection on product pages

Admin Features

  • Easy-to-use product meta boxes for adding tiers and packages
  • Global settings page under WooCommerce menu
  • Configure display position (before/after add to cart, after price)
  • Enable/disable tier or package pricing independently
  • Sortable pricing rules

Frontend Features

  • Beautiful pricing tables on product pages
  • Responsive design for mobile devices
  • Visual highlighting of active tier/package
  • Real-time price updates when quantity changes
  • Cart integration with proper price calculations
  • Clear pricing indicators in cart

Installation

  1. Upload the wc-tier-and-package-prices folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Make sure WooCommerce is installed and activated

Configuration

Global Settings

Navigate to WooCommerce > Tier & Package Prices to configure:

  • Enable Tier Pricing: Turn on/off volume discounts
  • Enable Package Pricing: Turn on/off fixed-price packages
  • Display Pricing Table: Show/hide pricing tables on product pages
  • Display Position: Choose where to show pricing tables

Product Settings

When editing a product, scroll to the Product data panel:

  1. Click on the General tab
  2. Scroll down to find Tier Pricing and Package Pricing sections

Adding Tier Pricing

  1. Click "Add Tier" button
  2. Set minimum quantity (e.g., 10)
  3. Set price per unit (e.g., 9.99)
  4. Add more tiers as needed
  5. Tiers are automatically sorted by quantity

Example:

  • 1-9 items: $12.00 each (regular price)
  • 10-24 items: $10.00 each (tier 1)
  • 25-49 items: $8.50 each (tier 2)
  • 50+ items: $7.00 each (tier 3)

Adding Package Pricing

  1. Click "Add Package" button
  2. Set exact quantity (e.g., 10)
  3. Set fixed price for that quantity (e.g., 99.99)
  4. Optionally add a custom label (e.g., "Starter Pack")
  5. Add more packages as needed

Example:

  • Package 1: 10 pieces for $95 (labeled "Small Bundle")
  • Package 2: 25 pieces for $200 (labeled "Value Pack")
  • Package 3: 50 pieces for $350 (labeled "Business Pack")

How It Works

Price Calculation Priority

  1. Package Price (highest priority): If the exact quantity matches a package, the package price applies
  2. Tier Price: If no package match, the highest applicable tier price is used
  3. Regular Price: If no tier or package applies, the regular product price is used

Frontend Display

  • Pricing tables show all available tiers and packages
  • Current tier/package is highlighted based on selected quantity
  • Prices update dynamically when quantity changes
  • Package buttons allow one-click quantity selection

Cart Behavior

  • Correct prices are applied in the cart
  • Cart shows whether tier or package pricing is applied
  • Subtotals are calculated correctly
  • Compatible with WooCommerce checkout process

File Structure

wc-tier-and-package-prices/
├── wc-tier-and-package-prices.php    # Main plugin file
├── includes/
│   ├── class-wc-tpp-admin.php        # Admin settings
│   ├── class-wc-tpp-product-meta.php # Product meta boxes
│   ├── class-wc-tpp-frontend.php     # Frontend display
│   └── class-wc-tpp-cart.php         # Cart price calculations
├── assets/
│   ├── css/
│   │   ├── admin.css                 # Admin styles
│   │   └── frontend.css              # Frontend styles
│   └── js/
│       ├── admin.js                  # Admin JavaScript
│       └── frontend.js               # Frontend JavaScript
└── README.md

Requirements

  • WordPress 6.0 or higher (tested up to 6.9.x)
  • WooCommerce 8.0 or higher (tested up to 10.x)
  • PHP 7.4 or higher

Compatibility

  • WooCommerce 10.x: Fully compatible with the latest WooCommerce release
  • WordPress 6.9.x: Tested and verified with WordPress 6.9.x
  • HPOS (High-Performance Order Storage): Full support for WooCommerce Custom Order Tables
  • Block-based Themes: Compatible with modern WordPress block themes
  • Multisite: Works on WordPress multisite installations

Frequently Asked Questions

Q: Can I use both tier pricing and package pricing on the same product? A: Yes! Package pricing takes priority when the exact quantity matches.

Q: What happens if a customer changes the quantity in the cart? A: The price will automatically recalculate based on the new quantity.

Q: Can I set different tiers for different products? A: Yes, each product can have its own tier and package pricing configuration.

Q: Does this work with variable products? A: Currently, this plugin is designed for simple products. Variable product support may be added in future versions.

Support

For bug reports and feature requests, please use the plugin's support forum or contact the developer.

License

This plugin is licensed under the GPL v2 or later.

Changelog

Version 1.0.0 - 2025-12-21

Compatibility Updates

  • Updated for WooCommerce 10.x compatibility
  • Updated for WordPress 6.9.x compatibility
  • Added HPOS (High-Performance Order Storage) support
  • Declared compatibility with WooCommerce Custom Order Tables

Security Enhancements

  • Added nonce verification for product meta save operations
  • Added capability checks for user permissions
  • Enhanced data escaping and sanitization
  • Implemented autosave prevention

Code Improvements

  • Enhanced cart object validation
  • Improved product object type checking
  • Better error handling for edge cases
  • Updated data storage methods for cart items
  • Modernized JavaScript localization with proper escaping

Initial Features

  • Initial release with tier pricing functionality
  • Package pricing with fixed quantities
  • Customizable pricing tables
  • Global settings page
  • Product-level configuration
  • Cart integration with dynamic pricing
  • Responsive frontend design

Credits

Developed by Marco Graetsch for WooCommerce store owners who need flexible pricing options.

Description
WooCommerce plugin for tier pricing and package prices
Readme 1.5 MiB
Release 1.4.1 Latest
2026-02-03 10:55:57 +00:00
Languages
PHP 76.6%
JavaScript 13.2%
CSS 5.7%
Twig 4.5%