Add the Medpaid HSA/FSA Widget to Product Pages (all themes)
This page teaches three reliable ways to place the Medpaid widget directly under the Add to Cart button on BigCommerce product pages—so shoppers see HSA/FSA options before checkout.
- HTML block (Page Builder): fastest for a few products—no theme edits.
- Script Manager: scale to many PDPs, add SKU targeting, easy rollback.
- Theme code edit: pixel-perfect placement and custom-field gating (Stencil or headless).
Option A — Add via Page Builder (HTML block)
- Storefront → Customize (Page Builder) → open a product page.
- Drag an HTML block under the Add to Cart area (or another prominent area nearby).
- Paste the snippet below → Save/Publish.
Option B — Script Manager (all themes)
Why choose this: centralized control, easy rollback, works across most themes. Use for broad rollouts or tests. If placement is a few pixels off on a custom theme, tweak the selector list.
- Storefront → Script Manager → Create Script.
- Placement: Footer · Location: Storefront pages · Category: Functional · Type: Script.
- Paste one of the snippets below.
Option C — Edit theme code (Stencil & headless)
Why choose this: rock-solid placement, fastest runtime, and easy product-level gating via custom fields. Ideal when you maintain a dev pipeline (Stencil CLI) or a custom/headless storefront.
C1 — Stencil themes
- Storefront → Themes → Advanced → Download Current Theme.
- Install Stencil CLI locally → run
stencil start. - Create partial:
templates/→ paste widget HTML.components/ medpaid/ widget.html - Include near Add to Cart in
templates/(or page-level):components/ products/ product-view.html - (Optional) Gate by custom field on products:
stencil bundle→ upload ZIP → Apply.
C2 — Non-Stencil / Headless
- Make a reusable component (React/Vue/etc.) with the widget HTML/CSS.
- Render it directly below your PDP’s Add to Cart component.
- Show conditionally:
- By SKU allowlist (read from PDP data), or
- By CMS flag, e.g.
medpaidEligible: true.
Recommended: keep the modal root mounted in <body> for z-index & focus control.
Widget partial — copy source












