Skip to content
BigCommerce Widget Install Guide

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)

A
Fast demo on a few products (no theme edits)
  1. Storefront → Customize (Page Builder) → open a product page.
  2. Drag an HTML block under the Add to Cart area (or another prominent area nearby).
  3. Paste the snippet below → Save/Publish.

Option B — Script Manager (all themes)

B
Scale to many PDPs without theme edits

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.

  1. Storefront → Script Manager → Create Script.
  2. Placement: Footer · Location: Storefront pages · Category: Functional · Type: Script.
  3. Paste one of the snippets below.
B1 — Inject on all product pages (under Add to Cart)
B2 — Inject only for specific SKUs (edit list)

Option C — Edit theme code (Stencil & headless)

C
Maximum control & the most robust long-term install

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

  1. Storefront → Themes → Advanced → Download Current Theme.
  2. Install Stencil CLI locally → run stencil start.
  3. Create partial: templates/components/medpaid/widget.html → paste widget HTML.
  4. Include near Add to Cart in templates/components/products/product-view.html (or page-level):
  5. (Optional) Gate by custom field on products:
  6. stencil bundle → upload ZIP → Apply.

C2 — Non-Stencil / Headless

  1. Make a reusable component (React/Vue/etc.) with the widget HTML/CSS.
  2. Render it directly below your PDP’s Add to Cart component.
  3. 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

PP-DEBUG: Current path: /pages/merchants-how-to-install-pdp-widget-on-bigcommerce-product-pages