This section provides information specific to working with gift and wish lists in a multisite environment.

Notes:

Using Gift and Wish Lists in a Multisite Environment

Gift list accessibility in a multisite environment typically falls into one of these categories:

Wish lists, by contrast, are always universal because there is only one wish list per profile and all sites must be able to access it. As such, a wish list may contain items from multiple sites, making the ability to filter those items based on site context a necessity.

Gift Item and Gift List Site IDs

When the GiftlistManager creates either a gift-list or gift-item item in the gift lists repository, it includes a siteId property that represents the site the new item is affiliated with. Adding siteId’s to both gift lists and gift items allows Nucleus components to evaluate whether a gift list or a gift item should be included in a gift list operation, based on site context (for example, which items can be added to gift lists associated with site X, which gift lists should Nucleus return for a gift list search initiated from site X, and so on). Inclusion or exclusion is determined by the gift list site scope, described later in this section.

Gift list site IDs correspond to the site the customer was on when the gift list was created. A gift item, on the other hand, represents a SKU or CommerceItem that may be affiliated with multiple sites, so a gift item’s siteId is not as straightforward. By default, the ID of the current site is used, however, you can override the default by doing the following:

Notes:

Gift List Site Scope

The GiftlistManager component has a siteScope property that controls whether gift list activity is limited to the current site, limited to sites in a sharing group, or not limited at all. Effectively, the siteScope property determines what items can be added to a gift list, what gift lists should be returned by a search, and what gift items should be filtered out based on site context. There are three possible values:

Other components, described later in this section, use the GiftlistManager.siteScope property to do their work. These components accept an optional list of site IDs (the aforementioned “specified sites”) and use that list, in conjunction with the GiftlistManager.siteScope property to determine which sites should included in the operation.

Continue with the following sections to see in detail how site scope affects adding gift items to, searching for, and filtering gift lists.

Adding Gift Items to Gift Lists in a Multisite Environment

Customers can add a gift item to a gift list either by adding the item from a product detail page, or by moving the item from their shopping cart to a gift list. In either case, the GiftlistManager must determine whether the gift item and the gift list are compatible, from a siteId perspective, before performing the add operation. To determine compatibility, the GiftlistManager.addItemsToGiftlist() method consults the GiftlistManager.siteScope property and then compares the siteId properties of the gift item and the gift list to determine if the sites are compatible, as shown in the following table:

Compatibility Test

All

Current

ShareableType ID

Gift item and gift list have the same siteId

Add gift item to gift list

Add gift item to gift list

Add gift item to
gift list

Gift item and gift list have different siteId’s

Add gift item to gift list

Does not add gift item to gift list

Add gift item to gift list if both sites are in the same sharing group

Gift list has a null siteId (i.e., it is a wish list)

Add gift item to gift list

Add gift item to gift list

Add gift item to gift list

As previously mentioned, adding a gift item to a gift list is a two-step process:

It’s during this second step that the GiftlistManager evaluates the gift list and gift item’s siteId properties for compatibility. If they are determined to be compatible, the gift item is added to the gift list.

Searching for Gift Lists in a Multisite Environment

A key aspect of gift list functionality is the ability to allow customers to search for another customer’s gift lists. Similar to the process for adding a gift list, when the GiftlistSearch form handler searches for gift lists, it must determine which gift lists not only match the search criteria but are also appropriate to include in the search results from a site context perspective. To support searching for gift lists in a multisite environment, the GiftlistSearch form handler includes the following multisite-specific properties:

When searching for gift lists, the GiftlistSearch form handler uses its siteScope and siteIds properties to apply constraints on the search query so that only gift lists that match the search terms and have compatible site IDs are returned, as shown in the following table:

Compatibility Test

All

Current

ShareableType ID

Gift list’s siteId is in the siteIds array

Include gift list in search results

Include gift list in search results

Include gift list
in search results

Gift list’s siteId is not in the siteIds array

Include gift list in search results

Do not include gift list in search results

Include gift list in search results if the gift list’s siteId is in the specified sharing group (for example, the shopping cart sharing group) with any of the sites in the siteIds array

Filtering Gift Lists

Oracle ATG Web Commerce includes functionality that allows you to filter collections of gift lists and gift items so that you display only those lists/items that are appropriate for the customer’s site context. In a multisite environment, any time you retrieve a collection of gift lists or gift items by referring to a repository item’s property, such as Profile.giftlists or Profile.wishlist.giftlistItems, you get back an unfiltered list that may contain items from multiple sites. For these situations, you should consider whether the collection should be filtered or not and, if so, implement gift list filtering functionality. For detailed information on this functionality, see Filtering Multisite Gift and Wish Lists in the Commerce Guide to Setting Up a Store.

Gift Lists and Gift Items with a Null Site ID

In non-multisite environments, there is no site context, so the GiftlistManager sets the siteId properties for new gift lists and gift items to null. If a non-multisite environment is reconfigured to be multisite aware, gift lists and gift items with a null siteId are considered to be universal and all sites in the environment may manipulate them.

Wish lists must be accessible by all sites, so they always have a null site ID in both multisite and non-multisite environments.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices