actualizer / order-surcharges
Actualize: Order Surcharges - Adds surcharges like logistic fees and cash on delivery fees to the cart
Package info
github.com/actualizer/ActOrderSurcharges
Type:shopware-platform-plugin
pkg:composer/actualizer/order-surcharges
Requires
- php: >=8.3
- shopware/core: >=6.6.10 <6.8.0
README
A Shopware 6 plugin that automatically adds configurable surcharges to the shopping cart, including logistic fees and cash on delivery charges with dynamic payment method detection.
Features
- Automatic logistic surcharge for all orders
- Cash on delivery (COD) fee based on payment method selection
- Dynamic surcharge calculation with proper tax handling
- Automatic cart cleanup when items are removed
- Payment method change detection and fee adjustment
- Configurable surcharge amounts through admin panel
- Multi-language support (German & English)
- Compatible with Shopware 6.6.10 - 6.7.x
Requirements
- Shopware 6.6.10 or higher (up to 6.7.x)
- PHP 8.3 or higher
Installation
Via Composer (recommended)
composer require actualizer/order-surcharges bin/console plugin:refresh bin/console plugin:install --activate ActOrderSurcharges bin/console cache:clear
Manual
- Download or clone this plugin into your
custom/plugins/directory - Install and activate the plugin via CLI:
bin/console plugin:refresh bin/console plugin:install --activate ActOrderSurcharges bin/console cache:clear
Configuration
- Go to Admin Panel → Settings → System → Plugins
- Find "Actualize: Order Surcharges" and click on the three dots
- Click "Config" to access plugin settings
Configuration Options
Logistic Surcharge
- Active: Enable/disable the logistic surcharge
- Logistic Surcharge Amount: Fixed amount added to all orders (default: 4.95 €)
Cash on Delivery Fee
- Active: Enable/disable COD fees
- COD Fee Amount: Fee amount for cash on delivery payments (default: 5.95 €)
Tax Settings
- Default Tax Rate: Tax rate used when no other rate can be determined (default: 19.0%)
How it works
Logistic Surcharge
- Automatic Addition: Added to cart when at least one regular product is present
- Cart Cleanup: Automatically removed when cart becomes empty
- Tax Calculation: Uses appropriate tax rate based on cart contents or configuration
Cash on Delivery Fee
- Payment Detection: Monitors payment method selection for COD variants
- Dynamic Addition: Fee added when COD payment method is selected
- Automatic Removal: Fee removed when different payment method is chosen
- Language Support: Detects various COD payment method names (Nachnahme, Cash on Delivery, COD)
Tax Handling
- Inherits tax rate from existing cart products
- Falls back to context tax rules
- Uses configured default tax rate as final fallback
- Proper tax calculation with Shopware's tax system
Technical Details
Architecture
- Uses
CartProcessorInterfacefor clean cart integration SalesChannelContextSwitchEventfor payment method change detection- Line items with unique IDs (
logistic-surcharge,cod-fee) - Proper price definitions with tax calculations
Payment Method Detection
Detects COD payments by checking payment method names for:
nachnahme(German)cash on delivery(English)cod(abbreviation)
Development
Building/Testing
After making changes:
bin/console cache:clear bin/console theme:compile
Debugging
- Check cart contents in browser developer tools
- Monitor Shopware logs for surcharge-related events
- Test payment method changes in checkout process
Usage Examples
Standard Shopping Cart
- Customer adds products to cart
- Logistic surcharge automatically added
- Total price includes surcharge + tax
Cash on Delivery Order
- Customer proceeds to checkout
- Selects COD payment method
- COD fee automatically added to cart
- Changes to different payment → COD fee removed
Empty Cart Handling
- Customer removes all products
- All surcharges automatically removed
- Clean cart state maintained
Compatibility
- Shopware Version: 6.6.10 - 6.7.x
- PHP Version: 8.3+
- Payment Methods: Compatible with all standard Shopware payment providers
- Tax Systems: Works with all Shopware tax configurations
Support
For issues and feature requests, please use the GitHub issue tracker.
License
This plugin is licensed under the MIT License - see the LICENSE file for details.
Credits
Developed by Actualize
Made with ❤️ for the Shopware Community