Set customer's email in checkout process.
Ecwid.Cart.setCustomerEmail(email, successCallback, errorCallback);
Make sure to use it on pages, where the email is not shown so that it is always up-to-date. If a customer is logged in, your set email will overwrite the email for that customer's account (if possible).
Set customer email example:
Ecwid.Cart.setCustomerEmail('[email protected]');
Subscribe to the Ecwid.OnAPILoaded
JS API event to ensure availability of this function.
Fields:
Name | Type | Description |
---|---|---|
string | Customer email address to be set | |
successCallback | function | Success callback function |
errorCallback | function | Error callback function |
Parameters in bold are mandatory
errorCallback
structure is: errorCallback(errCode, errMsg)
Name | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | string | Error message |
Errors
Error code | Error message |
---|---|
0 | Missing argument |
100 | Incorrect data passed |