WP Manifestindependent plugin directory
manifest / ecommerce / amelia-wc-customer-link

Amelia WooCommerce Customer Link self-updates

Amelia WooCommerce Customer Link

by Abundant Designs · github.com/robertstaddon/amelia-wc-customer-link · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/robertstaddon/amelia-wc-customer-link/archive/refs/heads/main.zip

Ships its own WordPress updater (Update URI header), so new versions show up under Dashboard → Updates.

WordPress plugin by Abundant Designs that complements Amelia Booking when bookings go through WooCommerce.

Amelia can auto-create WordPress users for new Amelia customers. Returning customers, shoppers who already have a WooCommerce customer account, and other edge cases often leave Amelia’s externalId empty. This plugin heals those links at booking time and provides admin Settings and Tools for runtime create options, optional MailChimp subscribe on customer add, optional booking-widget birthday collection, and backlog repair. When an Amelia WooCommerce cart item is present, empty checkout billing fields (name, email, phone) are filled from the widget so Checkout Blocks match Amelia’s classic checkout prefill.

Requirements

  • WordPress 5.8+
  • PHP 7.4+
  • Amelia Booking (required)
  • WooCommerce (recommended; used for order user IDs, Tools context, and Checkout Blocks billing prefill)
  • Amelia MailChimp integration (optional; only needed for the MailChimp subscribe setting and for sending collected birthdays to MailChimp)
  • Amelia Custom Fields (optional; required for the birthday collection setting)

Installation

  1. Copy the amelia-wc-customer-link folder into wp-content/plugins/.
  2. Activate Amelia WooCommerce Customer Link.
  3. Ensure Amelia Booking is active (WooCommerce recommended).

What it does at runtime

Without replacing Amelia’s “automatically create Amelia Customer user” behavior (used for bookings/imports), this plugin:

  1. On WooCommerce Amelia checkouts, injects the order’s WordPress user ID into the booking payload before Amelia saves (when safe).
  2. Copies Amelia widget first name, last name, email, and phone onto empty WooCommerce billing fields so Checkout Blocks / Store API prefill like classic checkout. Existing logged-in billing and values the shopper already typed are left alone (always on; no Settings toggle).
  3. After bookings (appointments, events, packages, WC, and admin customer add), links the Amelia customer to an existing WP user by preferred order user ID or email.
  4. Adds the wpamelia-customer role when linking (keeps WooCommerce customer).
  5. When a WP/WC account is created later with the same email as an unlinked Amelia customer, links them.
  6. Expands Amelia’s WordPress user picker so WooCommerce customer users appear for manual linking.
  7. Optionally (Settings), when an Amelia customer is added with no WordPress user selected and no matching WP account exists, creates a WordPress user and links it. A separate setting controls whether to send the WordPress new-account notification email.
  8. Optionally (Settings), when an Amelia customer is added, subscribes them to Amelia’s configured MailChimp list using the same path as a checked frontend Subscribe checkbox. Requires Amelia MailChimp enabled, connected, and a list selected.
  9. Optionally (Settings), adds an optional Date of birth field to step-by-step and catalog booking widgets. The widget shows a native date input (browser year dropdown) instead of Amelia’s month calendar. For existing Amelia customers, Confirm copies customer.customFields onto native Date of birth (fill-if-empty, without overwriting). WooCommerce checkout does not show a birthday field. If the widget MailChimp Subscribe box is checked, Confirm PATCHes the member to subscribed, then PATCHes the audience’s birthday merge fields (MM/DD or Y-m-d as required). Unchecked Subscribe does not write MailChimp Birthday. Place order does not send it.

Safety skips:

  • WordPress user #1 (primary admin)
  • Users with administrator, wpamelia-manager, or wpamelia-provider
  • WP user IDs already used as another Amelia customer’s externalId

Auto-create, MailChimp subscribe on Amelia customer add, and birthday collection are off by default. Enable them under Amelia → Customer Link → Settings. Use Tools to create missing accounts for backlog cleanup (independent of the Settings toggles). Frontend bookings that already opt into MailChimp continue to use Amelia’s native integration.

Open Amelia → Customer Link.

Settings

  • Auto-create WordPress user — Create a WP user when an Amelia customer is created if one doesn’t already exist and no WordPress user was selected (opt-in; default off).
  • New-account email — Send the WordPress new-account notification when that auto-create runs (default on until changed).
  • MailChimp subscribe — Subscribe the new Amelia customer to Amelia’s MailChimp list on customer add (opt-in; default off). Independent of WordPress auto-create. When Mailchimp for WooCommerce is also active, AWCL marks the new WP user as subscribed there so MF WC sync does not demote the contact to Non-subscribed.
  • Birthday collection — Enable an optional Date of birth field on Amelia step-by-step and catalog booking widgets (opt-in; default off). Creates or reuses a customer Date Picker custom field; the widget uses a native date input so years like 1983 are easy to pick. For existing Amelia customers, copies the Confirm custom-field date onto native birthday (does not overwrite an existing birthday). WooCommerce checkout does not show a birthday field. MailChimp Birthday is sent only when the widget Subscribe box is checked (PATCH subscribed, then PATCH the audience birthday merge fields). Requires Amelia Custom Fields. Disabling this setting does not delete the custom field.

Linking to an existing WordPress user by email always runs when safe, regardless of these toggles. If Amelia’s picker already selected or created a WP user, that link is left alone.

Status

Shows Amelia/WooCommerce state, counts of unlinked customers that match (or lack) a WP account, and birthday custom field status when that setting is used.

Link by email

Dry-run or apply: set externalId and add wpamelia-customer for Amelia customers whose email matches a WordPress user.

Create missing WordPress users

Dry-run or apply: create WP accounts for Amelia customers with no email match, assign roles, set externalId. Optional checkbox to send WordPress new-user notification emails (off by default). Independent of the Settings auto-create toggles.

Hooks used

Hook Purpose
woocommerce_cart_loaded_from_session / woocommerce_add_to_cart Copy Amelia cart customer onto empty WC billing fields so Checkout Blocks / Store API prefill like classic checkout
wp_ajax_wpamelia_api / wp_ajax_nopriv_wpamelia_api (priority 1) On Amelia Confirm (call=/payment/wc), copy widget datepicker from customer.customFields onto native birthday (fill-if-empty) before Amelia’s handler; cache widget Subscribe for MailChimp
amelia_before_booking_added_filter Inject WC order user as externalId before save; copy widget birthday onto native birthday on Place order (fill-if-empty)
amelia_add_booking_to_wc_cart If Subscribe was checked on Confirm, PATCH MailChimp subscribed then the audience birthday merge fields
amelia_after_booking_added Heal after WC / frontend booking
amelia_after_appointment_booking_saved Heal appointment bookings
amelia_after_event_booking_saved Heal event bookings
amelia_after_package_booked_frontend Heal package bookings
amelia_after_customer_added Heal admin/API customer create; optional WP user create; optional MailChimp subscribe
user_register / woocommerce_created_customer Link when WP account appears later
amelia_get_wp_users_filter Include WooCommerce customers in Amelia’s picker

Filter: awcl_menu_capability (default amelia_read_settings) controls Customer Link page access. Filter: awcl_birthday_cf_label overrides the Date of birth custom field label used when creating the field. Filter: awcl_prefill_block_checkout (default true) can disable Amelia → empty billing prefill.

License

GPL-2.0-or-later