Priority-Based Pricing System
The priority system determines which pricing source is used when multiple sources are configured for a bulkgood product.
How Priority Works
The system checks pricing sources in the order you configure and uses the first available price:
- Check first priority source
- If price found → use it and stop
- If no price → check next priority source
- Repeat until price found or all sources exhausted
Available Pricing Sources
1. Bulkgood Price / Product & Country
Product Attribute: bulkgood_price_per_country
Country-specific prices defined at the product level. The system matches the destination country from the shipping address.
Example:
Product: Industrial Pallet Country Prices: - DE (Germany): €45.00 - FR (France): €50.00 - US (USA): $65.00When to use: International stores with varying freight costs by region.
2. Bulkgood Price / Product
Product Attribute: bulkgood_price
Global price defined at the product level, applies to all destinations.
Example:
Product: Heavy Machinery Bulkgood Price: $150.00When to use: Flat-rate bulkgood shipping regardless of destination.
3. Table Rate
Database Table: shipping_tablerate (with bulkgood=1)
Magento's standard table rate shipping extended with a bulkgood flag. Rates can be based on:
- Weight
- Price
- Number of items
- Destination
When to use: Complex shipping matrices based on multiple factors.
Configuration
Location: Stores > Configuration > Sales > Shipping Methods > Table Rates > Bulkgood Price Source Priority
Drag and drop to reorder the priority list.
Priority Examples
Example 1: Country-First Strategy
Priority:
- Bulkgood Price / Product & Country
- Bulkgood Price / Product
- Table Rate
Scenario:
- Product A has country price for Germany (€45) and global price (€50)
- Customer in Germany → €45 (country-specific)
- Customer in France → €50 (falls back to global)
- Customer in Japan → Table rate (no product prices defined)
Example 2: Table Rate First
Priority:
- Table Rate
- Bulkgood Price / Product & Country
- Bulkgood Price / Product
Scenario:
- Table rates configured for all major destinations
- Product prices as fallback for uncovered regions
- Customer in covered region → Table rate
- Customer in uncovered region → Product price
Example 3: Global Only
Priority:
- Bulkgood Price / Product
- Table Rate
Scenario:
- Simple flat-rate strategy
- Table rate as fallback for non-bulkgood items
- All bulkgood products use global price
Priority Decision Flow
Start Checkout ↓ Is product bulkgood? → No → Use normal shipping ↓ Yes Check Priority #1 ↓ Price found? → Yes → Use this price → Apply calculation method → Done ↓ No Check Priority #2 ↓ Price found? → Yes → Use this price → Apply calculation method → Done ↓ No Check Priority #3 ↓ Price found? → Yes → Use this price → Apply calculation method → Done ↓ No Fallback to €0 or errorMultiple Products in Cart
When multiple bulkgood products are in the cart:
- Each product is evaluated using the priority system
- The first available price for each product is collected
- The calculation method (Sum/Highest/Lowest/Average) is applied to all collected prices
Example:
- Product A: Country price €50 (Priority #1)
- Product B: Global price €40 (Priority #2, no country price)
- Product C: Table rate €30 (Priority #3, no product prices)
- Calculation Method: Sum
- Final Price: €50 + €40 + €30 = €120
Best Practices
1. Most Specific First
Place the most specific pricing source first:
1. Country-Specific (most specific) 2. Global Product (medium specificity) 3. Table Rate (least specific, catch-all)2. Always Have a Fallback
Ensure at least one pricing source covers all scenarios to avoid €0 shipping costs.
3. Use Table Rates for Complex Logic
For weight-based or tiered pricing, use table rates as the primary source.
4. Country-Specific for International
For international B2B, prioritize country-specific pricing to handle varying freight costs.
Debugging Priority
Enable logging to see which priority source was selected:
- Stores >Configuration > Sales > Shipping Methods > Table Rates
- Set Enable Bulkgood Price Logging = Yes
- Clear cache
- Perform a test checkout
- Check
var/log/system.log
Log Example:
[INFO] Start debugging MageB2B_Bulkgood... [INFO] Bulkgood Configuration Settings: [INFO] Bulk Price Source Priority: [{"source":"bulkgood_price_product_per_country"},{"source":"bulkgood_price_product"},{"source":"table_rate"}] [INFO] Product: Industrial Pallet (SKU: IND-001) is a bulkgood item [INFO] Bulkgood Price / Product & Country: 45.00 [INFO] Bulkgood Price / Product: 50.00 [INFO] Selected Bulkgood Price / Product & Country: 45.00 [INFO] Final Price: 45.00Common Issues
Issue: Wrong price source selected
Solution: Check priority order and verify product attributes are set correctly
Issue: €0 shipping cost
Solution: Ensure at least one pricing source has a value for all scenarios
Issue: Priority not applying
Solution: Clear configuration cache: php bin/magento cache:clean config
Related Topics
- Calculation Methods - How prices are aggregated
- Country Pricing - Setting up country-specific prices
- Table Rate Setup - Configuring table rates
