Members
-
componentName :String
-
Description
A unique name that identifies the component. Use the component name when getting a component, for example,
application.getComponent(componentName)
.Details
-
application :ComponentContainer
-
Description
The name which identify this kind of component. This name is used both for registering a new component and
getting a component implementation with ComponentContainerDetails
Methods
-
getCurrentStep() → {Deferred.<CheckoutStep>}
-
Description
Gets the current checkout step.
Returns
-
setCurrentStep( step ) → {Deferred.<CheckoutStep>}
-
Description
Sets the current checkout step.
Parameters
Name Type Description step
CheckoutStep Returns
-
getStepGroupsInfo() → {Deferred.<Array.<CheckoutStepGroup>>}
-
Description
Gets the step groups in the checkout flow.
Returns
-
getStepsInfo() → {Deferred.<Array.<CheckoutStep>>}
-
Description
Gets the steps in the checkout flow.
Returns
-
getCheckoutFlow() → {String}
-
Description
Gets the name of the current checkout flow, as specified on the SuiteCommerce Configuration page in NetSuite.
Returns
-
addModuleToStep( data ) → {Deferred}
-
Description
Adds a module to a step. You must extend class WizardModule to add a new module.
EXAMPLE
checkout.addModuleToStep( { step_url: 'shipping/new_step' , module: { id: 'new_module' , index: 0 , classname: 'OrderWizard.Module.Shipmethod' , options: { container: '#wizard-step-content-right'} } })
Parameters
Name Type Description data
AddModuleData Returns
-
removeModuleFromStep( data ) → {Deferred}
-
Description
Removes a module from a step.
Parameters
Name Type Description data
RemoveModuleData Returns
-
addStepsGroup( data ) → {Deferred.<CheckoutStepGroup>}
-
removeStepsGroup( data ) → {Deferred}
-
Description
Removes a steps group.
Parameters
Name Type Description data
RemoveStepGroupData Returns
-
addStep( data ) → {Deferred.<CheckoutStep>}
-
removeStep( step_url ) → {Deferred}
-
Description
Removes a step from a steps group.
Parameters
Name Type Description step_url
String Returns
-
setChildViewIndex( view_id, placeholder_selector, view_name, index ) → {void}
-
Description
Changes the position of a child view inside a container.
Parameters
Name Type Description view_id
string The identifier of the view of the current component that contains the child view whose position will be changed.
placeholder_selector
string The identifier of a location in the specified view (view_id) where the child view will be added.
view_name
string The identifier of a view in the placeholder.
index
number The index of the child view's position.
Returns
Throws
Details
-
addChildViews( view_id, child_views ) → {void}
-
Description
Adds one or more child views to an existing view. The existing view must already be in the DOM and must have the 'data-view' HTML attribute.
The addChildViews method is flexible, but more complex than addChildView. Use the simpler addChildView where possible.
EXAMPLE
checkout.addChildViews( checkout.WIZARD_VIEW , { 'Wizard.StepNavigation': { 'CheckoutView': { childViewIndex: 1 , childViewConstructor: function () { return new CheckoutExtensionView({checkout:checkout}); } } } } );
Parameters
Name Type Description view_id
string The identifier of the view of the current component to which the child views will be added.
child_views
object Returns
Throws
Details
-
addChildView( view_id, childViewConstuctor ) → {void}
-
Description
Adds a child view to an existing View which is already appended in the DOM with the given
data-view
HTML attribute.EXAMPLE
checkout.addChildView('Wizard.StepNavigation', function () { return new CheckoutExtensionView({checkout:checkout}); });
Parameters
Name Type Description view_id
string The identifier of the view of the current component to which the child view will be added.
childViewConstuctor
SimpleChildViewConstructor The identifier of the location in the specified view (view_id) where the child view will be added.
Returns
Throws
Details
-
removeChildView( view_id, placeholder_selector [, view_name ] ) → {void}
-
Description
Removes a child view from a view.
Parameters
Name Type Attributes Description view_id
string The identifier of the view of the current component from which the child view will be removed.
placeholder_selector
string The identifier of the location in the specified view (view_id) from which the child view will be removed.
view_name
string <optional> The identifier of the view to be removed.
Returns
Throws
Details
-
addToViewContextDefinition( view_id, property_name, type, callback ) → {void}
-
Description
Adds a property to the UI context of a view to extend interaction with its template.
Parameters
Name Type Description view_id
string The identifier of the view of the current component to which the context property will be added.
property_name
string The name of the property.
type
string The type of the property. The value returned by the callback function must be of the same type.
callback
function A function that sets the value of the property (property_name).
Returns
Throws
Details
-
removeToViewContextDefinition( view_id, property_name ) → {void}
-
Description
Removes a property from the UI context of a view.
Parameters
Name Type Description view_id
string The identifier of the view of the current component from which the context property will be removed.
property_name
string The name of the property.
Returns
Throws
Details
-
addToViewEventsDefinition( view_id, event_selector, callback ) → {void}
-
Description
Adds an event handler to an event in a view.
Parameters
Name Type Description view_id
string The identifier of the view of the current component to which the event handler will be added.
event_selector
string callback
function The event handler function to call when the specified event occurs.
Returns
Throws
Details
-
removeToViewEventsDefinition( view_id, event_selector ) → {void}
-
Description
Removes an event handler from an event in a view.
Parameters
Name Type Description view_id
string The identifier of the view of the current component to which the event handler will be added.
event_selector
string Returns
Throws
Details
-
extend( componentDefinition ) → {BaseComponent}
-
Description
Extends the current component and creates a child component.
Parameters
Name Type Description componentDefinition
Object An object with the appropriate properties and methods to create the component.
Returns
Details
-
on( event_name, handler ) → {void}
-
Description
Attaches an event handler to an event name. Alias for CancelableEvents#cancelableOn.
Parameters
Name Type Description event_name
String The name of the event to attach to
handler
function Returns
Details
-
off( event_name, handler ) → {void}
-
Description
Detaches an event handler from an event name. Alias for CancelableEvents#cancelableOff.
Parameters
Name Type Description event_name
String The name of the event from which to detach the event handler.
handler
function Returns
Details
-
cancelableOn( event_name, handler ) → {void}
-
Description
Attaches an event handler to an event.
Parameters
Name Type Description event_name
String The name of the event to which the event handler will be attached.
handler
function The event handler method that will be invoked when event_name is triggered. This function can receive optionally one parameter representing the action parameter. Besides optionally can return a Deferred to details the execution of the trigger's callback. If the returned Deferred is rejected the trigger's callback wont be called
Returns
Details
-
cancelableOff( event_name, handler ) → {void}
-
Description
Detaches an event handler from an event.
Parameters
Name Type Description event_name
String The name of the event from which to detach the event handler. This argument is required.
handler
function The event handler that will be removed from the list of handlers attached to the event. This argument is required.
Returns
Details
-
cancelableDisable( event_name ) → {void}
-
Description
Disables all the event handlers attached to an event.
Parameters
Name Type Description event_name
String The name of the event.
Returns
Details
-
cancelableEnable( event_name ) → {Void}
-
Description
Re-enables all the event handlers attached to an event.
Parameters
Name Type Description event_name
String The name of the event.
Returns
Details
-
cancelableTrigger( event_name, ...args ) → {Deferred}
-
Description
Triggers an event with a set of arguments. If an event handler is rejected, the event handler callbacks will not be executed.
Parameters
Name Type Attributes Description event_name
String The name of the event to trigger.
args
params <repeatable> One or more arguments that will be broadcast to all event handlers attached to the event.
Returns
Details
-
cancelableTriggerUnsafe( event_name, ...args ) → {Deferred}
-
Description
Triggers an event with a set of unsanitized arguments. If an event handler is rejected, the event handler callbacks will not be executed.
Parameters
Name Type Attributes Description event_name
String The name of the event to trigger.
args
params <repeatable> One or more arguments that will be broadcast to all event handlers attached to the event.
Returns
Details
Events
-
beforeAddModuleToStep
-
-
afterAddModuleToStep
-
-
beforeSetCurrentStep
-
-
afterSetCurrentStep
-
-
beforeAddStep
-
-
afterAddStep
-
-
beforeAddStepsGroup
-
-
afterAddStepsGroup
-