@ProviderType
public interface ProductRelationshipsProvider
ProductRelationship
s for a particular
context (shopper, cart, page, product).
It should be noted that the out-of-the-box RelatedProducts ClientContext store includes the product's SKU, title, imageUrl and path, and all the relationship's metadata, into the ClientContext. A RelationshipsProvider can therefore chose to have other product fields included in the ClientContext simply by copying them to the relationship's metadata.
As an example, one might include two properties regarding the relationship (source and message), and an additional product property (the price):
source: "order-history"
message: "Recommended because you purchased 'Amy Winehouse' in the past"
price: "$12.50"
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RELATIONSHIP_TYPE_PN
Implementations which support only a single relationshipType are encouraged to place that
relationshipType into an OSGi property so that ProductRelationshipsProviders can be selected
by type.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ProductRelationship> |
getRelationships(SlingHttpServletRequest request,
CommerceSession session,
Page page,
Product product) |
java.util.Map<java.lang.String,java.lang.String> |
getRelationshipTypes() |
static final java.lang.String RELATIONSHIP_TYPE_PN
java.util.Map<java.lang.String,java.lang.String> getRelationshipTypes()
relationshipType
s supported by this provider to their
relationshipTitle
s)java.util.List<ProductRelationship> getRelationships(SlingHttpServletRequest request, CommerceSession session, Page page, Product product) throws CommerceException
request
- A request representing the current usersession
- The current commerce session (cart, order)page
- The current pageproduct
- The current product (if applicable)ProductRelationship
s for a given context (user, cart, page, product)CommerceException
Copyright © 2010 - 2020 Adobe. All Rights Reserved