Container deposit by bottle size, without tags
Last updated: September 23, 2026
When the deposit depends on the container size, store each variant's volume in a number metafield such as custom.volume_ml and let one per-product Formula fee pick the rate: if(mf("custom.volume_ml") >= 750, 0.10, 0.05) * qty. Six 1-liter bottles pay 0.60, six 330 ml cans 0.30, and no size tags are needed.
The rule in FlexiFees
| Setting | Value |
|---|---|
| Fee title | Container deposit |
| Scope | Per product fee |
| Fee type | Formula |
| Formula | if(mf("custom.volume_ml") >= 750, 0.10, 0.05) * qty (example rates and threshold) |
| SKU | DEPOSIT |
| Condition | Product category is one of Beverages (Shopify taxonomy) |
= 750, 0.10, 0.05) * qty and a Try it result of 0.60 for six 1 liter bottles" width="760" height="759" loading="lazy">
Set it up
- In your Shopify admin, go to Settings > Metafields and metaobjects, choose Variants, add a metafield definition
custom.volume_mlwith the Integer or Decimal type, and select Storefronts. - Enter the volume in milliliters on each variant: 330, 500, 1000.
- Create a per-product Formula fee with the formula above and a product condition for your beverages.
- Use Try it on a real product to check a can and a bottle before you publish.
Watch out: products without a volume
A missing metafield counts as 0, and 0 is below 750, so a product without a volume still pays the lower rate. Either fill the volume on every product the conditions select, or make missing values pay nothing: if(mf("custom.volume_ml") >= 750, 0.10, if(mf("custom.volume_ml") > 0, 0.05, 0)) * qty.
Use a plain number, not a volume type
FlexiFees reads a unit-type metafield as the number it is stored with, without converting units: 0.75 liters reads as 0.75, 750 milliliters as 750. A number metafield with the unit in its name (volume_ml or volume_oz) avoids mixing units.
Real deposit rates
The rates above are examples. Deposit amounts and size thresholds come from each scheme: California's CRV, for instance, uses 24 ounces as its size threshold (see the CRV guide for the current rates and official source); German Pfand depends on the container type (see the Pfand guide). Check the scheme that applies to you. Not tax or legal advice.
Related
Questions
Can one fee charge different deposits by container size?
Yes. Store the volume per variant in a number metafield and use a Formula fee with if() to pick the rate.
What happens to products without a volume?
A missing metafield counts as 0. With the basic formula they pay the lower rate; add if(mf("custom.volume_ml") > 0, 0.05, 0) to charge them nothing.