Title: Rexivue Lens Prescription for WooCommerce
Author: vishvajit424
Published: <strong>October 4, 2026</strong>
Last modified: October 4, 2026

---

Search plugins

![](https://ps.w.org/rexivue-lens-prescription/assets/banner-772X250.png?rev=3727773)

![](https://ps.w.org/rexivue-lens-prescription/assets/icon-256x256.png?rev=3727773)

# Rexivue Lens Prescription for WooCommerce

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

[Download](https://downloads.wordpress.org/plugin/rexivue-lens-prescription.1.3.0.zip)

 * [Details](https://wordpress.org/plugins/rexivue-lens-prescription/#description)
 * [Reviews](https://wordpress.org/plugins/rexivue-lens-prescription/#reviews)
 *  [Installation](https://wordpress.org/plugins/rexivue-lens-prescription/#installation)
 * [Development](https://wordpress.org/plugins/rexivue-lens-prescription/#developers)

 [Support](https://wordpress.org/support/plugin/rexivue-lens-prescription/)

## Description

Rexivue Lens Prescription adds a prescription table to WooCommerce product pages,
built for contact lenses and similar optical products.

Rexivue is an independent plugin. It is not affiliated with, or endorsed by, WooCommerce
or Automattic.

For each product you choose:

 * Which eyes to ask about: left (OS), right (OD) or both.
 * Which powers to ask for: SPH, CYL and/or AXIS, each with its own list of allowed
   values.
 * Whether customers may attach a prescription image or PDF.

On the product page the customer picks values and the number of boxes for each eye.
The cart quantity becomes the total number of boxes (left + right), and WooCommerce
charges its normal product (or variation) price for each box. The prescription is
shown in the cart, mini-cart, checkout and order, and is saved on the order line
item.

#### Features

 * Per-product configuration in a “Prescription” tab of the product data box (simple
   and variable products).
 * SPH / CYL / AXIS dropdowns per eye, with admin-defined value lists.
 * AXIS is only enabled when a non-zero CYL is selected (positive or negative).
 * Number of boxes per eye (1–10 by default); cart quantity = total boxes.
 * Live “total for selected boxes” using the store’s currency format; variation 
   prices update automatically.
 * Optional prescription upload (JPG, PNG, GIF, WebP or PDF), stored privately.
 * Works with the classic cart/checkout and the Cart and Checkout blocks.
 * Compatible with High-Performance Order Storage (HPOS).
 * “Order again” re-uses the original prescription when it is still valid.
 * Works with themes that add to cart over AJAX on the product page.
 * Translation-ready.

#### How pricing works

The plugin never sets or reads a price from the browser. The line quantity is set
on the server from the validated number of boxes, and WooCommerce multiplies its
own product price by that quantity, so taxes, coupons and currency plugins behave
as normal.

#### Security

 * Every submitted value is checked on the server against the product’s configured
   options. Anything else is rejected with an error message.
 * Box counts must be whole numbers from 1 to the maximum.
 * The quantity is locked to the number of boxes in the classic cart, the Cart block
   and the Store API, and re-checked before checkout.
 * Variation IDs must belong to the product being added.
 * Admin saves are protected by a nonce and the `edit_product` capability.
 * Uploaded prescriptions are checked for real file type and size, stored under 
   random names in `wp-content/uploads/rexivue-prescriptions/`, and can only be 
   downloaded by users with the `edit_shop_orders` capability through a nonce-protected
   link on the order screen.

### Configuration

**Product > Product data > Prescription**

 * **Left eye (OS) / Right eye (OD)**: show the prescription table and ask for values
   for that eye. At least one eye must be enabled for the table to appear.
 * **SPH / CYL / AXIS**: tick to ask for the value, then list the allowed options
   separated by `|`, in display order. Example: `-0.50|-0.75|-1.00|0.00|+0.50`. 
   A field that is ticked but has no options is not shown.
 * **Prescription upload**: let customers attach an image or PDF.

**WooCommerce > Settings > Products > Prescription fields**

 * **Maximum upload size (MB)**: default 5 MB, never more than the server allows.
 * **Delete data on uninstall**: see “Uninstall” below.

### Hooks

#### Filters

 * `rexivue_product_config( array $config, WC_Product $product )`: the normalised
   configuration of a product.
 * `rexivue_max_boxes( int $max = 10, WC_Product $product )`: maximum boxes per 
   eye.
 * `rexivue_is_field_required( bool $required = false, string $field, string $eye,
   array $clean, array $config, WC_Product|null $product )`: make SPH/CYL/AXIS mandatory.
 * `rexivue_validation_errors( WP_Error $errors, array $prescription, array $config,
   WC_Product|null $product )`: add store-specific validation rules.
 * `rexivue_upload_mimes( array $mimes )`: accepted upload types (images and PDF
   by default).
 * `rexivue_pending_upload_lifetime( int $seconds = 604800 )`: how long an upload
   that never reached an order is kept.
 * `rexivue_add_to_cart_selectors( string[] $selectors )`: add-to-cart buttons the
   script handles.
 * `rexivue_buy_now_selectors( string[] $selectors )`: separate Buy Now buttons.
 * `rexivue_native_submit( bool $native = true )`: submit the product form natively(
   bypasses theme AJAX add-to-cart).

#### Actions

 * `rexivue_loaded( Rexivue\LensPrescription\Plugin $plugin )`: after the plugin
   has registered its hooks. Components are available through `$plugin->get( 'cart')`,`
   get( 'order' )`, `get( 'frontend' )`, `get( 'uploads' )` and `get( 'admin' )`.
 * `rexivue_cleanup_pending_uploads`: daily cron event that removes abandoned uploads.

#### Shortcodes

None.

### Data stored

Everything the plugin stores uses the `rexivue` prefix.

Product meta:

 * `_rexivue_left_eye`, `_rexivue_right_eye`: `yes` when the eye is enabled.
 * `_rexivue_sph_enabled`, `_rexivue_cyl_enabled`, `_rexivue_axis_enabled`: `yes`
   when the field is enabled.
 * `_rexivue_sph_values`, `_rexivue_cyl_values`, `_rexivue_axis_values`: allowed
   options separated by `|`.
 * `_rexivue_upload_enabled`: `yes` when uploads are enabled.

Order line item meta:

 * Visible (shown with translated labels): `rexivue_left_sph`, `rexivue_left_cyl`,`
   rexivue_left_axis`, `rexivue_left_boxes`, the same four for `right`, and `rexivue_prescription_file`(
   original file name).
 * Hidden: `_rexivue_prescription` (structured copy), `_rexivue_prescription_file`(
   stored file name), `_rexivue_prescription_file_name` (original file name).

Options: `rexivue_db_version`, `rexivue_max_upload_mb`, `rexivue_delete_data_on_uninstall`.

Cart item data: `rexivue_prescription` (array with `prescription`, `file` and `uid`).

Files: `wp-content/uploads/rexivue-prescriptions/pending/` (in carts) and `/orders/`(
attached to orders).

### Uninstall

Deactivating the plugin never deletes data.

When the plugin is deleted it always removes its scheduled event and data-version
option. If **Delete data on uninstall** is enabled it also removes its settings,
the prescription meta on products and variations, and uploads that never became 
part of an order.

Orders, order item meta and prescription files attached to orders are never deleted,
because they are business records. Remove them manually if your data-retention policy
requires it.

## Screenshots

[[

[[

[[

## Installation

 1. Make sure WooCommerce 8.2 or newer is installed and active.
 2. Upload the `rexivue-lens-prescription` folder to `/wp-content/plugins/`, or upload
    the zip under Plugins > Add New > Upload Plugin.
 3. Activate the plugin.
 4. Edit a product, open the **Prescription** tab and enable the eyes and fields you
    need.

#### Switching from an earlier build

Earlier private builds of this plugin were named “YLS Product Custom Fields” or “
Optical Custom Fields”. To switch:

 1. Deactivate the earlier build.
 2. Install and activate Rexivue Lens Prescription. On activation it copies each product’s
    prescription settings into its own prefixed keys. Orders, carts and prescription
    files from the earlier build stay readable.
 3. Check a product page, then delete the earlier build.

While an earlier build is active, Rexivue pauses itself and shows a notice on the
Plugins screen, so the prescription table is never shown twice.

#### Nginx

The upload directory is protected with an `.htaccess` file on Apache and LiteSpeed.
On Nginx add a rule like this to your server block, then reload Nginx:

    ```
    location ^~ /wp-content/uploads/rexivue-prescriptions/ { deny all; return 403; }
    ```

Files also use random, unguessable names, but the rule above is strongly recommended.

## FAQ

### Are SPH, CYL and AXIS mandatory?

No. By default only the number of boxes is required for each enabled eye. Use the`
rexivue_is_field_required` filter to make fields mandatory.

### Can customers change the quantity in the cart?

No. The quantity of a prescription line always equals its number of boxes. To change
it, the customer removes the line and adds the product again.

### Why do catalogue “Add to cart” buttons say “Select options”?

A prescription can only be entered on the product page, so shop and category buttons
for prescription products link there instead of adding to cart directly.

### Does “Buy Now” work?

A separate Buy Now button provided by your theme is validated first and then left
to its own handler. If that handler adds to cart over AJAX without sending the form
fields, the server will reject the request because the prescription is missing. 
Contact your theme author or use the normal Add to cart button.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Rexivue Lens Prescription for WooCommerce” is open source software. The following
people have contributed to this plugin.

Contributors

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

[Translate “Rexivue Lens Prescription for WooCommerce” into your language.](https://translate.wordpress.org/projects/wp-plugins/rexivue-lens-prescription)

### Interested in development?

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

## Changelog

#### 1.3.0

 * First release on WordPress.org as “Rexivue Lens Prescription for WooCommerce”.
 * All stored data, hooks, form fields and assets use the `rexivue` prefix.
 * Settings from earlier private builds are copied automatically on activation; 
   their orders, carts and files stay readable.
 * Admin notices are shown only on the Plugins screen.
 * Server-side validation of every prescription value against the product’s options;
   tampered values are rejected.
 * Prescription uploads restricted to images and PDF with a size limit, stored privately
   under random names, downloadable only by order managers.
 * Nonce and capability checks when saving product settings; all output escaped.
 * Cart quantity locked to the number of boxes in the classic cart, Cart block and
   Store API, and re-validated before checkout.
 * WooCommerce Cart and Checkout block support, HPOS compatibility, “Order again”
   support.
 * AXIS enabled for negative as well as positive CYL values.
 * Price preview uses the store’s currency format.

## Meta

 *  Version **1.3.0**
 *  Last updated **2 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.2 or higher **
 *  Tested up to **7.1.2**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [contact lenses](https://wordpress.org/plugins/tags/contact-lenses/)[optical](https://wordpress.org/plugins/tags/optical/)
   [prescription](https://wordpress.org/plugins/tags/prescription/)[product fields](https://wordpress.org/plugins/tags/product-fields/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/rexivue-lens-prescription/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/rexivue-lens-prescription/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/rexivue-lens-prescription/reviews/)

## Contributors

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

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/rexivue-lens-prescription/)