DEV Community

klyx
klyx

Posted on

Why We Built Bundler on Native Shopify Functions (Not Theme Code Hacks)

Why We Built Bundler on Native Shopify Functions (Not Theme Code Hacks)

A lot of bundle and discount apps on the Shopify App Store still calculate pricing client-side and inject it via JavaScript — which works until Shopify changes something about checkout, and then it quietly stops working. We built Bundler differently on purpose.

🩹 The Old Way: Client-Side Discount Injection

JavaScript-based discount apps calculate the bundle price in the browser and try to apply it before or during checkout — a pattern that's fragile by design, since it depends on checkout's DOM structure staying stable, which Shopify doesn't guarantee.

⚡ What Shopify Functions Actually Changes

Functions run server-side, compiled to WebAssembly, directly inside Shopify's checkout logic — not bolted on after the fact. The discount is calculated and applied as a native part of the order, which means it survives theme changes, checkout updates, and works identically across every sales channel, not just the storefront.

🛡️ What This Means for Merchants Day to Day

No "the discount stopped working after we updated our theme" support tickets, no checkout extension conflicts with other apps, and no risk of the discount silently failing to apply at checkout even though it showed correctly on the product page.


Originally published on the KLYX blog.

Top comments (0)