Integrations

How to Add Virtual Try-On to WooCommerce

A hands-on install guide for placing virtual try-on where WooCommerce shoppers actually click

On this page
  1. Plugin Install vs. Embed Script: Which Path Fits Your Store
  2. Where the Try-On Trigger Belongs on the Product Page
  3. Hooking Into Theme and Page-Builder Specifics
  4. Testing the Integration Before Launch
  5. Where YourSizer Fits
  6. Frequently Asked Questions
  7. Conclusion

WooCommerce runs on WordPress hooks, not a fixed template, which means "add virtual try-on" is really a question of which hook you attach to and how close that trigger sits to the add-to-cart button. Get the placement wrong and the feature goes unused; get it right and it becomes part of the buying decision.

WooCommerce powers a meaningful share of independent fashion stores, and most of them are running a child theme with customized woocommerce_single_product_summary hooks rather than a stock layout. That variability is the real challenge with try-on integrations — not the try-on technology itself. This walkthrough covers the two installation paths, where the trigger button belongs relative to add-to-cart, the specific hooks and theme touchpoints to check, and how to verify the integration actually works before you ship it live.

Plugin Install vs. Embed Script: Which Path Fits Your Store

There are two realistic ways to get a try-on button onto a WooCommerce product page. A packaged plugin hooks into WooCommerce's action system automatically — it registers itself on woocommerce_single_product_summary or a similar hook with a priority number, and it shows up without you touching template files. This is the faster route and the right default for stores on an unmodified or lightly modified theme (Storefront, Astra, Flatsome with default product templates).

The alternative is a manual embed script dropped into functions.php or a snippet plugin, wired to a specific hook and priority you choose yourself. This is the better path when your theme has a heavily customized content-single-product.php, when you're running a page builder (Elementor, Divi) that overrides WooCommerce's default template hierarchy, or when marketing wants the trigger inside a custom-built product gallery rather than the summary column. In our experience supporting WooCommerce merchants, stores with page-builder product pages need the embed-script path more often than not, because the plugin's default hook target may not even render on those templates.

A rule of thumb: if wp_head inspection in your browser's dev tools shows the theme is using standard WooCommerce template tags, start with the plugin. If the product page markup looks custom or heavily filtered, go straight to the embed script and target the hook manually.

Where the Try-On Trigger Belongs on the Product Page

Placement is the single biggest factor in whether a try-on widget gets clicked. The trigger needs to sit above or immediately beside the add-to-cart button, inside the shopper's natural scan path — not buried in a tab, not below the fold, and not competing with size-selector dropdowns for attention.

In WooCommerce's default hook stack, the relevant real estate looks like this:

HookDefault priorityWhat lives hereFit for try-on trigger
woocommerce_single_product_summary @ 5TitleToo early — no product context yetNo
woocommerce_single_product_summary @ 10PriceEarly, but shoppers haven't seen variant optionsSometimes
woocommerce_single_product_summary @ 25Add to cart formPrime real estateYes — @ 26 or @ 29
woocommerce_single_product_summary @ 30Meta (SKU, categories)Post-decision, low visibilityNo

The strongest position is a custom action registered at priority 26 — right after the add-to-cart form renders (priority 30) but before size/quantity fields lose visual priority, or bound as a sibling button next to "Add to Cart" itself using woocommerce_after_add_to_cart_button. Placing the trigger after the shopper has already selected a variation means it can pass the selected color and size into the try-on session, which avoids a second selection step inside the widget.

Avoid putting the trigger in the product image gallery only — some stores tuck a small "Try On" icon into a gallery thumbnail overlay, which looks tidy but gets far fewer clicks than a labeled button near the purchase action. Visual polish matters less here than proximity to the moment of decision.

Hooking Into Theme and Page-Builder Specifics

Every theme handles the product summary differently, so test your hook target before assuming it works everywhere. Storefront and most of its child themes respect the standard woocommerce_single_product_summary hook order without modification, so a priority-26 registration behaves predictably.

Flatsome, Astra, and other builder-friendly themes sometimes wrap the add-to-cart form in their own shortcode or React-driven component, which can shift where woocommerce_after_add_to_cart_button actually fires — occasionally it fires but renders outside the visible viewport on mobile. If you're on Elementor's WooCommerce Builder or Divi's WooCommerce modules, the product page is often assembled from widgets rather than the classic template file, and hook-based injection may not appear at all; in that case, use the builder's own "custom HTML" or "shortcode" widget to drop the embed script exactly where you want it, rather than fighting the hook system.

A quick way to confirm which situation you're in: open the product page, view source, and search for add_to_cart_button or the form's name="add-to-cart" attribute. If you find it inside a recognizable WooCommerce form markup, hooks will work as documented. If the markup looks generated by a builder shortcode with obfuscated class names, plan on manual placement through the builder UI instead.

Testing the Integration Before Launch

A try-on button that "looks installed" isn't the same as one that works end-to-end. Before pushing live, check four things on both desktop and mobile:

  1. The trigger renders on every product template variant the store uses — simple products, variable products, and any custom product type plugins add.
  2. Selecting a variation (size, color) before opening try-on correctly passes that selection into the session, rather than defaulting to the first variant.
  3. The widget loads inside WooCommerce's cache setup — plugins like WP Rocket or LiteSpeed Cache can strip inline script tags on cached pages, so test with a logged-out session after clearing cache, not just as an admin.
  4. Mobile viewport behavior: confirm the trigger doesn't get clipped by sticky add-to-cart bars that many WooCommerce mobile themes add at the bottom of the screen.

That fourth point catches more launch bugs than any other, because sticky mobile add-to-cart bars are a common theme feature that many merchants add later, after the try-on integration was originally tested.

Where YourSizer Fits

YourSizer's widget is built to drop into exactly this kind of hook-based environment: it ships as a lightweight embed that can be registered on woocommerce_after_add_to_cart_button (or an equivalent priority-26 slot) so the trigger sits next to the purchase action rather than in a separate tab. For stores where hooks don't reach the rendered markup — page-builder product pages, heavily customized templates — the same embed can be dropped in through a custom HTML block instead, without requiring a rebuild of the product template.

The widget also reads the shopper's already-selected size and color attributes from the WooCommerce variation form when available, so the try-on session opens pre-populated rather than asking the shopper to choose again. None of this replaces good judgment about where your specific theme wants the trigger — it just means the placement options in this guide are all supported paths, not workarounds.

Frequently Asked Questions

Does virtual try-on slow down my WooCommerce product page load time?

A well-built try-on embed loads asynchronously and defers its heavier assets (3D rendering, model files) until the shopper actually clicks the trigger, so the initial page load shouldn't be materially affected. The bigger risk to watch is caching plugins stripping or delaying the script tag itself, which is why testing on a fresh, logged-out cache is part of the pre-launch checklist above rather than an optional step.

Can I show the try-on trigger only on certain product categories?

Yes — both the plugin and embed-script paths support conditional logic using WooCommerce's standard category and product-type checks (has_term(), is_product_category()), so you can limit the trigger to apparel while excluding accessories or gift cards where try-on doesn't apply. This is common practice for stores that sell a mixed catalog and don't want the button appearing on non-wearable SKUs.

What happens if a shopper's browser doesn't support the try-on widget's rendering requirements?

The trigger button should degrade gracefully rather than appearing broken — a properly configured integration checks device and browser compatibility before rendering the try-on interface, and falls back to hiding the trigger or showing a standard size chart link instead. This is worth confirming during testing on older Android devices specifically, since WebGL support varies more there than on recent iOS hardware.

Is virtual try-on different from a size recommendation widget on WooCommerce?

Yes, and the distinction matters for which hook and placement you use — a size recommendation tool typically asks for a few measurements and returns a suggested size, while virtual try-on renders a visual preview of the garment on a body model or photo. Some stores run both side by side near add-to-cart; for a deeper comparison of when each makes sense, see virtual try-on vs. size recommendation.

Conclusion

Adding virtual try-on to WooCommerce is less about the widget itself and more about disciplined placement — choosing the plugin or embed path based on your theme's actual markup, targeting a hook priority that sits next to the add-to-cart decision, and testing across caching and mobile conditions before calling it done. Storefront-style themes make this straightforward; page-builder catalogs take a bit more manual targeting but are just as workable. Get the hook placement right once, and the same pattern (variant-aware trigger, async loading, graceful fallback) holds up as your catalog and theme evolve — see how to add a size recommendation widget to Shopify for how the same placement logic plays out on a different platform. Fashion ecommerce broadly is still absorbing what Google folding try-on into Search signals for shopper expectations, and getting the on-site basics right now positions a WooCommerce store well for whatever comes next.

Put it into practice

See YourSizer on your own store

Size recommendation, 3D body model and photo try-on — live on your product pages in a day.