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:

  1. Check first priority source
  2. If price found → use it and stop
  3. If no price → check next priority source
  4. 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.00

When 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.00

When 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:

  1. Bulkgood Price / Product & Country
  2. Bulkgood Price / Product
  3. 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:

  1. Table Rate
  2. Bulkgood Price / Product & Country
  3. 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:

  1. Bulkgood Price / Product
  2. 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 error

Multiple Products in Cart

When multiple bulkgood products are in the cart:

  1. Each product is evaluated using the priority system
  2. The first available price for each product is collected
  3. 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:

  1. Stores >Configuration > Sales > Shipping Methods > Table Rates
  2. Set Enable Bulkgood Price Logging = Yes
  3. Clear cache
  4. Perform a test checkout
  5. 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.00

Common 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

Found an issue with this documentation? Let us know