Skip to main content
When a buyer returns to the shop after a few days, they are no longer logged in, but the shop still knows who they were. The WelcomeBack function lets you make use of this: a personal greeting by name, a note about the last visit, and a way back into the customer account. The WC- tags build this greeting. Five tags are enough for this, because the shop configuration does the actual work. Reference: WelcomeCookie section in the shop configuration
All tags are permitted on all templates. You define which fields are available in the WelcomeCookie section of the shop configuration.

Two checks before the greeting

Before you display a name, two questions need to be answered: is the function switched on at all, and is there data for this visitor.
WC-Active queries a pure configuration setting. The bracketing is mainly useful during setup, because it immediately shows in the template whether the function has been enabled at all.
WC-Data only applies when two conditions are met at the same time: there is something in the cookie, and the visitor has not declared via the reset link that they are someone else. The previous documentation only mentions the first condition. After a click on the link, the range therefore stays silent, even though the cookie is technically still there.
If the function is switched off, all tags except WC-Active output nothing, and their bracketings do not apply. So you can also write the greeting block without {WC-Active}. The nesting does, however, make the intent in the template more readable.
WC-Data_ followed by the technical field name outputs the respective field.
You determine which fields exist in the WelcomeCookie section of the shop configuration via the Fields subsections and their AddressField parameter. There you enter the technical field names separated by commas, and exactly these names are what you then append to WC-Data_.
Only fields of the billing address are available. The shop system matches the names against the field definition of the billing address, other fields cannot be included. The previous documentation speaks generally of fields from the shop configuration.
A field name that is not configured is not reported as an invalid tag. The tag simply outputs nothing, and a bracketing around it hides its content. If a spot remains unexpectedly empty, first check the field name against the shop configuration.
WC-Data_LastLogin also works as bracketing, namely when a date is available. The previous documentation lists it only as a single tag. The bracketing is worthwhile, because for a visitor without a stored login date there would otherwise be a sentence with an empty date on the page.
All field tags work as bracketing when the field is filled. Use this for fields that not every customer fills in, for example a salutation or a title.
The field values are output without HTML encoding. This is data that the customer entered themselves during registration. So do not write it unchecked into an attribute or a script, only into visible text.

The way back to anonymous

Not every visitor is the same person. On a shared computer, the shop would otherwise greet the wrong person by name.
WC-DeleteLink is exclusively a single tag. The link deletes the WelcomeBack cookie, and the greeting does not appear until the next login.
Always offer this link when you greet someone by name. Without it, a visitor on a shared computer has no way of getting rid of someone else’s greeting.
The generated link uses HTTP, not HTTPS. This is not critical, because nothing is transmitted except the command to delete the cookie. If your shop runs exclusively via HTTPS, check the link once in the finished template anyway.
The cookie itself contains no names. It only contains an identifier that the shop system uses to look up the data in its own database. The visitor’s browser therefore does not carry any address data around.
The cookie is called ws_<Shopkennung>_<Sprache>_welcome_cookie. How long it is valid is also specified in the WelcomeCookie section of the shop configuration.
Keep the greeting block lean and only access the fields you actually display. Every field access draws on the database, and a block with a dozen fields appears on every page of the shop.

A complete example

In all four examples of the previous documentation, the closing tilde is missing from ~WC-Data_LastName. What is written there is ~WC-Data_LastName sind, which does not result in a tag in the template but appears unchanged as text. The corrected version is shown here.
Reference: WS-LoginLink on the page WS- (General tags)

The tags at a glance

All tags are permitted on all templates. The field tags and WC-DeleteLink sensibly belong in the {WC-Data} range, but this is not mandatory.
  • Reference: WelcomeCookie section in the shop configuration
  • Guide: Login and registration
  • Reference: WS- (General tags)