Amasty Cash on Delivery Plugin
The Amasty Cash on Delivery (COD) plugin integrates Amasty's Cash on Delivery Fee extension with Mage2Plenty, ensuring that COD fees are properly exported to PlentyONE as part of order totals and accounting.
Overview
Package: softcommerce/module-plenty-amasty-cash-on-delivery
Category: Amasty Integrations
License: OSL-3.0 / AFL-3.0
Status: Production Ready
Features
- COD Fee Export: Exports cash on delivery fees as separate order line items
- Fee Calculation: Synchronizes calculated COD fees based on Amasty rules
- Payment Method Integration: Automatically detects COD payment method usage
- Accounting Accuracy: Ensures fees are properly included in order totals
- Multi-Currency: Supports COD fees in multiple currencies
- Tax Handling: Correctly handles tax calculation on COD fees
Use Cases
Standard COD Order
Scenario: Customer selects Cash on Delivery payment method
Order Details:
- Subtotal: $100.00
- Shipping: $10.00
- COD Fee: $5.00
- Grand Total: $115.00
Plugin Action:
- Detects COD payment method
- Exports COD fee as separate line item
- Includes fee in order total calculation
- Synchronizes to PlentyONE accounting
Variable COD Fees
Scenario: COD fee varies based on order value
Amasty Rule:
- Orders under $50: $5.00 COD fee
- Orders $50-$100: $3.00 COD fee
- Orders over $100: $2.00 COD fee
Plugin Action:
- Applies correct fee based on order value
- Exports calculated fee amount
- Maintains fee calculation logic
- Ensures accurate accounting
International COD
Scenario: Different COD fees for different countries
Order Details:
- Domestic order: $3.00 COD fee
- International order: $8.00 COD fee
Plugin Action:
- Detects shipping destination
- Applies country-specific COD fee
- Exports correct fee amount
- Handles currency conversion if needed
Requirements
Magento Extensions
- Amasty Cash on Delivery Fee (
amasty/cashondelivery) - Required
Mage2Plenty Modules
softcommerce/module-plenty-order-profile- Required for order export
System Requirements
- Magento 2.4.4 - 2.4.8
- PHP 8.1 - 8.4
- Mage2Plenty connector installed and configured
Installation
Via Composer
# Install the plugin
composer require softcommerce/module-plenty-amasty-cash-on-delivery
# Run Magento setup
bin/magento setup:upgrade
bin/magento cache:flush
# For production (optional)
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
Verify Installation
# Check module status
bin/magento module:status SoftCommerce_PlentyAmastryCashOnDelivery
# Should show as enabled
Configuration
This plugin works automatically once installed. It integrates with your existing order export and payment method configuration.
Default Behavior
The plugin automatically:
- Detects when COD payment method is used
- Retrieves COD fee amount from order totals
- Adds COD fee as order line item during export
- Includes fee in grand total calculation
- Synchronizes with PlentyONE accounting
Payment Method Mapping
Ensure your COD payment method is properly mapped:
- Navigate to Stores → Configuration → Mage2Plenty → Payment Configuration
- Map Magento COD method to PlentyONE payment method
- Verify COD fees are included in payment mapping
How It Works
Order Export Flow with COD
Order Placed with COD
↓
Payment Method = COD? → No → Normal export
↓ Yes
Plugin Activated
↓
Retrieve COD Fee Amount
↓
Add Fee as Line Item
↓
Update Order Totals
↓
Export to PlentyONE
Data Mapping
| Magento Data | PlentyONE Field | Notes |
|---|---|---|
| COD Fee Amount | Order Total | Added to grand total |
| Fee Item | Line Item | Exported as service fee |
| Payment Method | Payment ID | COD method mapping |
| Tax on Fee | Tax Total | If fee is taxable |
Troubleshooting
COD Fee Not Exported
Problem: Cash on delivery fee missing from PlentyONE order
Solutions:
-
Verify plugin is enabled:
bin/magento module:status SoftCommerce_PlentyAmastryCashOnDelivery -
Check Amasty COD extension is installed:
bin/magento module:status Amasty_CashOnDelivery -
Verify COD fee was applied in Magento order:
- View order in Admin
- Check Order Totals section
- Confirm COD fee line exists
-
Review order export logs:
tail -f var/log/softcommerce/plenty/order.log
Incorrect Fee Amount
Problem: COD fee amount wrong in PlentyONE
Solutions:
-
Verify Amasty COD configuration:
- Stores → Configuration → Amasty → Cash on Delivery
- Check fee calculation rules
- Verify fee amounts
-
Check order totals in Magento match expected fee
-
Review currency conversion settings if multi-currency
-
Ensure no conflicts with other fee/discount extensions
Fee Missing from Total
Problem: Order total doesn't include COD fee in PlentyONE
Solutions:
- Verify order export profile includes all totals
- Check that fee is added before export trigger
- Review order data in export logs
- Ensure PlentyONE order type accepts service fees
- Check payment method mapping configuration
Tax Calculation Issues
Problem: Tax on COD fee calculated incorrectly
Solutions:
-
Verify Amasty COD tax configuration:
- Check if fee should be taxable
- Verify tax class assignment
- Confirm tax calculation rules
-
Review Magento tax configuration
-
Check PlentyONE tax settings
-
Ensure tax rates are synchronized
-
Verify order tax totals in both systems
Best Practices
COD Configuration
- Clear Fee Rules: Set transparent, easy-to-understand COD fee rules
- Customer Communication: Display COD fees clearly during checkout
- Reasonable Fees: Keep fees competitive and justifiable
- Country-Specific: Consider different fees for different regions
Order Processing
- Test Orders: Process test COD orders before going live
- Verify Totals: Always verify order totals match between systems
- Monitor Fees: Regularly review COD fee collection
- Reconciliation: Periodic reconciliation of COD fees in accounting
Multi-Store Setup
- Store-Specific Fees: Configure appropriate fees per store view
- Currency Handling: Ensure fees convert correctly in all currencies
- Regional Rules: Apply country/region-specific COD policies
- Testing: Test COD in all store views and currencies
Common Scenarios
Scenario 1: Fixed COD Fee
Configuration: $5.00 flat COD fee
Order Value: $75.00
Shipping: $10.00
COD Fee: $5.00
Export: Order total $90.00 with $5.00 service fee line item
Scenario 2: Percentage-Based Fee
Configuration: 3% of order value as COD fee
Order Value: $100.00
COD Fee: $3.00
Export: Order total $103.00 with calculated percentage fee
Scenario 3: Tiered Fee Structure
Rule: Orders under $50 = $5, $50-$100 = $3, over $100 = $2
Order Value: $120.00
Applied Fee: $2.00
Export: Correct tier-based fee included in order
Related Plugins
Amasty Suite
- Amasty Gift Card - Gift card integration
- Amasty Promo - Promotional items
- Amasty Rewards - Reward points
Order Export
- Order Export Profile - Configure order synchronization
- Payment Configuration - Payment method mapping
Support
Getting Help
If you encounter issues:
- 📧 Email: support@softcommerce.co.uk
- 📞 Phone: +44 2080 587 795 (GMT working hours)
- 🐛 Bug Reports: GitHub Issues
Source Code
- Location:
/packages/modules/module-plenty-amasty-cash-on-delivery - License: OSL-3.0 / AFL-3.0
- Contributions: Welcome via pull requests
Version Information
Check current version:
composer show softcommerce/module-plenty-amasty-cash-on-delivery
Related Documentation
- Free Plugins Overview - All available plugins
- Order Export Profile - Order synchronization setup
- Payment Configuration - Payment method setup
- Troubleshooting Orders - Order sync issues