Description :
To get the billing address of the order we can use the following code.
Code :
var cart = container.getComponent("Cart");
cart.getBillAddress().then(function(billaddress) {
if (billaddress.isresidential == "T") {
// Do work related to Sunday shipments for residential addresses.
// ...
}
});
Returns
Deferred :
Returns a Deferred object. If the promise is resolved, it returns an Address. If the promise is rejected, it returns an error.
Address : Represents an address record in NetSuite.
| Name | Type | Description |
|---|---|---|
internalid | String | The internal ID of the address record in NetSuite. |
zip | String | The postal code of the address. |
country | String | The two-letter country code of the address, for example, “CA”, “IE”, or “US”. |
addr1 | String | The first line of the address. |
addr2 | String | The second line of the address. |
addr3 | String | The third line of the address. |
city | String | The city name. |
company | String | The company name. |
defaultbilling | Boolean | Indicates whether the address is the default billing address (T) or a secondary address (F). |
defaultshipping | Boolean | Indicates whether the address is the default shipping address (T) or a secondary address (F). |
fullname | String | The customer’s full name. |
isresidential | Boolean | Indicates whether the address is a residential address (T) or a business address (F). |
isvalid | Boolean | Indicates whether the address is currently valid (T) or invalid (F). |
phone | String | The phone number associated with the address. |
state | String | The state or province. |