Class DefaultSelectiveCartService
- java.lang.Object
-
- de.hybris.platform.selectivecartservices.impl.DefaultSelectiveCartService
-
- All Implemented Interfaces:
SelectiveCartService
public class DefaultSelectiveCartService extends java.lang.Object implements SelectiveCartService
Default implementation ofSelectiveCartService
-
-
Constructor Summary
Constructors Constructor Description DefaultSelectiveCartService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Wishlist2ModelcreateWishlist()Creates a wish list for the current customerprotected UserModelgetCurrentUser()protected ModelServicegetModelService()protected SelectiveCartDaogetSelectiveCartDao()java.util.Optional<CartModel>getSelectiveCartForUser(UserModel user)Finds invisible saved cart for selective cartWishlist2EntryModelgetWishlistEntryForProduct(ProductModel product)Gets wishlist entry by product codeWishlist2EntryModelgetWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)Gets wishlist entry by product code and wishlistWishlist2ModelgetWishlistForSelectiveCart()Gets wishlist for selective cart and the current userprotected Wishlist2ServicegetWishlistService()voidremoveWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)Removes wishlist entry by product code and wishlistWishlist2EntryModelsaveWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist, java.util.Date addToCartTime)Saves wishlist entry and addToCartTime by product and wishlistvoidsetModelService(ModelService modelService)voidsetSelectiveCartDao(SelectiveCartDao selectiveCartDao)voidsetWishlistService(Wishlist2Service wishlistService)voidupdateCartTimeForOrderEntry(java.lang.String cartCode, int entryNumber, java.util.Date addToCartTime)Updates to the original addToCartTime when moving the wishlist entry from cartvoidupdateQuantityForWishlistEntry(Wishlist2EntryModel wishlistEntry, java.lang.Integer quantity)Updates the quantity of the give wishlist entry
-
-
-
Method Detail
-
getWishlistForSelectiveCart
public Wishlist2Model getWishlistForSelectiveCart()
Description copied from interface:SelectiveCartServiceGets wishlist for selective cart and the current user- Specified by:
getWishlistForSelectiveCartin interfaceSelectiveCartService- Returns:
- the wishlist model
-
getWishlistEntryForProduct
public Wishlist2EntryModel getWishlistEntryForProduct(ProductModel product)
Description copied from interface:SelectiveCartServiceGets wishlist entry by product code- Specified by:
getWishlistEntryForProductin interfaceSelectiveCartService- Parameters:
product- the product code- Returns:
- the wishlist entry model
-
getWishlistEntryForProduct
public Wishlist2EntryModel getWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
Description copied from interface:SelectiveCartServiceGets wishlist entry by product code and wishlist- Specified by:
getWishlistEntryForProductin interfaceSelectiveCartService- Parameters:
product- the product codewishlist- the wishlist model- Returns:
- the wishlist entry model
-
removeWishlistEntryForProduct
public void removeWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
Description copied from interface:SelectiveCartServiceRemoves wishlist entry by product code and wishlist- Specified by:
removeWishlistEntryForProductin interfaceSelectiveCartService- Parameters:
product- the product codewishlist- the wishlist model
-
updateQuantityForWishlistEntry
public void updateQuantityForWishlistEntry(Wishlist2EntryModel wishlistEntry, java.lang.Integer quantity)
Description copied from interface:SelectiveCartServiceUpdates the quantity of the give wishlist entry- Specified by:
updateQuantityForWishlistEntryin interfaceSelectiveCartService- Parameters:
wishlistEntry- the wishlist entry modelquantity- the total number of quantity
-
createWishlist
public Wishlist2Model createWishlist()
Description copied from interface:SelectiveCartServiceCreates a wish list for the current customer- Specified by:
createWishlistin interfaceSelectiveCartService- Returns:
- the wishlist model
-
saveWishlistEntryForProduct
public Wishlist2EntryModel saveWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist, java.util.Date addToCartTime)
Description copied from interface:SelectiveCartServiceSaves wishlist entry and addToCartTime by product and wishlist- Specified by:
saveWishlistEntryForProductin interfaceSelectiveCartService- Parameters:
product- the product codewishlist- the wishlist modeladdToCartTime- the added to cart time for a wishlist entry- Returns:
- the saved wishlist entry
-
updateCartTimeForOrderEntry
public void updateCartTimeForOrderEntry(java.lang.String cartCode, int entryNumber, java.util.Date addToCartTime)Description copied from interface:SelectiveCartServiceUpdates to the original addToCartTime when moving the wishlist entry from cart- Specified by:
updateCartTimeForOrderEntryin interfaceSelectiveCartService- Parameters:
cartCode- the cart code used for getting cart entryentryNumber- the entry number used for getting cart entryaddToCartTime- the new "added to cart" time
-
getSelectiveCartForUser
public java.util.Optional<CartModel> getSelectiveCartForUser(UserModel user)
Description copied from interface:SelectiveCartServiceFinds invisible saved cart for selective cart- Specified by:
getSelectiveCartForUserin interfaceSelectiveCartService- Parameters:
user- the user- Returns:
- the Optional CartModel
-
getCurrentUser
protected UserModel getCurrentUser()
-
getSelectiveCartDao
protected SelectiveCartDao getSelectiveCartDao()
-
setSelectiveCartDao
public void setSelectiveCartDao(SelectiveCartDao selectiveCartDao)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getWishlistService
protected Wishlist2Service getWishlistService()
-
setWishlistService
public void setWishlistService(Wishlist2Service wishlistService)
-
-