Extra Fees
Extra fees are cart-level charges applied on top of orderline pricing. They are used for things like rush fees, minimum order surcharges, handling fees, or conditional charges based on customer type or cart contents.
Where to configure
Admin → Shipping → Extra Fees.
Key rules
There can be more than one extra fee on a site.
Extra fees are ordered, and they are evaluated in sequence — this matters when one fee's result should affect another. For example, if you have both a rush fee and a minimum order value fee, the rush fee should run first so that the minimum value calculation includes the rush amount.
Orderline discounts are calculated before extra fees. This means
orderlines_discountis available inside the extra fee formula. Discounts never apply to extra fees themselves.Extra fees are ignored (not added to the cart) if the formula produces a blank value, zero, or a negative value.
Pixfizz bills extra fees in the same way as regular orderline transaction fees — they appear as standard line items in the billing file.
Formula basics
Extra fee formulas use the same Ruby expression syntax as product pricing formulas, but with a restricted set of variables:
orderlines_total
Sum of all orderline prices in the cart (after discounts)
orderlines_discount
Total discount applied to orderlines
These are the only pricing variables available. You do not have access to quantity, units, pages, or any other product-level variables — extra fees operate at the cart level, not the orderline level.
Liquid in extra fee formulas
A key difference from product pricing formulas: extra fee formulas support Liquid. The Liquid is evaluated first, and whatever it outputs is then evaluated as a Ruby pricing expression. This lets you make fees conditional on cart state, user properties, or custom fields.
Available Liquid variables
cart
Yes
With restrictions — see below
user
Yes
Full access
website
Yes
Full access
Cart properties that do NOT work in extra fee formulas
These properties are excluded because they can depend on extra fees (circular dependency):
cart.totalcart.shippingcart.discountcart.shipping_discountcart.tax
Cart properties that DO work
cart.orderlines_totalcart.orderlines_discountAll non-pricing properties:
cart.custom,cart.orderlines,cart.address,cart.shipping_option,cart.promocode_code, etc.
Shopper template codes
On Shopper-based sites, the following extra fee codes are recognised out of the box by the cart and checkout templates:
rush— rush/expedited processing feemin-order— minimum order surcharge
Using these codes means the fee will display correctly in the cart summary without any custom snippet work. If you use a different code, you may need to add custom display logic.
Examples
Percentage rush fee
Charge 20% of the net orderline value when the customer selects rush processing. The fee is conditional on a cart custom field called rush:
If the custom field is not set, the Liquid outputs blank and the fee is skipped.
Rush fee with a minimum floor
Same as above, but the rush fee is at least $10 — whichever is greater between 25% of the net value or the $10 floor:
For a $30 cart this returns $10.00 (the floor). For a $60 cart this returns $15.00 (25%).
Minimum order surcharge
Charge a fee that brings small orders up to a $5 minimum. Uses cart.orderlines_total in the Liquid condition to check the cart value, then returns the difference using the Ruby pricing variable:
If the cart contains $3.50 of products, this returns $1.50. If the cart is at or above $5, the Liquid outputs blank and the fee is not applied.
Tiered rush fee by service level
When you offer multiple rush tiers (e.g. standard rush vs same-day), use a cart custom field with distinct values rather than a simple boolean:
Stepped rush fee by cart value
Charge a flat rush fee that scales with order size in fixed tiers rather than as a percentage:
Note the use of {%- (whitespace-trimming) on the inner conditions to ensure the formula output is clean. The outer {% if %} / {% endif %} guard ensures the fee is only applied when rush is selected.
Fee based on user category
Charge a $5 handling fee, but waive it for wholesale users:
Combined: rush fee + minimum order surcharge (ordering matters)
This requires two separate extra fees configured in the correct order in the admin:
Extra Fee 1 — Rush Fee (code: rush, runs first):
Extra Fee 2 — Minimum Order Surcharge (code: min-order, runs second):
Because the rush fee runs first, its value is included before the minimum order check evaluates. The ordering in the admin controls the sequence.
Note: Confirm with Matjaz whether
orderlines_totalin the second fee includes the result of the first fee, or whether it always reflects the pre-extra-fee orderline total. This matters when stacking fees that depend on each other.
Displaying extra fees on the storefront
Extra fees appear on the cart and order via cart.extra_fees / order.extra_fees, which returns an array of ExtraFee objects:
extra_fee.name
Fee name (as configured in admin)
extra_fee.code
Fee code
extra_fee.is_taxable
true if the fee is subject to tax
extra_fee.amount
Fee amount — use the currency filter
Last updated