Class RelatedProductsServiceImpl
java.lang.Object
org.broadleafcommerce.core.catalog.service.RelatedProductsServiceImpl
- All Implemented Interfaces:
RelatedProductsService
@Service("blRelatedProductsService")
public class RelatedProductsServiceImpl
extends Object
implements RelatedProductsService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CatalogServiceprotected CategoryDaoprotected FeaturedProductDaoprotected ProductDao -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<? extends PromotableProduct>buildCrossSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the crossSale products for the past in product/categoryprotected List<? extends PromotableProduct>buildFeaturedProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the featured products for the past in product/categoryprotected List<? extends PromotableProduct>buildUpSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the upSale products for the past in product/categoryList<? extends PromotableProduct>findRelatedProducts(RelatedProductDTO relatedProductDTO) Uses the data in the passed in DTO to return a list of relatedProducts.booleanisFeaturedProduct(Long productId) protected CategorylookupCategory(RelatedProductDTO relatedProductDTO) protected ProductlookupProduct(RelatedProductDTO relatedProductDTO) protected voidremoveCurrentProductFromReturnList(Product product, List<? extends PromotableProduct> returnPromotableProducts) protected List<? extends PromotableProduct>resizeList(List<? extends PromotableProduct> originalList, Integer qty) Resizes the list to match the passed in quantity.
-
Field Details
-
categoryDao
-
productDao
-
featuredProductDao
-
catalogService
-
-
Constructor Details
-
RelatedProductsServiceImpl
public RelatedProductsServiceImpl()
-
-
Method Details
-
findRelatedProducts
Description copied from interface:RelatedProductsServiceUses the data in the passed in DTO to return a list of relatedProducts.For example, upSale, crossSale, or featured products.
- Specified by:
findRelatedProductsin interfaceRelatedProductsService- Returns:
-
isFeaturedProduct
- Specified by:
isFeaturedProductin interfaceRelatedProductsService
-
buildFeaturedProductsList
protected List<? extends PromotableProduct> buildFeaturedProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the featured products for the past in product/category- Parameters:
product-category-relatedProductDTO-- Returns:
-
removeCurrentProductFromReturnList
protected void removeCurrentProductFromReturnList(Product product, List<? extends PromotableProduct> returnPromotableProducts) -
buildUpSaleProductsList
protected List<? extends PromotableProduct> buildUpSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the upSale products for the past in product/category- Parameters:
product-category-relatedProductDTO-- Returns:
-
buildCrossSaleProductsList
protected List<? extends PromotableProduct> buildCrossSaleProductsList(Product product, Category category, RelatedProductDTO relatedProductDTO) Returns the crossSale products for the past in product/category- Parameters:
product-category-relatedProductDTO-- Returns:
-
resizeList
protected List<? extends PromotableProduct> resizeList(List<? extends PromotableProduct> originalList, Integer qty) Resizes the list to match the passed in quantity. If the quantity is greater than the size of the list or null, the originalList is returned.- Parameters:
originalList-qty-- Returns:
-
lookupProduct
-
lookupCategory
-