← API Index · How to use components

status component #oo-status

This component shows the user's or visitor's status. We differentiate

Component features:

One page can have only one status component.

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-status" data-oo-logon-page="logon.html" data-oo-cart-page="cart.html"></div>

component switches

Page switches

Switch Default Description
oo-logon-page – Page hosting the logon component. The logon and the logout links lead there; if not provided, the current page is not left.
oo-profile-page – Page hosting the profile component (regular link in the status bar, also used by .oo-status-profilelink elements anywhere on the page).
oo-date-page – Page hosting the date component ("all dates" link).
oo-cart-page – Page hosting the cart component (cart link, also used by .oo-status-cartlink elements, and the target after selecting a date that already has an open order).
oo-shop-page – Page hosting the shop component; items in the cart preview link directly to it.

Behaviour switches

Switch Default Description
oo-status-tourinfo false true embeds a tour status text (.oo-status-tourinfo) when in located state.
oo-status-cart-hover true false disables the mini cart overlay on mouse over (click only).
oo-status-profile-hover true false disables the profile overlay on mouse over.
oo-status-help true true shows a help icon (.oo-status-help) in the status bar, which is otherwise only accessible through the search bar.
oo-cartmode order Controls the background cart check: with cart, an existing order for the selected date is not loaded for re-editing. Best set globally — see the cart component.
oo-item-image-pi-size 40,40 Image size advice for the item images in the cart preview as w,h[,bg]. Shared with cart, search, shop and ticker.

States

State Description
auth Authenticated (.oo-status-auth elements are shown).
anon Anonymous, includes located (.oo-status-anon elements are shown).

External control

Items can be injected into the cart from your own JavaScript by triggering an event on the component:

if (oojq) oojq("#oo-status").trigger("oo-add2cart", {iid: '1340', amount: 1, unit: 'Stück', add: false});

(oojq denotes the shop's jQuery instance, available also in the init phase.)

Attribute Description
iid Item id.
amount Amount to set. 0 removes the position from the cart.
unit Unit name, as offered by the item.
add true adds to an existing amount in the cart, otherwise the amount is replaced.
note Optional cart position note.

debug options

Debug scope status (enable with data-oo-debug="true" on the element or debug:status:<term>+, see the skill):

Term Description
status:all General debug output (state changes, cart check, date selection).
status:events Click and cross-component events (logon/logout, date links, cart changed).
status:note Tour note / welcome-back popup decision and the data it is based on.