Set the order comments field on the fly.
It's quite useful to pass some additional information for an order, which will be provided in email notifications to customer and store admin as well as the order details in Ecwid Control Panel and Ecwid API.
Set order comments example: Ecwid.Cart.setOrderComments('Leave order at the door.');
Full function call example:
Ecwid.Cart.setOrderComments('Leave order at the door.',
function(){
console.log('Successfully set order comments.')
},
function(){
console.log('Error setting order comments.');
});
Subscribe to the Ecwid.OnAPILoaded
JS API event to ensure availability of this function.
Fields:
Name | Type | Description |
---|---|---|
orderComments | string | Order comments string to be set for an order |
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 |
---|---|
1000 | Store owner disabled this functionality |