← API Index · How to use components
profile component #oo-profile
This component handles the profile of a visitor (guest) or customer. Similar to the logon component it has three states:
- anonymous — nothing known about the visitor
- located — we know on which tour this visitor will be served
- authenticated — logged on customer (implies located)
The component provides:
- in anonymous state: finding the address to figure out the location (tour or depot, with a map of the delivery area)
- in located state: changing the location (and picking a delivery date), and the registration form
- in authenticated state: viewing and manipulating the profile sections — personal data, delivery settings, payment, subscriptions, delivery pauses, denials, favourites, last orders (incl. invoices and revocation), newsletter / waiting list, account removal
- an estimated arrival time of the driver on the delivery day
- it manages the browser history state for the individual data sections
How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.
<div id="oo-flash"></div>
<div id="oo-profile" data-oo-shop-page="shop.html" data-oo-logon-page="logon.html" data-oo-cart-page="cart.html"></div>
component switches
Page switches
| Switch | Default | Description |
|---|---|---|
oo-shop-page |
– | When continuing to shop (after registration, from the "shop" links, and from items in the last orders). |
oo-logon-page |
– | When "I am already a customer" is clicked. |
oo-cart-page |
– | If the cart is loaded, one is sent to the cart after a registration; also the target of "to cart" links in the profile. |
oo-date-page |
– | Page hosting the date component; target after a subscription change that requires a new delivery date, and of the "calendar" link in warnings about existing orders. |
oo-register-page |
– | Page to continue on after a successful address lookup in anonymous state (the page with the registration form, usually the profile page itself). |
oo-loggedout-page |
– | Page to go to after the customer removed their account. |
oo-revoke-page |
– | Page hosting the cancel form (revocation) — linked from the last orders with the order id appended as ?oid=. |
oo-subscribe-page |
– | Page with the newsletter / waiting list subscription, used by the "waiting list" button if the backend does not configure a waiting list or newsletter page. |
Locating and tour selection
| Switch | Default | Description |
|---|---|---|
oo-skip-locate |
false |
true implies the new customer tour; no location gathering requests and interactions are done. See also the logon component. |
oo-logonmode |
– | email1st: the e-mail is requested first; the registration form is rearranged for that flow. No dash in the name — global option, see the logon component. |
oo-profile-select |
radio |
select uses two select boxes (tour and first date) instead of radio buttons for the selection of tours and dates. |
oo-profile-str-req |
false |
true requires a street before the address can be validated (on changes and new registrations). Otherwise city or zip are enough. |
oo-profile-shop-tours |
– | Comma separated list of shop numbers (1, 2, 3) whose tours are offered to new customers, if several shops are connected to one backend. Default is the backend's setting for this shop, otherwise all. |
oo-profile-hide-tours |
false |
true: if depots are available and enabled, don't offer any individual tours for new registrations. |
oo-profile-prefer-depot |
false |
true places the default selection on the depots for new registrations. |
oo-profile-depot-sort |
true |
Sorting of depots during registration: true lists by distance, false by next delivery date. |
oo-profile-depot-dates |
1 |
Number of options (dates per depot) shown when depots are relevant. |
Registration form
| Switch | Default | Description |
|---|---|---|
oo-profile-tabs |
true |
false doesn't use the tabbing mechanism on the registration form; all fieldsets are shown at once. |
oo-profile-tabs-strict |
false |
true prevents moving forward if the currently displayed form is not complete. |
oo-profile-quickorder |
false |
true: the last registration step happens in the cart component instead of the profile component (if something is in the cart). This removes one step in the registration process and implies oo-profile-tabs-strict. Ignored if PayPal is enabled for the shop. |
oo-profile-note_len |
– | Maximum length of the storage / delivery note. Some parcel services limit this to 35 characters. Default is the field's own maxlength. |
oo-profile-passwd-req |
false |
true requires the new customer to set a password during registration. By default the password is optional: an empty field is accepted and a random password is assigned on registration (the customer can set one later in the profile or via the password reset). With oo-profile-quickorder the cart's password field obeys the same switch — set it globally (or as a backend Component switch) if the cart lives on another page. |
Profile editing
| Switch | Default | Description |
|---|---|---|
oo-profile-aboedit |
true |
false disables changing the subscription details (amount, period) for the customer. |
oo-profile-aboedit-tour |
false |
true (with oo-profile-aboedit) also allows changing the delivery tour (delivery point) of a subscription, if the customer has more than one tour. |
debug options
Debug scope profile (enable with data-oo-debug="true" on the element or debug:profile:<term>+, see the skill):
| Term | Description |
|---|---|
profile:all |
General debug output (mode and switches, state changes, locating, page changes). |
profile:d |
Driver / delivery state: arrival time prediction for the delivery day. |
Related scopes that are not component switches but cover large parts of this component (enabled the same way, e.g. debug:pf:pay+):
| Scope | Terms | Description |
|---|---|---|
pf |
all, history, pay, pause, last, abo, adr |
Profile forms: browser history of sections, payment fields, delivery pauses, last orders, subscription editing, address editing. |
ph |
all, cap |
Tour / depot lookup; cap reports tours marked full (capacity). |