Payments are in test mode. Use card 4242 4242 4242 4242 with any future expiry and any CVC.
01582 932 444 training@ozonegroup.training

Admin Workflow & Zoho Creator Integration

Operational workflow for managing course dates between Zoho Creator (master database) and WooCommerce (e-commerce front). The site already ships with a live WooCommerce server layer — once connected, products, variations, orders, and webhooks flow end-to-end.

0. What's already wired in this app

  • Server functions in src/lib/courses.functions.ts: listCourses, getCourseWithDates, placeOrder. They call WooCommerce via the Lovable connector gateway, with automatic fallback to mock data until the store is connected.
  • WooCommerce webhook receiver at /api/public/woocommerce/webhook (HMAC-SHA256 verified). Handles order.completed, processing, failed, cancelled.
  • Zoho Creator push via src/lib/zoho-creator.server.ts. Set ZOHO_CREATOR_WEBHOOK_URL (and optionally ZOHO_CREATOR_AUTH_TOKEN) in project secrets.
  • Customer & admin emails stubbed in src/lib/order-emails.server.ts — ready to plug into Lovable Emails.

Required secrets

  • WOOCOMMERCE_API_KEY + LOVABLE_API_KEY — auto-injected when the WooCommerce connector is linked.
  • WOOCOMMERCE_WEBHOOK_SECRET — paste the same value into Woo → Settings → Advanced → Webhooks → Secret.
  • ZOHO_CREATOR_WEBHOOK_URL — your Creator REST API form workflow URL.
  • ADMIN_ALERT_EMAIL — where failed-order alerts are sent.

1. Recommended WooCommerce Setup

  • Product type: Variable Product — one product per course, one variation per date.
  • Categories: Domestic, Commercial, Guided Learning.
  • Attribute: "Course Date" (used to create variations).
  • Stock: manage stock per variation = available spaces.
  • Recommended plugins: WooCommerce, WooCommerce Stripe Gateway, WooCommerce PDF Invoices & Packing Slips, YITH WooCommerce Bookings, WooCommerce Subscriptions (optional), Elementor + Elementor Pro.

2. Zoho Creator as Master Database

A single Courses form in Zoho Creator stores authoritative data:

FieldType
Course NameLookup
Course DateDate
VenueText
TrainerLookup
Available SpacesNumber
WooCommerce Product IDNumber
WooCommerce Variation IDNumber
Booking StatusPicklist (Open, Full, Cancelled)

3. Adding a New Course Date

  1. Staff opens Zoho Creator → Courses form.
  2. Adds new record with course, date, venue, trainer, spaces.
  3. A Deluge workflow fires POST /wp-json/wc/v3/products/<product_id>/variations via WooCommerce REST API.
  4. WooCommerce returns the new variation ID — Deluge writes it back into the Zoho record.
  5. The variation is automatically visible on the course page and calendar.

4. Removing Expired Dates

A scheduled Zoho Creator workflow runs daily:

  1. Selects all course records where Course Date is before today.
  2. For each, calls PUT /wp-json/wc/v3/products/<id>/variations/<vid> with status: private to hide it.
  3. Updates booking status to "Closed" in Zoho.

The course page filter (date ≥ today) also hides expired dates client-side.

5. Updating Spaces After a Booking

A WooCommerce webhook (Order Created) is registered to a Zoho Creator REST endpoint:

  1. WooCommerce sends order payload including variation ID and qty.
  2. Zoho Creator finds the matching course record by Variation ID.
  3. Decrements Available Spaces by qty.
  4. If spaces reach 0, status is set to "Full" and the WooCommerce variation stock is set to 0.

6. Daily Sync Safety Net

A nightly Zoho schedule re-pushes all open course dates to WooCommerce to correct any drift. Conflicts are logged in a Sync Log form for staff review.

7. Roles

  • Course Admin — creates and edits course dates in Zoho.
  • Finance — manages WooCommerce orders, refunds, coupons.
  • Trainer — read-only access to upcoming dates and attendee list.