Skip to content

getComment(): string

The getComment method allows to retrieve the text from Comments to order field.

Returned value

A returned value has a type of string representing a current comment.

Example

In this example we make a basketOverallApi call to retrieve a current comment for the order.

useStorefront(async ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketOverallApi = await getApi('basketOverallApi');

        const comment = basketOverallApi.getComment();

        console.log('current comment: ', comment);
    });
});

Basket Overall API methods reference