The board / Operating
Plyco discount app
Quantity breaks, trade tiers and flash sales, settled at checkout by one rule: best price wins.
Rails
- aloneReadsProducts, customers and carts from Shopify.
- aloneWritesPrice rules, the audit log, and the discount on every checkout.
- aloneMoneySets the price the customer pays.
- alonePublicQuantity breaks show on product pages and in Google Shopping.
- aloneUnattendedThe checkout function runs on every order, alone.
- a person, on exceptionsDecidesStaff set the rules and can roll an import back.
Problem
Off-the-shelf discount apps stack rules in surprising ways and hide quantity pricing from Google Shopping. A timber retailer needs public price breaks, trade tiers and the odd flash sale without three apps fighting at the till.
One rule had to settle every argument at checkout, and it had to run inside Shopify's sandbox, fast.
System
Decisions
- The checkout function is Rust compiled to a 127 KB WASM module. JavaScript through Javy failed first, so the pricing logic moved to Rust.
- Best price wins and discounts never stack. Easy to explain to staff, harder to game.
- CSV imports land in a staging table with one-click rollback and an audit line for every change.
- Quantity breaks render through Theme App Extensions, so they show on the product page and in the Google Shopping feed.
Stack
Shopify Functions, Rust, WebAssembly, React Router 7, Polaris, Postgres (Neon), Inngest, Theme App Extensions