Configure Your Mailer Logic Rules

    PLUGINLOGIX – MAILER LOGIC User Guide & Configuration Manual
    Version: 1.0 Brand: PluginLogix Website: pluginlogix.com

    A complete guide to configuring Mailer Types, Item Types, Capacity Matrix, Packing Rules, and Conditional Capacity Rules for automated mailer selection in WooCommerce.

    1. Introduction

    Mailer Logic by PluginLogix automatically selects the correct mailer (envelope, box, tube, etc.) based on the items in a customer’s cart. This guide explains every setting in simple, everyday language — no technical knowledge required.

    • The types of items (Raw Comic, CGC Slab, Comic Set, etc.)1
    • The weight of each item (per-unit weight you set)
    • The maximum weight each mailer can safely hold
    • Your Packing Rules (e.g., “always use Large if CGC Slab is present”)
    • Your Conditional Capacity Rules (e.g., “if CGC Slab is in the cart, limit comics to 4 in Medium Mailer”)

    This keeps shipping accurate, safe, and consistent — no manual guesswork.

    2. How It Works – Step by Step

    1. Customer adds products → each product is matched to an Item Type using its Shipping Class.
    2. The system calculates the total weight = (number of units × per-unit weight for each Item Type).
    3. The system checks Conditional Capacity Rules (these can override normal limits).
    4. The system compares the total weight against each mailer’s Max weight.
    5. Packing Rules apply any overrides (e.g., force a specific mailer).
    6. The system selects the best combination of mailers that:
      • Never exceeds Max weight for any mailer
      • Respects all rules and limits
      • Uses the fewest mailers possible

    Important: The system will never put items into a mailer if it would exceed the Max weight — even if “it looks like it should fit.”

    3. Key Settings You Control

    A. Mailer Types
    This is where you define your actual mailers (containers).

    Fields:

    • Label (e.g., Small Comic Mailer, Large Box)
    • Max weight (e.g., 1.0 kg) — the absolute maximum weight the mailer can hold safely
    • Enabled (checkbox)

    Tip: Set Max weight slightly lower than real-world capacity to leave room for tape, bubble wrap, etc.

    B. Item Types
    This defines how each product category behaves.

    Fields:

    • Label (e.g., Raw Comic, CGC Slab)
    • Shipping Class (must be unique!)
    • Per-unit weight (e.g., 0.15 kg for a single comic)

    Important rule: Each Item Type must have a unique Shipping Class. If two Item Types share the same class, the system treats them as one — causing wrong packing.

    C. Capacity Matrix (Old / Legacy – Still Used if No Weight Rules Apply)
    This table says “how many of each Item Type fit in each Mailer” (in capacity units, not weight).

    Note: If you’re using the new weight system, the Capacity Matrix is now secondary — weight limits take priority.

    D. Packing Rules
    These are powerful overrides. This is the core of the packing engine.

    Examples:

    • “If CGC Slab present → force CGC Box”
    • “If total weight > 2 kg → prefer Large Box”
    • “If more than 10 comics → disable Small Mailer”

    Packing Rules override normal logic based on conditions.
    Examples:
    “If cart contains a CGC Slab → always use CGC Box.”
    “If more than 10 comics → use Medium Mailer.”
    “If Magazine present → do not use Small Mailer.”
    Use these for exceptions or special cases.

    Rules are applied in the order shown in the table (use the drag handle ☰ to re-order).

    E. Conditional Capacity Rules

    These rules override the matrix only when certain items are present.

    Examples:

    • “If CGC Slab in cart → limit Raw Comics to 4 in Medium Mailer”
    • “If Magazine present → limit Raw Comics to 0 in Small Mailer”

    These are very useful for protecting fragile or incompatible items.


    4. Common Real-World Examples

    Example 1 – 1 single comic → Uses Small Comic Mailer (light weight, fits easily).

    Example 2 – 1 CGC Slab + 4 comics → CGC Slab → CGC Slab Box (forced rule) → 4 comics → Small or Medium (depending on weights and rules)

    Example 3 – 1 CGC Slab + 12 comics → CGC Slab Box for slab → Comics split into Medium + Large (or whatever fits under Max weight)

    Example 4 – Heavy order (total weight 3.5 kg) → System uses Large Box or multiple mailers — never exceeds any Max weight.

    Mailer \ ItemRaw ComicMagazineCGC Slab
    Small Mailer320
    Medium Mailer640
    CGC Box001

    5. Real‑World Scenarios (Basic)

    Scenario A — 2 Comics
    Small Mailer (capacity 3) is selected.
    Scenario B — 5 Comics
    Medium Mailer (capacity 6) is selected.
    Scenario C — 1 CGC Slab + 2 Comics
    CGC Box + Small Mailer.
    Scenario D — 1 Magazine + 1 Comic
    Small Mailer.

    6. Real‑World Scenarios (Advanced)

    These examples demonstrate the full power of Mailer Logic.
    Scenario E — Mixed Order With Fragile Item
    Cart:
    1 CGC Slab
    4 Raw Comics
    1 Magazine

    Rules:
    Slab cannot mix with comics or magazines
    Comics + magazines can mix
    Medium Mailer holds 6 units
    Result:
    CGC Slab → CGC Box
    Comics + Magazine → Medium Mailer
    Two mailers total

    Scenario F — Oversized Magazine Forces Larger Mailer
    Cart:
    1 Oversized Magazine
    2 Raw Comics

    Matrix:
    Small Mailer cannot hold Oversized Magazine
    Medium Mailer can
    Result:
    Entire order → Medium Mailer

    Scenario G — High Quantity Auto‑Upgrade
    Cart:
    12 Raw Comics

    Matrix:
    Small Mailer: 3
    Medium Mailer: 6
    Large Mailer: 12
    Result:
    Large Mailer selected

    Scenario H — Conditional Capacity Rule Prevents Mixing
    Rule: “If Magazine present → limit Raw Comics to 0 in Small Mailer.”
    Cart:
    1 Magazine
    1 Raw Comic
    Result:
    Medium Mailer selected

    Scenario I — Multi‑Mailer Split Logic
    Cart:
    7 Raw Comics
    7 Bagged & Boarded Comics

    Matrix:
    Small Mailer: 3 units
    Medium Mailer: 6 units
    Result:
    7 Raw Comics → Medium Mailer (6) + Small Mailer (1)
    7 Bagged & Boarded → Medium Mailer (6) + Small Mailer (1)
    Four mailers total

    Scenario J — Rule‑Driven Priority Mailer
    Rule: “If cart contains a Signed Comic → force Gemini Mailer.”

    Cart:
    1 Signed Comic
    2 Raw Comics
    Result:
    Gemini Mailer selected

    7. Best Practices

    • Set realistic per-unit weights (test with a scale if possible)
    • Set Max weight slightly below real carrier limits (safety buffer)
    • Use unique Shipping Classes for every Item Type
    • Put “must-do” rules (force mailer) at the top of the Packing Rules table
    • Test every major change with real cart examples
    • Keep rules simple — too many can conflict

    8. Troubleshooting

    Problem: Items not matching the correct Item Type Solution: Check the product’s shipping class.
    Problem: Wrong mailer selected Solution: Review the matrix and packing rules.
    Problem: Items mixing incorrectly Solution: Add a Conditional Capacity Rule.

    9. Glossary

    Item Type: Category of product
    Mailer Type: Container used for shipping
    Shipping Class: Identifier linking product → Item Type
    Capacity Unit: Weight/size value
    Matrix: Table defining how many items fit
    Packing Rule: Overrides normal logic
    Conditional Rule: Overrides matrix when certain items are present

    10. Visual Diagram (Flowchart)

    [Customer Adds Products]
                  ↓
    [Match Products to Item Types]
       (via Shipping Class)
                  ↓
    [Apply Conditional Capacity Rules]
                  ↓
    [Calculate Total Capacity Units]
                  ↓
    [Compare Against Capacity Matrix]
                  ↓
    [Apply Packing Rules (Overrides)]
                  ↓
    [Select Best Mailer(s)]
                  ↓
    [Output Shipping Method]

    11. FAQ

    Q1: Why did it use a Large mailer for just one comic? A: This can happen if:

    • Small/Medium mailers are disabled by a Packing Rule
    • Their Max weight is set too low for even one comic
    • A Conditional Capacity Rule forces Large when certain items are present Check your Packing Rules and Max weight settings.

    Q2: Why didn’t it add more comics to the Large mailer with the CGC Slab?
    A: The Large mailer is already close to (or at) its Max weight after adding the slab. The system refuses to exceed Max weight for safety.

    Q3: I changed a rule, but nothing changed in the cart. A: Common reasons:

    • The rule condition doesn’t match (e.g., “Total units == 2” but cart has 3)
    • Another rule higher in the table overrides it (drag rules to reorder)
    • Changes weren’t saved (rules save to wc_mailer_logic_rules_table)
    • Cache — clear site cache or test in incognito mode

    Q4: What does “Max weight” actually mean? A: It’s the absolute maximum safe weight for that mailer (including tape/bubble wrap). The system will never exceed it — even if the carrier allows more.

    Q5: Can I force certain items to stay together? A: Yes — use Packing Rules (“force this mailer if these items present”) or Conditional Capacity Rules (“limit other items when X is present”).

    Q6: Why multiple mailers instead of one? A: Usually because:

    • Adding more would exceed Max weight
    • A rule prevents mixing (e.g., slabs can’t mix with comics)
    • Capacity limits are reached

    Q7: How do I test changes without placing real orders? A: Add items to cart → go to cart page → inspect mailers added (visible in cart or checkout review). No order needed.

    Shopping Cart