This method only works when the web store visitor is on the checkout page. Calling this method on any other page in the application will not set the purchase order number.
var cart = container.getComponent('Cart');
cart.setPurchaseOrderNumber('PO123456').then(function() {
console.log('Purchase order number added.');
}, function() {
cart.showMessage({
message: 'Purchase order number could not be added to the order.',
type: 'error'
});
});
Note: To set the purchase order number, the ‘Display Purchase Order Field on Payment Info Page’ option must be checked on the website settings page in the NetSuite account.
