Last updated: October 2026
The Margin Cap Shopify Function adjusts CodeRally-managed automatic discounts at checkout so estimated margin stays at or above your floor when possible. Manual discount codes are not affected by auto-cap.
The Margin Guard validation prevents completing checkout when any line item would fall below your margin floor, using synced variant costs and current prices.
Lines without a synced cost may fail open: meaning the order is allowed through: so incomplete COGS does not freeze all sales. Improve COGS coverage for stricter protection. See Product costs.
Auto-cap targets CodeRally automatic discounts only. Manual discount codes stacked at checkout may bypass cap logic. Consider Block mode or store policies on stacking codes if this is a concern.
Margin Guard · Product costs (COGS) · Additional store features
Discover strategies and tools to increase sales, speed, and customer engagement.