Optogrid Eyeglasses for WooCommerce
Configurable lens builder for WooCommerce eyeglasses stores.
Install in
Optogrid Eyeglasses for WooCommerce transforms your WooCommerce store into a full-featured optical shop. Add a step-by-step lens builder to any product page, capture prescription (Rx) and pupillary distance (PD) data, and integrate with the Optogrid API for digital PD measurement via photo.
The lens builder and manual Rx/PD capture are free. Learn about Optogrid measurement — photo PD measurement, Rx document upload, and operator-verified results delivered back to the order.
Key Features:
- Configurable Lens Builder — Multi-step UI for lens type, material, coatings, and tints with dynamic pricing.
- Rx Capture — Collect prescription data via form fields, or via document upload with a connected Optogrid account.
- PD Measurement — Manual PD entry or automated measurement via Optogrid photo analysis.
- Visual Flow Builder — Admin interface to configure lens journey steps, options, conditions, and pricing.
- Dynamic Pricing — Real-time price calculation with per-option deltas and formatted breakdowns.
- WooCommerce Integration — Works with cart, checkout, and order management. HPOS compatible.
Merchant Guide
Setup
- Activate the plugin. Until you configure your lens journey, an admin notice prompts you to run the Setup Wizard — or open it directly from WooCommerce > Optogrid Eyeglasses > Settings > Re-run Setup Wizard.
- Pick a preset or configure lens types, materials, and pricing yourself in the Flow Builder tab.
- Choose which products the lens builder appears on: all products, or specific categories/products (Settings > General).
- That’s it for the free tier — no Optogrid account is required. Manual Rx entry and manual PD entry work immediately.
- To add file uploads (prescription documents, PD photos) and photo-based PD measurement, connect an Optogrid account from the Optogrid tab (see “Free vs. paid” below).
Free vs. paid
Free, no account needed: the full lens builder (types, materials, coatings, tints, dynamic pricing), Rx capture via manual form fields, and manual PD entry. Everything a shopper enters lands on the order and in the admin order-confirmation email, ready for your lab.
Requires a connected Optogrid account: anything that involves a file. Prescription document upload and PD photo capture both store the file on Optogrid’s servers — the plugin has no local storage path for them — and photo-based PD measurement and operator-verified results are performed there. Connect your store from the Optogrid tab in Settings. Until you connect, the upload and photo controls are not shown at all and the builder falls back to the manual fields described above. Once connected, the controls show on every Optogrid plan. On the free plan you can open 5 customer photos for measuring in any 30 days, and the Optogrid tab shows your usage; Premium removes the limit. If uploads are ever unavailable, the builder switches the shopper to the manual fields. Shoppers never see a broken feature or anything about your plan.
Order flow
- The shopper configures their lenses in the builder and provides a prescription (manual fields, or — once connected — a document upload and/or a PD photo).
- At checkout, the plugin persists that data to the order (
Rx/PD Capture Datameta box) and, for photo submissions, schedules a background job to link the upload to the order. - If a PD photo was submitted, the order is moved to a “Pending PD” status until Optogrid returns a measurement; other orders proceed through your normal WooCommerce statuses unaffected.
- To follow up on a measurement from wp-admin: on the WooCommerce > Orders list, “Pending PD” appears in the Status column (use the status filter above the list to see every order awaiting measurement). Open the order and the
Rx/PD Capture Databox shows the capture status and a “View in Optogrid” link that opens the uploaded photo in your Optogrid account, where the measurement is performed. - When the measurement completes, the order’s Rx/PD meta box shows the result and a “View measurement” link back to Optogrid; the order can then move to your fulfillment/lab stage as usual.
- The admin order-confirmation email also includes the full prescription and PD, so your lab has everything even without opening wp-admin.
Failure recovery
If a submitted PD photo can’t be measured (for example, the photo is blurry or no face is detected), Optogrid reports the reason back to your store as an order note explaining what went wrong. The manually-entered prescription and PD already on the order (if the shopper provided any) are unaffected and still ship with the order.
The shopper is then guided through an automated recovery flow. Your store emails the customer the reason together with a secure, private link (valid for 14 days) where they can retake and re-upload the photo — no login or new checkout required. When Optogrid measures the replacement photo, the order advances automatically, exactly as it would have on the first attempt. From the order screen you can also re-send that link (“Request new photo”) or enter the PD yourself (“Enter PD manually”) if you’d prefer to resolve it directly.
External Services
This plugin optionally connects to the Optogrid API (https://app.optogrid.com/) for digital pupillary distance (PD) measurement and prescription document storage.
When data is sent to Optogrid:
- Store registration — When a merchant registers their store with Optogrid via the plugin settings. Sends: admin email, store name, store domain, store URL, WooCommerce version, and plugin version. It also registers a webhook URL pointing back to your store (a REST endpoint on your own site) so Optogrid can deliver measurement results.
- PD photo upload — When a customer submits a photo for automated PD measurement.
- Rx document upload — When a customer uploads a prescription document.
- Upload linking — At checkout, upload tokens are exchanged for permanent Optogrid references tied to the order. This call also sends the customer’s email address, the customer’s name, and an internal (non-public) customer identifier used to match repeat customers across orders.
- PD measurement retrieval — When the plugin checks the status or result of a PD measurement.
- Ping — Periodic connectivity checks to verify the Optogrid API is reachable.
- Webhooks — Optogrid sends measurement results back to your store via webhook when PD processing completes.
What the service can send back: responses from Optogrid may carry two fields that change plugin state. (1) A replacement API address, so a connected store follows an Optogrid domain move without the merchant having to reconnect — only https:// addresses are accepted, and while one is in effect an admin notice names it and tells you how to reset it. (2) A service notice (for example a deprecation warning), which is shown as a dismissible admin notice to users with manage_woocommerce; a notice that declares a minimum plugin version this install does not meet is shown as a non-dismissible update prompt until you update. Both fields are escaped before display and neither can execute code.
Before a shopper’s face photo or prescription document is uploaded, the plugin requires the shopper to give explicit consent via a checkbox, and records that consent (with a timestamp) alongside the order.
This feature is optional. The plugin works without an Optogrid account — customers can enter PD values manually and provide prescription data via form fields, and the lens builder, pricing, cart and order integration are unaffected. The Optogrid integration is required only for the features that depend on it: Rx document upload and PD photo upload (the file is stored on Optogrid’s servers; the plugin has no local storage path for it) and the PD measurement performed on those photos.
Source Code
The full, unminified TypeScript/React source for the compiled JavaScript in /build/ is included in the plugin under /src/, together with the build configuration needed to reproduce it: package.json, webpack.config.js and tsconfig.json. Nothing is obfuscated or minified beyond the standard webpack production build.
To rebuild from the shipped files: install pnpm, then run pnpm install followed by pnpm run build in the plugin directory. This regenerates /build/ from /src/ using webpack via @wordpress/scripts.
Developers
The plugin exposes hooks for extending detection, pricing, and the lens journey, plus CSS custom properties for styling. The full reference (all 12 filters and 5 actions with signatures, and every --optowoo-* property) lives in README.md. Highlights:
optogd_is_eyeglasses_product/optogd_product_uses_builder— control whether the builder renders on a product.optogd_lens_price_breakdown— filter the price breakdown to apply merchant discounts/markups. Applied to the charged price (cart/checkout/order). Note: the product-page price preview is computed in the browser and does not reflect this PHP filter, so a change here shows in the cart but not on the live PDP preview.
Multi-currency stores are not fully supported yet. Lens price deltas are converted to the active currency for the charged price (cart/checkout/order via the optogd_convert_lens_delta filter, which integrates with WPML, WOOCS, and Aelia), but the product-page price preview is computed in the browser and always shows base-currency deltas. On a multi-currency store the preview can therefore differ from the amount charged. If you run WPML/WOOCS/Aelia currency switching, test the end-to-end price before going live.
* optogd_journey_config — override the active lens journey at runtime. It runs on every request and is never persisted: the day-long cache stores the unfiltered config, so per-request filter output is never frozen and shared.
* optogd_default_journey_config — override the shipped default journey; applies only when no config is stored (a saved config always wins).
* Saved journey configs are validated for referential integrity: unique step/option/eyeglass-type IDs, and every logic-rule target and condition reference must resolve to an existing step/option.
* Styling: the builder is scoped to .optowoo-extra-options and exposes --optowoo-* custom properties (accent, colors, spacing, borders, transition). Override them by scoping to that container.
Written by Joobi from the project's own listing. See the source page
0.1.9
- Fixed: on WordPress 6.5, “Select Lens and Buy” appeared but did nothing when clicked. The plugin now requires WordPress 6.6 or later.
- Changed: the minimum supported WooCommerce version is now 9.0 (it was 8.0). The plugin is tested on WooCommerce 9.0 and on the current release. On an older WooCommerce the plugin still loads but is no longer tested there, and administrators see a notice asking them to update WooCommerce.
- New: View Prescription and Download Prescription buttons on the order screen, in the Rx/PD Capture Data box, for orders where the shopper uploaded a prescription. You no longer need to sign in to Optogrid to open the file. The store must be connected to Optogrid, and only users who can edit orders see the buttons.
- Fixed: on classic checkout (the checkout shortcode), a prescription or PD photo the shopper uploaded never reached Optogrid. The order showed the file name, but the file was not linked to the order, and Optogrid deleted it after 7 days. Uploads are now linked to the order. On classic checkout, this is what lets the new prescription buttons work. Orders placed before this update are not fixed.
- Fixed: variable eyeglasses products (for example, a frame sold in several colors) could not be added to the cart. After the shopper finished the lens builder, WooCommerce asked them to “choose product options” again.
- Fixed: on block themes whose product page uses WooCommerce’s “Add to Cart + Options” block, choosing a variation now enables “Select Lens and Buy”. It used to stay disabled.
- Fixed: “Select Lens and Buy” did nothing when the theme or another plugin (for example, an AJAX add-to-cart plugin) intercepted clicks on add-to-cart buttons.
- Fixed: on block themes, a Related Products section placed above the add-to-cart button could take “Select Lens and Buy” away from the product being viewed, which then had no buy button.
- Fixed: in browsers that do not support the CSS :has() selector, the product page could show a second buy button or an empty form next to “Select Lens and Buy”.
- Improved: if the lens builder’s script is delayed or blocked (for example, by a plugin that delays JavaScript), shoppers now see WooCommerce’s normal “Add to cart” button until the builder is ready, instead of a “Select Lens and Buy” button that does nothing.
0.1.8
- Fixed: when connecting to Optogrid fails, the Optogrid tab now says why, for example that the store is already connected to a different Optogrid account, the connection link expired, or the connection is paused. It used to always say “Connecting to Optogrid failed. Please try again.”
- New: if the store is already connected to a different Optogrid account, you can connect it as a new store with the account you are signed in to, after confirming. The store’s earlier Optogrid history stays with the other account. This is only offered while the store is not connected.
- Improved: Connect now sends the store’s identifier to Optogrid, so Optogrid can tell you before you approve that the store belongs to another account.
0.1.7
- Fixed: the PD photo step no longer says “Our AI will measure your pupillary distance automatically.” The photo is measured after it is uploaded, so the step now says it will be used to measure the shopper’s PD.
- Improved: the PD photo tips now cover the rules that matter most for an accurate measurement: a helper about 1 m (3 ft) away or the phone at full arm’s length (never closer), the phone upright at eye level, light from the front, head straight. They end with a link to an illustrated photo guide, which opens in a new tab. Stores in Portuguese link to the Portuguese guide.
- Fixed: an image that is too wide or too tall is now described as such, instead of “This doesn’t look like a photo of a face”. The plugin does not check faces at upload.
0.1.6
- New: support for the Optogrid free plan allowance. Photo upload and PD photo capture now work on every Optogrid plan. On the free plan, a store can open 5 customer photos for measuring in any 30 days; Premium removes the limit. The Optogrid tab in Settings shows how many free photos you have used and how many are waiting, with an upgrade link. An admin notice appears only when photos are waiting and the allowance is used up. Plan status refreshes on Test Connection, right after connecting, and hourly in the background.
- Shoppers never see plan or account state. If the store’s Optogrid account cannot accept an upload (for example, invalid credentials or a cloned site), the builder removes the upload option, switches the shopper to manual entry, and shows a neutral message.
- Orders: a PD photo deleted unopened after 30 days is marked Expired, and a photo waiting on the plan allowance is flagged. Each adds one order note, and the order meta box offers the manual PD form for both. An expired photo never triggers a retake email to the shopper.
- Fixed: connecting a store through OAuth after using mock mode left the plugin in mock mode. The Optogrid tab showed “Connected” while every call still returned mock responses. Connecting now always switches to live mode.
- Fixed: Premium stores saw a “free plan: measurements disabled” notice in the Optogrid tab.
0.1.5
- Hardening: the two REST routes that cannot use a capability or nonce check — the Optogrid webhook and the tokenized PD re-upload link — now verify their credential (an HMAC-SHA256 signature and an order-bound expiring token) in the route’s permission callback, so an unauthenticated request is rejected before the handler runs.
- Hardening: the builder’s add-to-cart payload is sanitized after JSON decoding, and the nonce carried inside it is sanitized before it reaches wp_verify_nonce().
- Hardening: every remaining variable output in PHP is now escaped at the point of output, including the Rx/PD summary in the admin order email, which carries a shopper-supplied file name.
0.1.4
- Compliance: all plugin CSS and JavaScript is now delivered through the WordPress enqueue API instead of inline tags.
- Docs: corrected the free-vs-paid description. Prescription document upload requires a connected Optogrid account (the document is stored there), which earlier wording incorrectly listed as working without an account. Also documented the two fields the Optogrid service can send back (a replacement API address and a service notice), and the build recipe for reproducing /build/ from the shipped /src/.
- Mock (development) mode is hidden on production installs. It remains available on local, development and staging environments, or by defining OPTOGD_ALLOW_MOCK_IN_PROD.
- Translations are no longer bundled; they are delivered by translate.wordpress.org once available.
- Plugin renamed to “Optogrid Eyeglasses for WooCommerce”.
- Fixed: the lens journey configuration was read on plugins_loaded, which loaded translations before init. On any locale with a translation installed this produced a “translation loading was triggered too early” notice on every request, and with WP_DEBUG display enabled it could print before headers were sent and block login.
0.1.3
- Security: bind the Optogrid connection to the site it was established on. A staging clone or migrated copy carrying live credentials now pauses all Optogrid calls until it is reconnected on the new address, protecting the original store’s tenant and connection.
0.1.0
- Initial release.
- Configurable multi-step lens builder.
- Rx capture via form fields and document upload.
- PD measurement via manual entry and Optogrid photo analysis.
- Visual flow builder for lens journey configuration.
- Dynamic pricing with per-option deltas.
- WooCommerce HPOS and block checkout compatibility.
Follow this listing's changes (Atom feed)