Pricing Formula Guide
Pixfizz Pricing Formula Mega-Guide
Complete reference for product, variant, and option pricing
Overview
Pixfizz pricing is powered by Ruby expressions evaluated at runtime on:
Products
Product attributes
Variants / options
Variant values
Price variables
Pricing formulas can range from:
Simple static pricing
Page-based pricing
Quantity-based pricing
Tiered volume discounting
Sheet-based production pricing
Combined formulas (pages × quantity × tiers)
Price variable–driven pricing systems
This guide documents all supported pricing patterns, using real-world Pixfizz examples.
Where Pricing Lives in Pixfizz
Pricing formulas can be defined in:
Product Attributes →
PriceVariants → Value price fields
Variant Values
Price Variables
Option pricing (add-ons / upgrades)
All formulas are evaluated per orderline, unless explicitly using units logic.
Core Variables You Can Use
Quantity & Units
quantity
Quantity for this orderline only
units
Quantity aggregated across orderlines (legacy behavior)
⚠️ Prefer
quantityunless you explicitly want cross-orderline pricing
Page-Based Variables (Books / Multipage Products)
pages
Total pages in the project
extra_pages
Pages above template minimum
uncounted_pages
Pages excluded from pricing
Cut Print / Photo Print Variables
cut_print_quantity
Quantity derived from per-photo UI
pages
Often reused as “prints” in sheet logic
Price Variables (Admin → Price Variables)
Price variables are custom-defined constants, for example:
⚠️
whitelabelis not a system variable — it is a custom price variable
Simple Static Pricing
Fixed Price
Used when pricing never changes.
Page-Based Pricing
Base Price + Per-Page Increment
Example: $19.99 base for 16 pages, +$0.50 every 2 pages
Using extra_pages
Uses the template’s minimum page count automatically.
Accounting for Uncounted Pages
Quantity-Based Pricing (Per Orderline)
Simple Unit Price × Quantity
Tiered Quantity Pricing (Per Orderline)
Volume Discounting (Unit Price Changes by Quantity)
Example: Postcards / Prints
Combining Page Pricing + Volume Discounts
Photobook with Volume Discounts
Sheet-Based Production Pricing
Charging by Print Sheets (Not Individual Items)
Example:
12 postcards per sheet
First sheet: $10
Each additional sheet: $8
Why This Works
pages= number of postcards.ceilensures partial sheets are chargedReflects actual production cost
Pack-Based Pricing (e.g. Greeting Cards)
Price per Pack (10 cards per pack)
Quantity dropdown must enforce multiples of 10.
Incremental Unit Pricing
First Unit Expensive, Rest Cheaper
First unit = $10
Each additional unit = $3
Flat Pricing up to a Threshold
Example: Layflat Books
$49 covers up to 50 pages
Every additional 4 pages = $2.50
Using Price Variables (Advanced, Recommended)
Example: Hardcover Book with Whitelabel Multiplier
Variant / Option Upgrade Pricing
Example: Paper Upgrade
Best Practices
✅ Prefer clarity over cleverness
✅ Use price variables for maintainability
❌ Do not assume
unitsunless needed❌ Do not “optimize” Ruby at the expense of readability
✅ Copy known-working patterns
Common Pitfalls
Unexpected discounts
Use quantity instead of units
Page math breaks
Always use decimals (12.0)
Whitelabel confusion
Remember it’s a custom price variable
Partial sheet undercharging
Use .ceil
Last updated