Skip to content

Automation

SpecCart includes powerful automation features to streamline your prescription lens workflow and reduce manual intervention.

SpecCart automates these key processes:

  1. Auto-Hold: Orders awaiting prescriptions automatically placed on hold
  2. Auto-Release: Verifying a prescription moves an order SpecCart is holding for it to Processing
  3. Reminder Scheduling: Automatic prescription reminder emails at set intervals
  4. Auto-Cancel: Automatic cancellation of long-abandoned orders, on unless you turn it off
  5. Lab Email Notifications: Auto-send order details to lab on verification
  6. Fitting Photo Links (Measurements module): Emailed when an order with a fitting height to be sent later reaches Processing

When a customer selects “Send Later” for their prescription, SpecCart automatically:

  1. Sets Order Status: Changes order to On hold immediately after payment
  2. Generates Magic Link: Creates secure 7-day upload token
  3. Sends Initial Reminder: Emails customer with magic link and upload instructions
  4. Sets Metadata: Flags order as awaiting prescription
  5. Adds Order Note: Documents hold reason for staff reference

The auto-hold process:

Customer Checkout (Send Later)
↓
Payment Complete
↓
SpecCart Intercepts Status Change
↓
Generates Magic Link Token
↓
Sets Order Status: On Hold
↓
Sends Initial Reminder Email
↓
Adds Order Note

SpecCart prevents payment gateways from overriding the On hold status:

  • Standard gateways: Prevented from setting “Processing” or “Completed” on a Send Later order
  • Cash on Delivery: Forced to “On hold” for send-later orders
  • Direct bank transfer and cheque: WooCommerce holds these orders until the payment arrives, and a verify leaves them On hold (see below)

This ensures orders stay held regardless of payment method. Other lens orders are never moved straight to “Completed” by a gateway: they go to “Processing”.

Section titled “When a Prescription Arrives Through an Upload Link”

The customer’s emailed link opens a secure upload page at /prescription-upload/. There they can:

  • Upload File: a JPG, PNG or PDF of up to 5MB, dragged in or chosen (Take Photo on a phone). With AI extraction switched on the file is read, and the customer checks the values before submitting. Without it the file is not read, and the customer picks their PD from a list (“Your prescription is uploaded. Please add your PD to continue.”) and clicks Submit Prescription
  • Enter Manually: type the prescription, with the same ranges as the wizard

Under the default PD requirement, Required, must be filled in, a PD is required on every route: the submit is held with “Please enter your PD to continue.” until there is one. Under Optional the customer can submit without one (the upload notice reads “Your prescription is uploaded. Add your PD if you know it.”), but half of two PD values is held with “Enter both PD values, or untick the box, to continue.” and a typed prescription that is all 0.00 with “Enter your prescription, even if it is 0.00, to continue.” Under Required with a default each PD list on the page rests on “63 (average)” with “63 is an average PD, not your own. If you know yours, choose it from the list, even if it is 63.” under it, the upload shows no PD notice, and the submit is not held for a single PD: a list the customer leaves alone is recorded as the shop’s default, and a single 63 they choose is recorded as their own. See Prescription settings. If a file cannot be read, or the read comes back with every value empty, the page says “We couldn’t read your prescription. Upload a clearer photo or choose Enter Manually to type it in.”; if a link has had its five uploads, “Too many uploads for this link. Try again in an hour, or choose Enter Manually to type it in.”; if the upload fails, “Your prescription was not uploaded. Check your connection and upload it again.”; if the submit fails, “Your prescription was not sent. Check your connection and submit it again.”

A link works once and for 7 days. An expired link shows Link Expired with a Request a New Link form, where the customer enters their email address and order number to be sent a new link. An address can request three links an hour, and each link takes five uploads an hour, counted from the first one.

When the prescription is submitted:

  1. The prescription is attached to the order and its status becomes Received
  2. The link is marked used
  3. The order gets the note “Prescription received via secure upload link.” If prism entry is switched on and the prescription shows a prism, it also gets “The uploaded prescription shows a prism. Check it before making the lenses.”
  4. The order status follows the setting When a prescription arrives through an upload link at SpecCart > Settings > Prescription:
    • Move the order to Processing at once (the default): an order On hold moves to Processing. The customer reads “We have your prescription. Your order is now being processed.”
    • Keep the order On hold until staff have checked it: the order stays On hold until staff verify the prescription. The customer reads “We have your prescription. Our team will check it, then your order will be processed.”

When an admin verifies a prescription, SpecCart automatically:

  1. Checks Order Status: Confirms order is currently On hold
  2. Verifies Hold Reason: Confirms SpecCart is holding it for its prescription (not other reasons)
  3. Checks Payment: Ensures order is fully paid
  4. Releases Order: Changes status to Processing, and WooCommerce sends the customer its processing email
  5. Clears Flags: Removes “awaiting prescription” metadata

The Prescription Verified email goes to the customer on every verify, whether or not the order moves.

Auto-release only occurs when all of these are true:

  • Order status is On hold
  • SpecCart is holding it for its prescription: a Send Later order still awaiting it (_speccart_awaiting_prescription = yes), or an order kept On hold after its prescription arrived through an upload link (_speccart_prescription_hold = yes)
  • Prescription is marked as verified
  • Order payment has been received, or the order is Cash on delivery

The check is made before the verify is saved, so it works the same from the order screen, the Prescriptions screen and the Mark Rx Verified bulk action. An order On hold for any other reason, such as a hold staff set by hand, is verified and stays On hold.

If prescription is verified but payment is pending (a bank transfer or cheque, say):

  1. Order remains On hold
  2. Order note added: “Prescription verified but order still needs payment. Will process once paid.”
  3. SpecCart does not release it later: set the order to Processing once the payment has arrived
  4. The Prescription Verified email is still sent

Reminders are sent automatically on a scheduled basis.

Default reminder intervals:

  • Day 0: Initial reminder (sent immediately when order placed)
  • Day 7: Second reminder
  • Day 14: Third reminder

After the third reminder, no additional automatic reminders are sent. Manual reminders count towards the three.

  1. Daily Cron Job: First scheduled for 9:00 AM the day after activation, then daily
  2. Query Orders: Finds orders On hold or Pending payment with _speccart_awaiting_prescription = yes and no verification
  3. Calculate Days: Determines days since hold date (or order date)
  4. Check Counter: Reads current reminder count from order meta
  5. Send if Due: Sends reminder if days match schedule and counter matches
  6. Increment Counter: Updates reminder count in order meta when the email is sent

Each reminder includes:

  • Customer’s order number
  • Magic link for secure upload (a new 7-day link each time; the previous link stops working)
  • An invitation to reply to the email with a photo or scan of the prescription
  • Order details

Reminders use WordPress cron:

Event: speccart_send_prescription_reminders Frequency: Daily Time: 9:00 AM Next Run: Shows in Tools > Cron Events (with WP Crontrol plugin)

To verify cron is working:

  1. Install WP Crontrol plugin
  2. Navigate to Tools > Cron Events
  3. Find speccart_send_prescription_reminders
  4. Check “Next Run” timestamp
  5. Click “Run Now” to test manually

Orders where customers never send prescriptions are cancelled automatically.

Auto-cancel is on unless the database option says otherwise. There is no settings screen for it. To turn it off:

update_option( 'speccart_auto_cancel_enabled', 'no' );
  • Enabled: Default is enabled
  • Cancel After: 30 days without prescription
  • Applies To: Only orders On hold or Pending payment with _speccart_awaiting_prescription = yes
  • Cron Schedule: Daily at 10:00 AM
  1. Daily Cron: Runs at 10:00 AM
  2. Query Orders: Finds orders on hold awaiting prescription
  3. Check Age: Calculates days since order placed or hold date
  4. Cancel if Old: Changes status to Cancelled if ≥30 days
  5. Add Metadata: Flags order as auto-cancelled with timestamp
  6. Trigger Email: WooCommerce sends its cancelled order email

Order note added:

Order auto-cancelled - No prescription received after 30 days.

Auto-cancel does not automatically refund payments. Store owner must:

  1. Review cancelled orders periodically
  2. Process refunds manually via WooCommerce
  3. Or configure auto-refund via WooCommerce settings

SpecCart sends order details to your lab when staff click Send to lab on the Prescriptions screen, and, if you choose, when prescriptions are verified.

Configure lab email settings at SpecCart > Settings > General, under Lab email settings:

  • Lab email addresses: One or more addresses the lab PDFs are sent to
  • Auto-send to lab when prescription is verified: Email the lab automatically when staff verify a prescription
  • Email subject: Placeholders {order_number}, {customer_name} and {order_date}

When a prescription is verified with auto-send switched on:

  1. Trigger: Prescription verification action fires
  2. Check: Skipped if no lab addresses are set or the order has already been sent to the lab
  3. PDF Generated: A lab PDF is generated for each lens item that does not already have one
  4. Email Sent: Sent to configured lab email address(es) as a plain-text email with the PDFs attached
  5. History Tracked: The order note “Lab order email sent to: [addresses]” is added, and the Prescriptions screen shows when and by whom it was sent

If an automatic send fails, the order gets the note “Auto-send lab email failed: [reason]”.

Each lens item’s lab PDF holds:

  • Order number, date and customer details
  • Frame and lens details (usage, varifocal type, colour, package, add-ons)
  • The prescription for each eye: SPH, CYL, AXIS, prism, ADD (Int) and ADD (Near)
  • Measurements for each eye: PD Dist, PD Near and Height
  • The prescription’s notes

The PD is read from the order: two PD values print as the customer gave them, right and left. A single PD prints against each eye according to Single PD on the lab PDF at SpecCart > Settings > Prescription, Lab PDF:

  • Half against each eye (31.5 and 31.5), the default
  • The whole PD against each eye (63 and 63)

When the line has no PD, No PD given is printed under the measurements table, and when the PD is the shop’s default (see Prescription settings), “Shop default, not chosen by the customer” is printed there in the same small text, and the PD cells print 63 as for any PD. Neither line is printed together with the other, and a PDF made before staff add a PD is remade when they save it.

The near PD prints the same way when the order has one; otherwise the PD Near cells repeat the distance PD. With the Measurements module switched on, Height carries the segment height for the order’s PD from the fitting photo; it is blank otherwise.

An existing PDF is reused, so after editing a prescription click Regenerate PDF on the Prescriptions screen before sending. A fitting photo arriving through a link rebuilds the PDF by itself.

Magic links are automatically managed:

Tokens are generated:

  • When customer selects “Send Later” (initial order)
  • With every reminder from the daily check
  • When admin clicks Regenerate & Email New Link (shown once the link has expired)
  • When the customer requests a new link from the expired-link page

Each new token replaces the previous one, which stops working.

  • Expiration: 7 days from generation
  • Status: Tracked as Active, Expired, or Used
  • Regeneration: A new link is sent with each reminder from the daily check

Tokens include:

  • Cryptographically random string, stored only as a hash
  • Order ID association
  • Expiration timestamp
  • Single-use flag (marked used after upload)

Opening the page with a wrong or used link is limited to ten failed tries per visitor in five minutes.

With the Measurements module switched on, when an order reaches Processing and a varifocal, bifocal or occupational line’s fitting height was left to be sent later, the customer is emailed one link per such line to take the fitting photo. This happens once per order. If the email cannot be sent, the order gets the note “The fitting photo email could not be sent to [email]. Check the shop’s email settings.”

Track automation performance:

View at SpecCart > Prescriptions:

  • Orders by prescription status, with a count of those pending
  • Days each prescription has been waiting
  • Whether each order has been sent to the lab

Each order stores automation metadata:

  • _speccart_awaiting_prescription: Yes/no flag
  • _speccart_prescription_hold: Kept On hold after an upload link arrival, until verified
  • _speccart_prescription_reminder_sent: Reminder count
  • _speccart_prescription_reminder_dates: Array of send dates
  • _speccart_hold_date: When order was held
  • _speccart_initial_reminder_sent: Initial reminder flag
  • _speccart_auto_cancelled: Auto-cancel flag
  • _speccart_lab_email_sent: When the order was sent to the lab
  • _speccart_fitting_links_sent: Fitting photo links sent (Measurements module)

Check these issues:

  1. Cron not running: Verify WordPress cron is active
  2. Event not scheduled: Check Tools > Cron Events
  3. Email disabled: Check WooCommerce > Settings > Emails > Prescription Reminder
  4. Order not flagged: Verify _speccart_awaiting_prescription = yes in order meta
  5. Reminder limit reached: Check reminder count (three, the first and any manual ones included)

If orders stay On hold after verification:

  1. Payment incomplete: Check order payment status
  2. Hold reason different: Verify order was held by SpecCart for its prescription
  3. Upload link setting: Under Move the order to Processing at once, an order whose prescription came through a link has usually moved already; check its notes
  4. Order notes: Look for “Prescription verified but order still needs payment. Will process once paid.”

If orders don’t hold automatically:

  1. Payment gateway override: Check gateway priority
  2. Hook conflict: Disable other order status plugins
  3. Send Later not detected: Verify prescription method in order meta
  4. Already verified: Check if prescription marked verified during checkout

If WordPress cron is unreliable:

  1. Disable WP cron: Add to wp-config.php:
    define('DISABLE_WP_CRON', true);
  2. Set up server cron: Add to crontab:
    Terminal window
    */15 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
  3. Verify timing: Check cron runs consistently
  4. Monitor logs: Install WP Crontrol to view execution history

Recommended automation setup:

  1. Check the defaults: Auto-hold, release on verify and reminders always run; auto-cancel runs unless you turn it off
  2. Configure email templates: Customise reminder content
  3. Set up monitoring: Check the Prescriptions screen daily
  4. Test workflow: Create test orders through complete cycle
  5. Train staff: Ensure team understands automation behaviour, in particular that Verify can move an order to Processing and send the customer’s processing email

For reliable reminder delivery:

  1. Use SMTP plugin: Configure transactional email service
  2. Authenticate domain: Set up SPF, DKIM records
  3. Monitor bounces: Check email logs for failures
  4. Test spam scores: Send to various email providers
  5. Avoid spam triggers: Review email content

Set expectations with customers:

  1. Checkout notice: Inform about reminder schedule
  2. Order confirmation: Explain prescription requirement
  3. Reminder emails: Include support contact information
  4. Cancellation warning: Notify of auto-cancel policy (if enabled)