Title: LessLens Virtual Try-On for WooCommerce
Author: lesslens
Published: <strong>November 21, 2026</strong>
Last modified: November 21, 2026

---

Search plugins

![](https://ps.w.org/lesslens-virtual-try-on/assets/banner-772x250.png?rev=3815830)

![](https://ps.w.org/lesslens-virtual-try-on/assets/icon-256x256.png?rev=3815830)

# LessLens Virtual Try-On for WooCommerce

 By [lesslens](https://profiles.wordpress.org/lesslens/)

[Download](https://downloads.wordpress.org/plugin/lesslens-virtual-try-on.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/lesslens-virtual-try-on/#description)
 * [Reviews](https://wordpress.org/plugins/lesslens-virtual-try-on/#reviews)
 *  [Installation](https://wordpress.org/plugins/lesslens-virtual-try-on/#installation)
 * [Development](https://wordpress.org/plugins/lesslens-virtual-try-on/#developers)

 [Support](https://wordpress.org/support/plugin/lesslens-virtual-try-on/)

## Description

LessLens Virtual Try-On puts a “Try on virtually” button under Add to cart on your
eyewear product pages. Shoppers try your frames on their own face right on the product
page, in the browser on computers and phones, with nothing to install.

#### What your store gets

 * **A try-on button under Add to cart**, on the frames you have in 3D. Each frame
   is matched to its product by the SKU you already use, so nothing changes in your
   catalogue.
 * **Every colour.** When a shopper picks another colour, the button switches to
   that colour. If the try-on is open at that moment, it closes and the button switches
   to the new colour. Colours and products without a 3D model show no button and
   stay exactly as they are.
 * **The try-on in place of the product photo.** On a computer, it opens right where
   the product photo was, so the price, the colours and Add to cart stay in view.
 * **A photo with the frame on.** Shoppers can take one and share or save it. If
   the camera isn’t available, they can try frames on a photo instead; the photo
   stays in the browser.
 * **Your theme as it is.** Classic and block themes: the button goes under Add 
   to cart by itself, or wherever you put the `[lesslens_tryon]` shortcode.
 * **Fast product pages.** The try-on itself loads only when a shopper points at
   or taps the button. Pages other than product pages get nothing.
 * **Your own analytics.** Button views, try-on openings, try-ons and kept try-on
   photos as events on your page, and in Google Tag Manager’s dataLayer if you switch
   it on.
 * **Private by design.** The camera image is processed on the shopper’s device.
   LessLens doesn’t receive or store camera images, and the try-on sets no cookies.

#### A LessLens store key is required

This plugin connects your store to the LessLens virtual try-on service. The try-
on, the 3D models of your frames and your store key come from LessLens with a pilot
or a plan: see [LessLens for WooCommerce](https://business.lesslens.com/integrations/woocommerce)
and [plans and pricing](https://business.lesslens.com/pricing).

Until a store key is saved (it starts with `pk_`), the plugin adds nothing to your
pages and nothing is loaded from LessLens.

### External services

This plugin relies on the LessLens virtual try-on service of LessLens Inc., served
from `cdn.lesslens.app` (hosted on Cloudflare). Nothing is sent from your WordPress
server, and nothing is loaded in wp-admin. The requests below are made by the shopper’s
browser, after you have saved a store key, on every single product page that gets
a try-on placeholder: every product with a SKU and every variable product (a product
with colours), whether or not that frame is in your LessLens catalogue. The service
answers which of the page’s frames your store can show; the others get no button.
To keep LessLens off some products, use the `lesslens_tryon_show_button` filter (
see the FAQ).

What is sent, and when:

 * **When such a product page loads:** the browser loads the LessLens script (`https://
   cdn.lesslens.app/tryon/v2/tryon-button.js`) and asks the service which of the
   page’s frames your store may show. That request carries your store key, the frame
   names (made from the product’s and its colours’ SKUs) and your store’s address(
   the page’s origin). Once the service has answered, the request is repeated every
   5 minutes while the page is in view and when the shopper comes back to the tab,
   and it is made again for each newly picked colour. A variable product without
   a SKU of its own loads the script but makes this request only when a colour with
   a SKU is picked or preselected.
 * **When the shopper points at, focuses or taps the button:** the public try-on
   files (the face-tracking model and lighting) are downloaded from `cdn.lesslens.
   app`.
 * **When the shopper opens the try-on:** the browser starts a try-on session (sending
   a short-lived ticket and the frame name) and downloads the try-on and your frame’s
   3D model from `cdn.lesslens.app` through links that expire within minutes.
 * **With every request:** as on any website, the shopper’s IP address and browser
   user agent reach the service. LessLens counts button views and try-ons by frame,
   with the device type (from the user agent), the country (from the IP address)
   and your store’s domain, to run the service and for your store’s report. IP addresses
   are used only to stop abuse and are not stored. No cookies and no visitor IDs
   are used.
 * **Never sent:** the camera turns on only after the shopper starts the try-on 
   and allows it. The camera image is processed on the shopper’s device and is never
   sent to LessLens or anyone else, and neither are face data or measurements. A
   photo the shopper takes with the frame on goes only where they send it (their
   share sheet or downloads). A photo the shopper tries frames on instead of the
   camera stays in the browser. A pupillary distance the shopper types in stays 
   in the browser tab and is passed only to your page.

The try-on window shows a small “Try-on by LessLens” link to business.lesslens.com.
It is shown for every store key, pilots included; only stores on the Scale or Custom
plan can ask LessLens to turn it off. The plugin has no setting for it.

The analytics events stay on your page; with the dataLayer option on, they also 
go to your Google Tag Manager, not to LessLens.

 * Terms of use: https://business.lesslens.com/terms
 * Privacy policy: https://lesslens.com/privacy
 * Data and security: https://business.lesslens.com/security

## Screenshots

[⌊The try-on opens in place of the product photo, so the price, the colours and 
Add to cart stay in view (Twenty Twenty-Five).⌉⌊The try-on opens in place of the
product photo, so the price, the colours and Add to cart stay in view (Twenty Twenty-
Five).⌉[

The try-on opens in place of the product photo, so the price, the colours and Add
to cart stay in view (Twenty Twenty-Five).

[⌊The "Try on virtually" button under Add to cart, on a frame you have in 3D.⌉⌊The"
Try on virtually" button under Add to cart, on a frame you have in 3D.⌉[

The “Try on virtually” button under Add to cart, on a frame you have in 3D.

[⌊A classic theme (Storefront): the button follows the colour the shopper picks.⌉⌊
A classic theme (Storefront): the button follows the colour the shopper picks.⌉[

A classic theme (Storefront): the button follows the colour the shopper picks.

[⌊On a phone, the try-on opens full screen after a tap.⌉⌊On a phone, the try-on 
opens full screen after a tap.⌉[

On a phone, the try-on opens full screen after a tap.

[⌊The settings tab: WooCommerce → Settings → LessLens Try-On.⌉⌊The settings tab:
WooCommerce → Settings → LessLens Try-On.⌉[

The settings tab: WooCommerce  Settings  LessLens Try-On.

## Installation

 1. Install and activate the plugin. WooCommerce must be active.
 2. Go to **WooCommerce  Settings  LessLens Try-On**, paste your store key (it starts
    with `pk_`) and save. A value that isn’t a store key is saved with a warning, and
    product pages stay as they are until the key is right.
 3. Open a product whose SKU is one of your frames in LessLens: the button is under
    Add to cart.

The key works only on the domains LessLens has on file for your store, so tell us
every domain the store uses (for example with and without www, or a staging site).
The store must be on HTTPS: the service accepts `http://` only on localhost, for
testing.

Used the LessLens code snippet before the plugin? Remove the snippet first (see 
the FAQ).

## FAQ

### I don’t have a store key. What happens?

Nothing: without a key the plugin adds nothing to your pages and nothing is loaded
from LessLens. You get a key from LessLens with a pilot or a plan, together with
the 3D models of your frames. See [LessLens for WooCommerce](https://business.lesslens.com/integrations/woocommerce).

### Which products show the button?

Products whose SKU matches a frame in your LessLens catalogue. The plugin turns 
the SKU into the frame’s name: lower case, with anything other than letters, digits,“.”,“_”
and “-” replaced by “-” (SKU “AB 1234/Gold” becomes `ab-1234-gold`). LessLens sets
up your frames under these names, so you don’t change your SKUs. Products without
a SKU, and products whose frame isn’t in 3D yet, show no button and stay exactly
as they are.

The LessLens script itself loads on every product page with a SKU and on every variable
product, and asks the service about the page’s frames (see “External services”);
that is how it finds out which of them have a button.

### Can I show the button on some products only?

Yes, with the `lesslens_tryon_show_button` filter. It gets `true` and the product;
return `false` and that product page gets no button, and nothing is loaded from 
LessLens on it. For example, only products in the “Sunglasses” category (slug `sunglasses`),
in your child theme’s functions.php or a code-snippets plugin:

    ```
    add_filter( 'lesslens_tryon_show_button', function ( $show, $product ) {
        return $show && has_term( 'sunglasses', 'product_cat', $product->get_id() );
    }, 10, 2 );
    ```

### What about frames in several colours?

Each colour has its own 3D model, named by the variation’s SKU (a variation without
its own SKU uses the product’s). When a shopper picks a colour, the button switches
to it. If the try-on is open at that moment, it closes (and its camera stops), and
the shopper opens it again on the new colour with the button. A colour without a
3D model shows no button. When the page opens on a preselected colour (the product’s
default colour, or one in the link), the button starts on that colour; otherwise
it shows the frame of the product’s own SKU, if there is one, until a colour is 
picked.

### Does it work with block themes?

Yes. In block themes such as Twenty Twenty-Five and in classic themes such as Storefront,
the button goes under Add to cart by itself, with WooCommerce’s “Add to Cart Form”
block and with its newer “Add to Cart + Options” block. If your Single Product template
has no Add to cart form, or you want the button somewhere else, turn off “Show the
button under Add to cart automatically” and add a Shortcode block with `[lesslens_tryon]`
to the template (Appearance  Editor  Templates  Single Product). The shortcode also
works in the product’s short description or description. When you place the shortcode
yourself, turn the automatic placement off, and use the shortcode once per page.(
With the automatic placement on, the automatic button steps aside only for a shortcode
in the product’s description or short description, in the Single Product template’s
own content, or one that appears on the page before Add to cart. A shortcode in 
a template part, synced pattern, widget or page-builder layout that comes after 
Add to cart stays empty, and the automatic button stays.)

### Will it slow down my product pages?

On product pages that get a placeholder (see “External services”), the plugin adds
the LessLens script as a module, which runs only after the page has been read. Variable
products also get a small script of the plugin’s own (no libraries) that switches
the button to the picked colour. The try-on itself loads only when a shopper points
at or taps the button. Other pages get nothing.

### Do I need to change my caching or JavaScript optimisation plugin?

Usually not. Page caching is fine. Autoptimize and W3 Total Cache leave the LessLens
script alone, and the plugin keeps it out of SiteGround Speed Optimizer’s “Combine
JavaScript Files” and out of WP-Optimize’s JavaScript minifying, merging and “Delay
JavaScript”, so the button works with those options on. One exception: in WP-Optimize,
leave “Contain each included file in its own block” off (it is off unless you turn
it on); with it on, the button doesn’t show.

With another optimiser (WP Rocket, LiteSpeed Cache, Perfmatters and the like), if
the button doesn’t show, exclude `cdn.lesslens.app` (the script `tryon-button.js`)
from its “combine”, “minify”, “delay” or “defer” JavaScript options. The LessLens
script finds the LessLens service from its own address, so a copy combined into 
another file or served from your own site doesn’t work, and a delayed one shows 
the button only after the shopper first scrolls or moves the mouse.

### Does my store need HTTPS?

Yes. The LessLens service accepts only pages on `https://` (plain `http://` only
on localhost and 127.0.0.1, for testing), and only on the domains LessLens has on
file for your store.

### I used the LessLens code snippet before. What now?

Remove the snippet (in Code Snippets, WPCode or your child theme’s functions.php)
before you activate the plugin, then save your store key in the plugin’s settings.
Your key and frames stay the same. While the snippet is still active, the plugin
adds nothing to product pages, so shoppers never get two buttons, and a notice in
wp-admin reminds you to remove it.

### Can I measure the effect?

Yes. The try-on fires these events on your page (on `window`) for your own analytics:`
lesslens:view` (the button is shown, once per frame per page), `lesslens:open` (
the try-on is opened), `lesslens:tryon` (the frame is on the face, from the camera
or a photo) and `lesslens:photo` (the shopper shares or saves a try-on photo). With“
Send try-on events to the dataLayer” on, Google Tag Manager gets them as `lesslens_view`,`
lesslens_open`, `lesslens_tryon` and `lesslens_photo`, with the frame in `lesslens_model`.(
The LessLens script also has `lesslens_holdout`, for an A/B test that holds the 
button back; the plugin doesn’t set up such a test, so it doesn’t fire.) A pupillary
distance the shopper types in comes as `lesslens:pd` on your page only, never in
the dataLayer. LessLens also sends you a monthly report of button views and try-
ons by frame.

### Do shoppers’ camera images leave their device?

No. The camera image is processed on the shopper’s device, and LessLens doesn’t 
receive or store it. See “External services” above for everything the try-on sends.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“LessLens Virtual Try-On for WooCommerce” is open source software. The following
people have contributed to this plugin.

Contributors

 *   [ lesslens ](https://profiles.wordpress.org/lesslens/)

[Translate “LessLens Virtual Try-On for WooCommerce” into your language.](https://translate.wordpress.org/projects/wp-plugins/lesslens-virtual-try-on)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/lesslens-virtual-try-on/),
check out the [SVN repository](https://plugins.svn.wordpress.org/lesslens-virtual-try-on/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/lesslens-virtual-try-on/)
by [RSS](https://plugins.trac.wordpress.org/log/lesslens-virtual-try-on/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * First release: the try-on button under Add to cart, colour switching, the `[lesslens_tryon]`
   shortcode, the dataLayer option and the `lesslens_tryon_show_button` filter. 
   Keeps the LessLens script out of SiteGround Speed Optimizer’s JavaScript combining
   and out of WP-Optimize’s JavaScript processing and delay, and hides WooCommerce’s
   photo zoom icon while the try-on is open, so it doesn’t cover the try-on’s close
   button.

## Meta

 *  Version **1.0.0**
 *  Last updated **3 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.5 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [Augmented Reality](https://wordpress.org/plugins/tags/augmented-reality/)[eyewear](https://wordpress.org/plugins/tags/eyewear/)
   [glasses](https://wordpress.org/plugins/tags/glasses/)[virtual try on](https://wordpress.org/plugins/tags/virtual-try-on/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/lesslens-virtual-try-on/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/lesslens-virtual-try-on/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/lesslens-virtual-try-on/reviews/)

## Contributors

 *   [ lesslens ](https://profiles.wordpress.org/lesslens/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/lesslens-virtual-try-on/)