Controller for gift registry business logic.
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".
(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.
Returns:
JSON object indicating an error occurred in the AssignEventAddresses.js script.
- Type
- Object
(inner) create()
Creates a gift registry. Calls the createOne function.
(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).
(inner) deleteList()
Deletes a gift registry. Only the logged-in owner of the gift registry can delete it.
(inner) editParticipant()
Clears the giftregistry form and prepopulates event and participant information from the current ProductListModel. Calls the showEditParticipantForm function.
(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.
(inner) handleRegistryAddresses()
Renders the gift registry confirmation page (account/giftregistry/giftregistryconfirmation template).
(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.
(inner) selectProductListInteraction()
Provides actions to edit a gift registry event.
(inner) setParticipants()
Renders the gift registry addresses page (account/giftregistry/addresses template).
(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 |
(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 |
(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.
(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).
(inner) submitForm()
Controls the form submission that is required to access gift registry actions.