Extensibility API Components

A component is a piece of functionality in a Commerce application that connects with specific aspects of the application to accomplish a task. The Extensibility API is organized around these components. Each component includes an associated class and various exposed methods for obtaining or modifying data, views, or template context.

Important:

The Backend Extensibility API has been deprecated since the 2020.1 release of SuiteCommerce and SuiteCommerce Advanced. Instead, you should use methods available in the Frontend Extensibility API or SuiteScript 2.0 modules and methods. For more information, see the Extensibility API Reference and the SuiteScript 2.x API Introduction.

Different components are available for SuiteCommerce, SuiteCommerce Advanced, and SuiteCommerce InStore. The Extensibility API includes the following components.

For more information on how to use these components when building extensions, see Extension Tutorials.

SuiteCommerce and SuiteCommerce Advanced Components

The SuiteCommerce components apply to both SuiteCommerce and SuiteCommerce Advanced.

See the full extensibility API reference for detailed information about each component.

Cart

This component interacts entirely with the LiveOrder, allowing you to add, update, and remove lines from the order, apply promotions to the order, select a shipping method on the order, associate the shipping and billing address to the order, add payment methods, and so on. This component can access objects available in all three ssp applications: shopping, myaccount and checkout.

ID

Cart

Methods

addLine()

addLines()

addPayment()

addPromotion()

clearEstimateShipping()

estimateShipping()

getAddresses()

getBillAddress()

getLatestAddition()

getLines()

getPromotions()

getPurchaseOrderNumber()

getShipAddress()

getShipMethod()

getShipMethods()

getSummary()

removeLine()

removePromotion()

removeShipping()

setPurchaseOrderNumber()

setShipMethod()

setTransactionBodyField()

submit()

triggerAddToCartConfirmation()

updateLine()

Events

beforeAddLine

afterAddLine

beforeAddPayment

afterAddPayment

beforeAddPromotion

afterAddPromotion

beforeClearEstimateShipping

afterClearEstimateShipping

beforeEstimateShipping

afterEstimateShipping

beforeRemoveLine

afterRemoveLine

beforeRemovePromotion

afterRemovePromotion

beforeSetPurchaseOrderNumber

afterSetPurchaseOrderNumber

beforeSetShipMethod

afterSetShipMethod

beforeSetTransactionBodyField

afterSetTransactionBodyField

beforeSubmit

afterSubmit

beforeUpdateLine

afterUpdateLine

Checkout

This component interacts entirely with the Checkout page and the checkout steps flow. This component lets you modify the steps visually, such as adding, removing, and reordering steps, etc. This component can access objects available in the checkout application only.

ID

Checkout

Methods

getCurrentStep()

setCurrentStep()

getStepGroupsInfo()

getStepsInfo()

getCheckoutFlow()

addModuleToStep()

removeModuleFromStep()

addStepsGroup()

removeStepsGroup()

addStep()

removeStep()

Events

beforeAddModuleToStep

afterAddModuleToStep

beforeSetCurrentStep

afterSetCurrentStep

beforeAddStep

afterAddStep

beforeAddStepsGroup

afterAddStepsGroup

CMS

This component is created only for the purpose of registering new Custom Content Types. If you want to add views inside of your CCT you can interact with all the rest of the components available. This component can access objects available in all three ssp applications: shopping, myaccount, and checkout.

ID

CMS

Methods

registerCustomContentType()

Events

Environment

This component is general to the entire SuiteCommerce Application and provides the utils method and access to Configuration values. This component does not provide interaction with any particular view. This component can access any object available in all three ssp applications: shopping, myaccount and checkout.

ID

Environment

Methods

addTracker()

defineSearchMasterOptions()

getConfig()

isPageGenerator()

getSiteSetting()

getSession()

setTranslation()

triggerEvent()

Events

Layout

This component lets you modify aspects of SuiteCommerce that do not have a specific component available. For example, no components currently exist that let you add or modify views on the home page, in the header, or in the footer. Using Layout, you can access all the view methods for each view (addChildViews, addChildView, removeChildView, and so on). As more components become available in future SuiteCommerce updates, you can replace the use of Layout for the appropriate (new) component, keeping the same methods.

ID

Layout

Available Since

SuiteCommerce 2018.2

Methods

addChildView()

addChildViews()

addToViewContextDefinition()

addToViewEventsDefinition()

closeMessage()

registerView()

removeChildView()

removeToViewContextDefinition()

removeToViewEventsDefinition()

setChildViewIndex()

showContent()

showMessage()

Events

LoginRegisterPage

The LoginRegisterPage component is used to listen for login and register events on the Log In / Register page in the web store. It also enables you to capture additional form data from the login and registration forms.

ID

LoginRegisterPage

Available Since

SuiteCommerce 2019.1

Methods

Events

beforeLogin

beforeRegister

afterRegister

MyAccountMenu

This component lets you add menu items to the menu on the My Account page. You can add group items and then add subitems to the group items. All group items and subitems have one or more permissions, which lets you restrict which users can view the menu items. Subitems point to a landing page URL that is loaded in the main content area of the page.

ID

MyAccountMenu

Available Since

SuiteCommerce 2019.1

Methods

addGroup()

addGroupEntry()

Events

PageType

Use the PageType component when you want to register new page types in an extension. A page type record can be created by logging in to NetSuite and creating the record, or by including the page type in the extension manifest file.

ID

PageType

Available Since

SuiteCommerce 2019.1

Methods

registerPageType()

registerTemplate()

Events

ProductDetailsPage (PDP)

This component interacts entirely with the Product Details page. This accesses objects inside the Product Details View only. This is undefined if invoked from any other part of the application.

ID

PDP

Methods

getAllMatrixChilds()

getItemInfo()

getPrice()

getSelectedMatrixChilds

setOption()

setQuantity()

getStockInfo()

Events

beforeOptionSelection

afterOptionSelection

beforeQuantityChange

afterQuantityChange

beforeImageChange

afterImageChange

ProductListPage (PLP)

This component interacts entirely with the Search Page, allows navigating to the next or previous page, set the current page, change the rendering, search for a product, get the last search term, and so on. This component accesses objects inside the Facets Browse View in the shopping application only. This is undefined if invoked from any other part of the application.

ID

PLP

Methods

getPagination()

setCurrentPage()

getSorting()

getAllSorting()

setSorting()

getDisplay()

getAllDisplay()

setDisplay()

getPageSize()

getAllPageSize()

setPageSize()

getFilters()

getAllFilters()

setFilters()

getSearchText()

setSearchText()

getItemsInfo()

getCategoryInfo()

getURL()

Events

SCCollection

The SCCollection component is the SuiteCommerce implementation of Backbone.Collection. It inherits all the methods and properties of Backbone.Collection. See the Backbone.js website for more information about Backbone.Collection.

Available since SuiteCommerce 2020.1.

SCCollectionView

Use the SCCollectionView component when you want to work with a collection of elements in a grid pattern on a web store page. SCCollectionView contains the SCCollectionView abstract class, which you must override with your own child class. Properties and methods in the class let you specify how rows and columns are displayed on the page. See the extensibility API reference for detailed information.

Available since SuiteCommerce 2020.2.

SCFormView

The SCFormView component enables you to validate form field data, display error messages in a form, and save the data to the associated model. The SCFormView class is an abstract class, which you must override with your own child class.

Available since SuiteCommerce 2020.2.

SCModel

The SCModel component is the SuiteCommerce implementation of Backbone.Model. It inherits all the methods and properties of Backbone.Model. See the Backbone.js website for more information about Backbone.Model.

Important:

In extensions on SuiteCommerce 2020.1 or later, you should use SCModel instead of Backbone.Model.

Available since SuiteCommerce 2020.1.

SCView

The SCView component is the SuiteCommerce implementation of Backbone.View. This component contains an abstract class, SCView, which you must override with your own child class. It provides all methods and properties of Backbone.View, as well as additional methods and properties to work with SuiteCommerce. For example, instead of using the native events property of Backbone.View, you should use the getEvents() method of SCView. See the extensibility API reference for detailed information.

Important:

In extensions on SuiteCommerce 2020.2 or later, you should use SCView instead of Backbone.VIew.

Available since SuiteCommerce 2020.2.

Search

The main purpose of the Search component is to retrieve the URL of the item search API of the SuiteCommerce website. You can then use the URL to search for items or get item information. The returned URL only includes the path and parameters of the item search API for a website; it does not include the URL scheme or domain name. Here is an example of a URL returned by the getUrl() method of this component:

/api/items?language=en&country=US&currency=USD&pricelevel=5&use_pcv=F&q=frames&fieldset=relateditems&dimensions=52x30

ID

Search

Available Since

SuiteCommerce 2021.1

Methods

getUrl()

Events

Available since SuiteCommerce 2021.1.

UserProfile

The UserProfile component lets you retrieve information related to the user logged in to the SuiteCommerce website. You can get basic user profile information as well as the user’s credit card data.

ID

UserProfile

Available Since

SuiteCommerce 2019.1

Methods

getCookieOptions()

getCreditCards()

getCustomerSegments()

getUserProfile()

setCookieOptions()

Events

SuiteCommerce InStore (SCIS) Components

The SCIS (SuiteCommerce InStore) components in the extensibility API let you create extensions that add, remove, or update lines in the cart. You can also show modal dialogs to present information to the user, and require the user to confirm or cancel an action.

See the full extensibility API reference for detailed information about each component.

Cart

The Cart component in SCIS lets you add, remove, and update lines in the cart. It also provides methods to perform other operations in the cart, such as applying promotions and discounts.

ID

Cart

Available Since

SuiteCommerce 2018.2

Methods

addGlobalDiscount()

addLine()

addLines()

addLineDiscount()

addPromotion()

getLines()

getSummary()

removeLineDiscount()

removePromotion()

returnLine()

setCustomer()

unvoidLine()

voidLine()

Events

beforeAddGlobalDiscount

afterAddGlobalDiscount

beforeAddLine

afterAddLine

beforeAddLineDiscount

afterAddLineDiscount

beforeRemoveLineDiscount

afterRemoveLineDiscount

beforeReturnLine

afterReturnLine

beforeSetCustomer

afterSetCustomer

beforeUnVoidLine

afterUnVoidLine

beforeVoidLine

afterVoidLine

SCISLayout

The SCISLayout component gives you access to two methods, both of which show a modal dialog to the user, but with different options to dismiss the dialog.

ID

SCISLayout

Available Since

SuiteCommerce 2018.2

Methods

showConfirmationPopup()

showMessagePopup()

Events

Related Topics

SuiteCommerce Extensibility API
Instantiating API Components

General Notices