Class ProductTeaserImpl
- java.lang.Object
-
- com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
-
- com.adobe.cq.commerce.core.components.internal.models.v1.productteaser.ProductTeaserImpl
-
- All Implemented Interfaces:
ProductTeaser
,com.adobe.cq.export.json.ComponentExporter
,com.adobe.cq.wcm.core.components.models.Component
@Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class, adapters={ProductTeaser.class,com.adobe.cq.export.json.ComponentExporter.class}, resourceType="core/cif/components/commerce/productteaser/v1/productteaser") public class ProductTeaserImpl extends DataLayerComponent implements ProductTeaser
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
RESOURCE_TYPE
-
Fields inherited from class com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
ID_SEPARATOR, resource
-
-
Constructor Summary
Constructors Constructor Description ProductTeaserImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCallToAction()
Returns the "call to action" configured for this teaser.String
getCallToActionText()
Returns the "call to action text" configured for this teaser.CommerceIdentifier
getCommerceIdentifier()
Returns the identifier of this product.protected com.adobe.cq.wcm.core.components.models.datalayer.ComponentData
getComponentData()
String
getDataLayerCurrency()
Double
getDataLayerPrice()
String
getDataLayerSKU()
String
getDataLayerTitle()
String
getExportedType()
String
getFormattedPrice()
String
getImage()
Returns url of swatch image of the product for display for thisProductTeaser
String
getName()
Returns name of the configured Product for thisProductTeaser
Price
getPriceRange()
Returns the price range.AbstractProductRetriever
getProductRetriever()
Returns in instance of the product retriever for fetching product data via GraphQL.String
getSku()
Returns the SKU of the product displayed by thisProductTeaser
String
getUrl()
Returns the url of the product page for thisProductTeaser
protected void
initModel()
Boolean
isVirtualProduct()
Returns true if the product is a virtual product.-
Methods inherited from class com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
generateId, getData, getDataLayerAssetResource, getDataLayerAssets, getDataLayerCategories, getDataLayerDescription, getDataLayerLanguage, getDataLayerLinkUrl, getDataLayerShownItems, getDataLayerTags, getDataLayerTemplatePath, getDataLayerText, getDataLayerType, getDataLayerUrl, getId
-
-
-
-
Field Detail
-
RESOURCE_TYPE
protected static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
initModel
@PostConstruct protected void initModel()
-
getCommerceIdentifier
public CommerceIdentifier getCommerceIdentifier()
Description copied from interface:ProductTeaser
Returns the identifier of this product.- Specified by:
getCommerceIdentifier
in interfaceProductTeaser
- Returns:
- a
CommerceIdentifier
object representing the identifier of this product.
-
getName
public String getName()
Description copied from interface:ProductTeaser
Returns name of the configured Product for thisProductTeaser
- Specified by:
getName
in interfaceProductTeaser
- Returns:
- name of the configured Product for this Teaser of
null
-
getSku
public String getSku()
Description copied from interface:ProductTeaser
Returns the SKU of the product displayed by thisProductTeaser
- Specified by:
getSku
in interfaceProductTeaser
- Returns:
- a String value representing the SKU
-
getCallToAction
public String getCallToAction()
Description copied from interface:ProductTeaser
Returns the "call to action" configured for this teaser.- Specified by:
getCallToAction
in interfaceProductTeaser
- Returns:
- the value of the "call to action" option. This can be "add-to-cart" or "details". If no CTA is configured then this methods
returns
null
-
getCallToActionText
public String getCallToActionText()
Description copied from interface:ProductTeaser
Returns the "call to action text" configured for this teaser.- Specified by:
getCallToActionText
in interfaceProductTeaser
- Returns:
- the value of the "call to action text" option.
If no CTA text is configured then this methods returns
null
-
getPriceRange
public Price getPriceRange()
Description copied from interface:ProductTeaser
Returns the price range.- Specified by:
getPriceRange
in interfaceProductTeaser
- Returns:
- Price range instance.
-
getFormattedPrice
public String getFormattedPrice()
- Specified by:
getFormattedPrice
in interfaceProductTeaser
- Returns:
- The formatted price including the currency.
-
getUrl
public String getUrl()
Description copied from interface:ProductTeaser
Returns the url of the product page for thisProductTeaser
- Specified by:
getUrl
in interfaceProductTeaser
- Returns:
- the url of the product page of the configured product or
null
-
getProductRetriever
public AbstractProductRetriever getProductRetriever()
Description copied from interface:ProductTeaser
Returns in instance of the product retriever for fetching product data via GraphQL.- Specified by:
getProductRetriever
in interfaceProductTeaser
- Returns:
- product retriever instance
-
getImage
public String getImage()
Description copied from interface:ProductTeaser
Returns url of swatch image of the product for display for thisProductTeaser
- Specified by:
getImage
in interfaceProductTeaser
- Returns:
- url of the swatch image for the product or
null
-
isVirtualProduct
public Boolean isVirtualProduct()
Description copied from interface:ProductTeaser
Returns true if the product is a virtual product.- Specified by:
isVirtualProduct
in interfaceProductTeaser
- Returns:
- Boolean
-
getExportedType
public String getExportedType()
- Specified by:
getExportedType
in interfacecom.adobe.cq.wcm.core.components.models.Component
- Specified by:
getExportedType
in interfacecom.adobe.cq.export.json.ComponentExporter
-
getComponentData
protected com.adobe.cq.wcm.core.components.models.datalayer.ComponentData getComponentData()
- Overrides:
getComponentData
in classDataLayerComponent
-
getDataLayerTitle
public String getDataLayerTitle()
- Overrides:
getDataLayerTitle
in classDataLayerComponent
-
getDataLayerSKU
public String getDataLayerSKU()
- Overrides:
getDataLayerSKU
in classDataLayerComponent
-
getDataLayerPrice
public Double getDataLayerPrice()
- Overrides:
getDataLayerPrice
in classDataLayerComponent
-
getDataLayerCurrency
public String getDataLayerCurrency()
- Overrides:
getDataLayerCurrency
in classDataLayerComponent
-
-