Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

 

Any shop has a number of different types of form that customers can interact with. One of the basic examples are registration form - every commerce shop has it and it is different for almost every shop. Reason behind this is that each business wishes to collect different types of information. 

In order to approach this problem in a dynamic way YC offers a number of tools for configuring typical forms.

Registration

 

Each shop can define several supported customer types, which essentially means the types of customers that can register on the site. This is defined by shop attribute SHOP_CUSTOMER_TYPES  which accepts a localised free form list of values. Typical definitions could be B2C, B2B, B2E but it is at business user discretion what customer types to create. Note that there is a special type B2G which is reserved for guest checkout customer type.

...

Registration attributes cheat sheet

 

Below are mandatory/special attributes for registration forms that are defined in the CUSTOMER attribute group

Attribute Value Mandatory Since  Description 
salutation   2.x.x  Salutation is an optional attribute that "proxies" salutation property on the Customer object 
firstname   2.x.x  First name is mandatory attribute that "proxies" firstname property on the Customer object which is a mandatory field. Attempt to create Customer object without it results in SQL error. 
middlename   2.x.x  Middle name (second name) is an optional attribute that "proxies" middlename property on the Customer object 
lastname   2.x.x  Last name is mandatory attribute that "proxies" lastname property on the Customer object which is a mandatory field.  Attempt to create Customer object without it results in SQL error.
email email   3.5.0  Email property allows to define email regex. Since shops can have own specific view on what correct email regex is, the attribute is driven by value which must be email. Attempt to create Customer object without it results in SQL error.
passwordpassword  3.5.0  Marks a password field to be used in the form. The input is captured only inside the system to create a password hash. The attribute is not saved on Customer object
confirmPasswordconfirmPassword  3.5.0  Marks a password field to be used in the form. The input is captured only inside the system to create a password hash. The attribute is not saved on Customer object
regAddressFormregAddressForm  3.5.0 

 Marker attribute for registration for to include shipping address form for given customer type. Note that because fields such as salutationfirstnamemiddlenamelastname, companyname1, companyname2, companydepartment and phone1 (CUSTOMER_PHONE) exist on address form there is a fallback mechanism to prevent "double fields". For example CREG shop attribute with our address form: 

Textbox
Bodyemail,salutation,firstname,middlename,lastname,CUSTOMER_PHONE,MARKETING_OPT_IN,password,confirmPassword
will be replaced to 
Textbox
Bodyemail,regAddressForm,MARKETING_OPT_IN,password,confirmPassword
 if your shipping address form had 
Textbox
Bodysalutation,firstname,middlename,last name,phone1

companyname1  3.5.0B2B company name "proxies" companyName1 property on the Customer object
companyname2  3.5.0B2B additional company name (e.g. suffix) "proxies" companyName2 property on the Customer object
companydepartment  3.5.0B2B department within company "proxies" companyDepartment property on the Customer object

...

B2E registration

...

Label
BodyYCE
Colourinfo

 

B2E is a feature whereby a shop represents a market place or a collection of subshops where each registered customer could belong a specific sub shop. In such cases the customer account needs to be associated with specific sub shop. For that purpose a special CUSTOMER group attribute b2bsubshop is used. It is rendered as a text field which requires customer to enter the name of the sub shop they are registering in.

...

This configuration provides flexible mechanism for categorising customers. For example by departments in large customers or to provide privileged access to products and special prices.

Manager assisted

...

registration
Label
BodyYCE
Colourinfo
Label
Body3.7.0+

 

When manager logs in into storefront one of the options available is to register a new customer. This is usability improvement feature which allows manager to have a per customer type focused form with all fields required to register that customer including default address with one click.

...

For example consider the following use case: an organisation whereby B2B customers work through a signed contract and need to be verified to be eligible for special prices. In this instance B2C customers can be allowed to register (i.e. SHOP_CUSTOMER_TYPES=B2C) but B2B customers can only be registered by manager, thus SHOP_CREGATTRS_B2B is specified in shop attributes but not specified in SHOP_CUSTOMER_TYPES.
  

Profile

 

Similarly to registration form attributes the profile form can be configured as list of CUSTOMER group attributes. This configuration is separate to registration form thus allowing flexibility to specify additional properties or hide some which were captured during registration.

Profile forms are controlled by shop attributes of the form SHOP_CPROFATTRS_VISIBLE_XXX and SHOP_CPROFATTRS_READONLY_XXX for list of customer type specific profile form and list of attributes which cannot be edited on that form respectively. To specify common definition of the profile form SHOP_CPROFATTRS_VISIBLE and SHOP_CPROFATTRS_READONLY (without the customer type suffixes) can be used.

Guest Checkout

 

Guest checkout is viewed as a special case of registration form. In fact it can be seen from Registration form overview above that there is SHOP_CREGATTRS_B2G is used to define the guest checkout form. Therefore the configuration of the form itself is exactly the same as for normal registration.

One subtle difference is that this type of checkout has to be enabled by setting shop attribute SHOP_CHECKOUT_ENABLE_GUEST. When this attribute is set to true the form will automatically appear as an option on the checkout page for non-logged in customers .

Email 

...

Email
Label
Body3.5.0+
 

 

Email is a very common control around the shop which cane user in login, registration, contact form, newsletter form and effectively in any form that requires email communication with customer. As such it is sometimes important to provide restrictions on which kind of emails can be used. 

...

This definition provides validation configuration for login, contact forms and newsletter forms across the whole shop.

Address

 

Address form takes on the same principle discussed for registration and profile, however it deals with attribute definitions defined in ADDRESS group.

...

Address attributes check sheet


Value mapping

 

Table below depicts value options are available for the address object.
Note that values marked mandatory must be present in the form as these are defined as mandatory on Address object.
Another property to point out is the formatter placeholder, which is how the value is specified in the SHOP_ADDRESS_FORMATTER_XXX and it is different to the value (especially note the letter case).

...

Each address object allows to capture some core fields that have specific names but also has 10 custom fields that can be used for anything. Therefore depending on the attribute definition these fields can have own labels, validation rules etc.

 

Declaring address form attribute

 

In order to create forms which are address type specific or shop specific or both we can use prefixes. Consider the following example where we have two shops with shop code SHOP10 and SHOP20, which are ordered in the sequence of rank (i.e. default lookup sequence)

Form definition attribute code Eligible for 
SHOP10__B2B_addressform_S  SHOP10 definition for B2B customer type definition for shipping addresses
SHOP10__B2B_addressform_B  SHOP10 definition for B2B customer type definition for billing type addresses
SHOP10__B2B_addressform  SHOP10 definition for B2B customer type definition for shipping and billing type addresses 
SHOP10__default_addressform_S  SHOP10 definition for shipping type addresses
SHOP10__default_addressform_B  SHOP10 definition for shipping type addresses
SHOP10__default_addressform  SHOP10 definition for shipping and billing type addresses
B2B_addressform_S  Global definition for B2B customer type definition for shipping addresses available to SHOP10 and SHOP20 
B2B_addressform_B  Global definition for B2B customer type definition for billing type addresses available to SHOP10 and SHOP20 
B2B_addressform  Global definition for B2B customer type definition for shipping and billing type addresses available to SHOP10 and SHOP20 
default_addressform_S  Global definition for shipping type addresses available to SHOP10 and SHOP20  
default_addressform_B  Global definition for shipping type addresses available to SHOP10 and SHOP20  
default_addressform  Global definition for shipping and billing type addresses available to SHOP10 and SHOP20 

 

Declaring address formatting

 

Displaying address information is accomplished by address formatter, which is set via attribute at the shop level. The pattern for the attribute code is SHOP_ADDRESS_FORMATTER[CLASSIFIER][COUNTRY][LOCALE][CUSTOMERTYPE]. Therefore the attribute code can be set to represent the granularity of the formatter at very fine level. The attributes can be defined in attribute management and then shop owners can set the format they need at the appropriate level of granularity.

...

Code Block
{{salutation}} {{firstname}} {{lastname}}
{{addrline1}} {{addrline2}} 
P/O: {{postcode}} 
{{city}} {{statecode}}
{{countrycode}} 
Tel: {{phone1}} 
Mob: {{mobile1}} 
Email: {{email1}}

 

...

Contact

...

Label
BodyYCE
Colourinfo

 

Configurable contact forms is a feature that allows to generate any type of contact form by creating a form definition and then calling the form by ID.

...