Product catalog
This section includes technical descriptions of features related to managing and presenting the product catalog, including browsing, searching, and displaying product details.
Merchandizing and Product Associations
Merchandizing is the practice of displaying related products as the customer browses a product page. For example, a customer browsing a Canon digital camera could be recommended a Sony digital camera.
Merchandizing works by associating the "source" product on display with "target" products the customer may be interested in. If the target product has multiple SKUs, the association can target a specific SKU.
In the code, a product has no direct knowledge of its associated products; ProductAssociation objects maintain an association between "source" and "target" products. To retrieve a product’s ProductAssociations, use the ProductAssociationService.
Key classes and files
The key classes and files in core are:
ProductAssociation
- A representation of the link between a source and target productProductAssociationService
- A service for performing persistence operations onProductAssociations
The key classes and files in store assets are:
VM_global_library.vm
- A Velocity macro library that contains methods for displaying product associationsproductMacros.vm
- A Velocity template for displaying products
ProductAssociation
Properties
ProductAssociation
objects have the following properties:
associationType
Type:
int
The type of merchandising association between the two products. See
ProductAssociation
Types for more information.sourceProduct
Type:
Product
The product on display in the store.
targetProduct
Type:
Product
The related product.
catalog
Type:
Catalog
The catalog the
ProductAssociation
applies to.startDate
Type:
Date
The date the association starts to be applied.
endDate
Type:
Date
The date the association is removed.
defaultQuantity
Type:
int
The quantity of the target accessory added to the cart when the customer purchases the target accessory.
sourceProductDependent
Type:
boolean
The indicator for whether the target product is a child of the source product. If
true
, the child can’t exist in the cart without the parent.ordering
Type:
int
The order the target product appears on the source product page relative to other target products.
uidPk
Type:
long
The association’s UID generated by OpenJPA
ProductAssociation
Types
By default, there are six types of product associations. Depending on the association type, productMacros.vm displays the target product in different locations.
Cross Sell
Promotes alternative products that are similar to the source product. Displayed in a "You May Also Like" section.
Up Sell
Promotes more expensive versions of the source product. Displayed in an "Upgrade To" section.
Warranty
Promotes "add-on" products. Usually dependent on the source product. Purchasable on the source product page.
Accessory
Promotes products that complement the source product. Purchasable on the source product page.
Replacement
Promotes alternative products when the source product is out of stock or discontinued. Displayed in a "Replaced By" section.
Product Recommendation
Promotes products that were also purchased by customers who purchase the source product. Displayed below the Product Details section
note
Store administrators can create five association types using the Commerce Manager. Product recommendations are automatically generated by Elastic Path.
Product Recommendation
Product Recommendation is a type of product association that promotes products based on what other customers are buying. For a "source" product on display, Product Recommendation targets products that were bought by customers who buy the source product. For example, Customer A bought a Canon camera and a Kingston SD card. When Customer B enters the Canon Camera’s product page, Product Recommendation recommends Customer B to also buy a Kingston SD card.
Product Recommendations are computed by the ProductRecommendationService Quartz job in the Commerce Manager.
Key classes and files
ProductAssociation
- A representation of the link between a source and target productProductRecommendationService
- A service for computing product recommendationsRecommendationSet
- A set of product recommendations computed by theProductRecommendationService
productMacros.vm
- A Velocity template for displaying products
Product Recommendation Calculation
ProductRecommendationService
uses the algorithm in updateRecommendations()
to compute product recommendations:
- Retrieve purchase data from the database as (CustomerId, ProductId) tuples, where the customer CustomerID bought the product ProductID.
- Convert the purchase data into a map where the customerId is the key and the list of products purchased is the value.
- Create a map of product recommendations by mapping each source product to other products they were purchased with.
This map maps product
ids
toRecommendationSet
instancesRecommendationSet
counts the number of times other products were purchased with the source product and sorts the results in decreasing order.RecommendationSet
returns the top N most frequent products as recommendations
- For each source product with recommendations: a. Load the source product and its ProductAssociations b. Remove any product recommendation type ProductAssociations that are not in the new product recommendations set. C. Add any new product recommendations as new product recommendation type ProductAssociations.
Configuring Product Recommendation
The Product Recommendation calculation schedule is configurable via the Commerce Manager’s quartz configuration file.
To configure the max number of days of order history to use in Product Recommendation computation, change the
COMMERCE/STORE/PRODUCTRECOMMENDATIONS/numberOrderHistoryDays
system settingTo configure the max number of most frequent products to use as recommendations, change the
COMMERCE/STORE/PRODUCTRECOMMENDATIONS/numberMaxRecommendations
system settingTo disable product recommendation, you can assign a -1 to either of the above system settings
note
Disabling product recommendation will not remove existing product recommendations.