Ecwid.Cart.setOrderComments

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:

NameTypeDescription
orderCommentsstringOrder comments string to be set for an order
successCallbackfunctionSuccess callback function
errorCallbackfunctionError callback function

📘

Parameters in bold are mandatory

errorCallback structure is: errorCallback(errCode, errMsg)

NameTypeDescription
errCodenumberError code
errMsgstringError message

Errors

Error codeError message
1000Store owner disabled this functionality