menu

SiteGenesis / Server-side JS / Module: controllers/GiftRegistry

Controller for gift registry business logic.

Source:

Members

(static) AddProduct

Adds a product to the gift registry.

Source:
See:

(static) Create

Creates a gift registry.

Source:
See:

(static) Delete

Deletes a gift registry.

Source:
See:
  • module:controllers/GiftRegistry~confirmation

(static) EditEvent

Event handler for editing of gift registry.

Source:
See:
  • module:controllers/GiftRegistry~editEvent

(static) EventParticipant

Event handler for gift registry addresses.

Source:
See:

(static) SelectProductListInteraction

Provides actions to edit a gift registry event.

Source:
See:

(static) ShowRegistry

Renders the gift registry details page.

Source:
See:

(static) ShowRegistryByID

Looks up a gift registry by its public UUID.

Source:
See:

(static) Start

Renders a list of gift registries associated with the current customer.

Source:
See:

(static) SubmitForm

Controls the login that is required to access gift registry actions.

Source:
See:

Methods

(inner) addProduct()

Adds a product to the gift registry. The product must either be a Product object, or is identified by its product ID using the dictionary key ProductID or, if empty, uses the HTTP parameter "pid".

Source:

(inner) confirm() → {Object}

Handles the confirm action for the giftregistry form. Checks to makes sure the before and after event addresses do not already exist in the customer profile. If the addresses are duplicates, calls the setParticipants function. If they are not duplicates, calls the AssignEventAddresses.js script to assign the event addresses to the product list and then calls the showRegistry function.

Source:
Returns:

JSON object indicating an error occurred in the AssignEventAddresses.js script.

Type
Object

(inner) create()

Creates a gift registry. Calls the createOne function.

Source:

(inner) createOne()

Initiates the creation of a gift registry entry in three stages: 1) Specify event participants 2) Specify pre- and post-event addresses 3) Confirm Gift Registry details Renders the event participant page (account/giftregistry/eventparticipant template).

Source:

(inner) deleteList()

Deletes a gift registry. Only the logged-in owner of the gift registry can delete it.

Source:

(inner) editParticipant()

Clears the giftregistry form and prepopulates event and participant information from the current ProductListModel. Calls the showEditParticipantForm function.

Source:

(inner) eventParticipant()

Event handler for gift registry addresses. Checks the last triggered action and handles them depending on the formId associated with the triggered action. If the formId is:

  • back - calls the start function
  • confirm - if there are no addresses in the customer address book, sets a flag to indicate the before event shipping address is new. Calls the setParticipants function.
Source:

(inner) handleRegistryAddresses()

Renders the gift registry confirmation page (account/giftregistry/giftregistryconfirmation template).

Source:

(inner) selectOne()

Selects a gift registry from a list of gift registries that are found by the registry search. Called by module:controllers/GiftRegistry~addProduct.

Source:

(inner) selectProductListInteraction()

Provides actions to edit a gift registry event.

Source:

(inner) setParticipants()

Renders the gift registry addresses page (account/giftregistry/addresses template).

Source:

(inner) setProductListPublic(productList, isPublic)

Makes a ProductList public or private

Parameters:
Name Type Description
productList dw.customer.ProductList
isPublic Boolean

true to make public; false to make private

Source:

(inner) showRegistry(pdict)

Renders a gift registry details page (account/giftregistry/registry template) and provides basic actions such as item updates and publishing.

Parameters:
Name Type Description
pdict Object
Source:

(inner) showRegistryByID()

Looks up a gift registry by its public UUID. If the customer is authenticated, it calls the showRegistry function. If the customer is not authenticated, it calls calls the Account controller show function.

Source:

(inner) start()

Renders a list of gift registries associated with the current customer. Clears the productlists form and gets the product lists associated with a customer. Gets the myaccount-giftregistry content asset, updates the page metadata and renders the registry list page (account/giftregistry/registrylist template).

Source:

(inner) submitForm()

Controls the form submission that is required to access gift registry actions.

Source: