Class DefaultBundleCommerceCartFacade
java.lang.Object
de.hybris.platform.configurablebundlefacades.order.impl.DefaultBundleCommerceCartFacade
- All Implemented Interfaces:
BundleCartFacade
Default implementation of
BundleCartFacade- Since:
- 6.4
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProductsIfAutoPickSelectionCriteria(CommerceCartParameter parameter, String addedProductCode, String bundleTemplateId) Add a product to an existing bundle.protected voidapplyDisableRules(ProductData productData, EntryGroup currentEntryGroup) protected voidcreateCommerceCartParametersForAutoPickComponent(CommerceCartParameter commerceCartParameter, BundleTemplateModel component, EntryGroup entryGroup, String addedProductCode, String bundleTemplateId) protected SearchStateDatacreateSearchStateWithBundleComponentFilter(String searchQuery, String componentId) protected ProductSearchPageData<SearchStateData,ProductData> encodeSearchPageData(String urlPrefix, ProductSearchPageData<SearchStateData, ProductData> searchPageData) protected Stringprotected voidenrichProductData(List<ProductData> searchResult, EntryGroup currentEntryGroup) Populate some extra fields of product DTO restored from solr documents.getAllowedProducts(Integer groupNumber, String searchQuery, PageableData pageableData) Constructs pageable list of products available for entry group of typeGroupType.CONFIGURABLEBUNDLEprotected IntegergetBundleEntryGroupNumber(CommerceCartParameter parameter) protected BundleRuleServiceprotected BundleTemplateServiceprotected CartServiceprotected CommerceCartServiceprotected EntryGroupServiceprotected ProductSearchFacade<ProductData>protected ProductServiceprotected booleanprotected voidpatchURLs(String urlPrefix, ProductSearchPageData<SearchStateData, ProductData> searchPageData) protected voidprocessFacetData(List<FacetData<SearchStateData>> facets) protected voidprocessFacetDatas(List<FacetValueData<SearchStateData>> facetValueDatas) protected voidremoveEntriesByGroupNumber(CartModel cart, Integer entryGroupNumber) protected voidsetAutoPickEnabled(boolean autoPickEnabled) voidsetBundleRuleService(BundleRuleService bundleRuleService) voidsetBundleTemplateService(BundleTemplateService bundleTemplateService) voidsetCartModificationConverter(Converter<CommerceCartModification, CartModificationData> cartModificationConverter) voidsetCartService(CartService cartService) voidsetCommerceCartService(CommerceCartService commerceCartService) voidsetEntryGroupService(EntryGroupService entryGroupService) voidsetProductSearchFacade(ProductSearchFacade<ProductData> productSearchFacade) voidsetProductService(ProductService productService) startBundle(String bundleTemplateId, String productCode, long quantity) Start new bundle in cart based on the given bundle template and add the product to it.
-
Field Details
-
FACET_SEPARATOR
- See Also:
-
NOT_FOUND_IN_CART
- See Also:
-
-
Constructor Details
-
DefaultBundleCommerceCartFacade
public DefaultBundleCommerceCartFacade()
-
-
Method Details
-
startBundle
public CartModificationData startBundle(@Nonnull String bundleTemplateId, @Nonnull String productCode, long quantity) throws CommerceCartModificationException Description copied from interface:BundleCartFacadeStart new bundle in cart based on the given bundle template and add the product to it.- Specified by:
startBundlein interfaceBundleCartFacade- Parameters:
bundleTemplateId- a component to add the product to. He whole bundle structure - starting from the root of the component - will be added to cart groupsproductCode- a product which will be added to the componentquantity- quantity for the product. Is limited by selection criteria of the component- Returns:
- information about the new cart entry
- Throws:
CommerceCartModificationException- if the operation is not possible- See Also:
-
addToCart
public CartModificationData addToCart(@Nonnull String productCode, long quantity, int groupNumber) throws CommerceCartModificationException Description copied from interface:BundleCartFacadeAdd a product to an existing bundle.- Specified by:
addToCartin interfaceBundleCartFacade- Parameters:
productCode- product to addquantity- quantity of the productgroupNumber- entry group number, that defines the bundle and the component within the bundle- Returns:
- information about the new cart entry
- Throws:
CommerceCartModificationException- if the operation is not possible- See Also:
-
getAllowedProducts
@Nonnull public ProductSearchPageData<SearchStateData,ProductData> getAllowedProducts(@Nonnull Integer groupNumber, String searchQuery, @Nonnull PageableData pageableData) Description copied from interface:BundleCartFacadeConstructs pageable list of products available for entry group of typeGroupType.CONFIGURABLEBUNDLE- Specified by:
getAllowedProductsin interfaceBundleCartFacade- Parameters:
groupNumber- entry group number related to the componentsearchQuery- the search querypageableData- the page to return- Returns:
- the search results
-
addProductsIfAutoPickSelectionCriteria
protected void addProductsIfAutoPickSelectionCriteria(@Nonnull CommerceCartParameter parameter, String addedProductCode, String bundleTemplateId) throws CommerceCartModificationException -
getBundleEntryGroupNumber
-
createCommerceCartParametersForAutoPickComponent
protected void createCommerceCartParametersForAutoPickComponent(CommerceCartParameter commerceCartParameter, BundleTemplateModel component, EntryGroup entryGroup, String addedProductCode, String bundleTemplateId) throws CommerceCartModificationException -
enrichProductData
Populate some extra fields of product DTO restored from solr documents.- Parameters:
searchResult- products that could be added to a componentcurrentEntryGroup- bundle component the products are being selected for
-
applyDisableRules
-
removeEntriesByGroupNumber
protected void removeEntriesByGroupNumber(@Nonnull CartModel cart, @Nonnull Integer entryGroupNumber) throws CommerceCartModificationException -
createSearchStateWithBundleComponentFilter
protected SearchStateData createSearchStateWithBundleComponentFilter(String searchQuery, String componentId) -
encodeSearchPageData
protected ProductSearchPageData<SearchStateData,ProductData> encodeSearchPageData(String urlPrefix, ProductSearchPageData<SearchStateData, ProductData> searchPageData) -
patchURLs
protected void patchURLs(String urlPrefix, ProductSearchPageData<SearchStateData, ProductData> searchPageData) -
encodeURL
-
processFacetData
protected void processFacetData(List<FacetData<SearchStateData>> facets) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
processFacetDatas
protected void processFacetDatas(List<FacetValueData<SearchStateData>> facetValueDatas) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
getBundleTemplateService
-
setBundleTemplateService
-
getCartService
-
setCartService
-
getProductService
-
setProductService
-
getCartModificationConverter
-
setCartModificationConverter
public void setCartModificationConverter(Converter<CommerceCartModification, CartModificationData> cartModificationConverter) -
getEntryGroupService
-
setEntryGroupService
-
getCommerceCartService
-
setCommerceCartService
-
getProductSearchFacade
-
setProductSearchFacade
-
getBundleRuleService
-
setBundleRuleService
-
isAutoPickEnabled
protected boolean isAutoPickEnabled() -
setAutoPickEnabled
protected void setAutoPickEnabled(boolean autoPickEnabled)
-