VlocityDCGlobalHeader

VlocityDCGlobalHeader

vlocity-dc-global-header is a component used for rendering a global header which is available accross all components except checkout.

Constructor

new VlocityDCGlobalHeader()

Source:
Example
Sample Usage -

Include the component in your template simply by adding vlocity-dc-global-header custom tag

<vlocity-dc-global-header></vlocity-dc-global-header>

 KEY INFO -

 events fired : "vlocity-dc-route-navigation", "vlocity-dc-sign-in" and "vlocity-dc-sign-out"

 events registered :

    | Event Name                     | Event source component          | Callback Function      | Description                                |
    |--------------------------------|---------------------------------|------------------------|--------------------------------------------|
    | vlocity-dc-login-complete      | vlocity-dc-sign-in              | loginSuccess()         | Event triggered on login                   |

 Dependency - vlocity-dc-global-header is a global component and doesn't have any dependency

 Sample with slots -

 <vlocity-dc-global-header>
     <div slot="{slot_name}">
       Custom header HTML elements goes here
     </div>
 </vlocity-dc-global-header>

List of available slots -

| Slot names                  | Dynamic     | Description                     | Impact                                 |
|-----------------------------|-------------|---------------------------------|----------------------------------------|
| dc-global-header            | -           | Wrapper for header elements     | Replaces header elements               |

Extends

  • DCBaseComponent

Members

(static, readonly) properties

Properties that will be available in the template binding
Source:

Methods

(static) closeLoginModal()

Method to close login modal
Source:

(async, static) doSignOut()

Method to signOut the user.
Source:

(static) initLogin()

Method to initiate login/signup SDK call.
Source:

(static) loginSuccess()

callback function for event vlocity-dc-login-complete
Source:

(static) openAccount()

Method to navigate to my accounts
Source:

(static) openLoginModal()

Method to open login modal
Source:

(static) signOutHandleFailure()

A custom function to be used by customers for handling api failures
Source:

(static) signOutPostHook()

A custom function to be used by customers for customisation, any custom action after sign in call can be written here
Source:

(static) signOutPreHook()

A custom function to be used by customers for customisation, any custom action prior to sign out call can be written here
Source:

(static) signOutPreSDKCalls()

This function is used to do any changes prior to sdk calls
Source:

(static) signOutProcessResponse(response)

This function is used to process signOut response
Parameters:
Name Type Description
response object Response Object from SDK call.
Source:

(static) signOutSDKCall()

This function is used to do actual sdk calls
Source: