menu

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

Controller that renders product detail pages and snippets or includes used on product detail pages. Also renders product tiles for product listings.

Source:

Members

(static) Detail

Renders the productdetail template.

Source:
See:

(static) GetAvailability

Returns product availability data as a JSON object.

Source:
See:

(static) GetBonusProducts

Renders a list of bonus products for a bonus discount line item.

Source:
See:

(static) GetSetItem

Renders a set item view for the given product ID.

Source:
See:

(static) HitTile

Renders a product tile, used within family and search result pages.

Source:
See:

(static) IncludeLastVisited

Renders the last visited products based on the session information.

Source:
See:

(static) Productnav

Renders a navigation include on product detail pages.

Source:
See:

(static) Show

Renders the product template.

Source:
See:

(static) ShowInCategory

Renders the product detail page within the context of a category.

Source:
See:

(static) Variation

Renders variation selection controls for a given product ID.

Source:
See:

(static) VariationPS

Renders variation selection controls for the product set item identified by the given product ID.

Source:
See:

Methods

(inner) detail()

Renders the product detail page.

If the product is online, gets a ProductView and updates the product data from the httpParameterMap. Renders the product detail page (product/productdetail template). If the product is not online, sets the response status to 401, and renders an error page (error/notfound template).

Source:

(inner) getAvailability()

Returns product availability data as a JSON object.

Gets a ProductModel and gets the product ID from the httpParameterMap. If the product is online, renders product availability data as a JSON object. If the product is not online, sets the response status to 401,and renders an error page (error/notfound template).

Source:

(inner) getBonusProducts()

Renders a list of bonus products for a bonus discount line item (product/bonusproductgrid template).

Source:

(inner) getSelectedProduct(product) → {dw.catalog.Product}

Checks whether a given product has all required attributes selected, and returns the selected variant if true

Parameters:
Name Type Description
product dw.catalog.Product
Source:
Returns:
  • Either input product or selected product variant if all attributes selected
Type
dw.catalog.Product

(inner) getSetItem()

Renders a set item view for a given product ID, taken from the httpParameterMap pid parameter. If the product is online, get a ProductView and renders the product set page (product/components/productsetproduct template). If the product is offline, sets the request status to 401 and renders an error page (error/notfound template).

Source:

(inner) hitTile()

Renders a product tile. This is used within recommendation and search grid result pages.

Gets a ProductModel and gets a product using the product ID in the httpParameterMap. If the product is online, renders a product tile (product/producttile template), used within family and search result pages.

Source:

(inner) includeLastVisited()

Renders the last visited products based on the session information (product/lastvisited template).

Source:

(inner) productNavigation()

Renders a navigation include on product detail pages.

Gets a ProductModel and gets a product using the product ID in the httpParameterMap. If the product is online, constructs a search and paging model, executes the search, and renders a navigation include on product detail pages (search/productnav template). Also provides next/back links for customers to traverse a product list, such as a search result list.

Source:

(inner) show()

Renders the product page.

If the product is online, gets a ProductView and updates the product data from the httpParameterMap. Renders the product page (product/product template). If the product is not online, sets the response status to 401, and renders an error page (error/notfound template).

Source:

(inner) showInCategory()

Renders the product detail page within the context of a category. Calls the show function. Important: this function is not obsolete and must remain as it is used by hardcoded platform rewrite rules.

Source:

(inner) variation()

Renders variation selection controls for a given product ID, taken from the httpParameterMap.

If the product is online, updates variation information and gets the selected variant. If it is an ajax request, renders the product content page (product/productcontent template), otherwise renders the product page (product/product template). If it is a bonus product, gets information about the bonus discount line item and renders the bonus product include page (pageproduct/components/bonusproduct template). If the product is offline, sets the request status to 401 and renders an error page (error/notfound template).

Source:

(inner) variationPS()

Renders variation selection controls for the product set item identified by a given product ID, taken from the httpParameterMap.

If the product is online, updates variation information and gets the selected variant. If it is an ajax request, renders the product set page (product/components/productsetproduct template), otherwise renders the product page (product/product template). If the product is offline, sets the request status to 401 and renders an error page (error/notfound template).

Source: