Class DefaultItemChoiceConfigurationService

    • Constructor Detail

      • DefaultItemChoiceConfigurationService

        public DefaultItemChoiceConfigurationService​(org.springframework.context.MessageSource messageSource,
                                                     com.broadleafcommerce.common.extension.TypeFactory typeFactory)
    • Method Detail

      • findAndHydrateDependentsMatchingItemChoice

        protected List<com.broadleafcommerce.cart.client.domain.CartItem> findAndHydrateDependentsMatchingItemChoice​(@NonNull
                                                                                                                     @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems,
                                                                                                                     @NonNull
                                                                                                                     @NonNull ItemChoice itemChoice)
      • findAndHydrateDependentsInCategory

        protected List<com.broadleafcommerce.cart.client.domain.CartItem> findAndHydrateDependentsInCategory​(@NonNull
                                                                                                             @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems,
                                                                                                             @NonNull
                                                                                                             @NonNull ItemChoice itemChoice)
      • findAndHydrateDependentsMatchingProducts

        protected List<com.broadleafcommerce.cart.client.domain.CartItem> findAndHydrateDependentsMatchingProducts​(@NonNull
                                                                                                                   @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems,
                                                                                                                   @NonNull
                                                                                                                   @NonNull ItemChoice itemChoice)
      • findAndHydrateDependentsMatchingVariants

        protected List<com.broadleafcommerce.cart.client.domain.CartItem> findAndHydrateDependentsMatchingVariants​(@NonNull
                                                                                                                   @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems,
                                                                                                                   @NonNull
                                                                                                                   @NonNull ItemChoice itemChoice)
      • hydrateItemChoicePricingDetails

        protected void hydrateItemChoicePricingDetails​(@NonNull
                                                       @NonNull ItemChoice itemChoice,
                                                       @NonNull
                                                       @NonNull com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem)
        Hydrates the pricing details for the parent ItemChoice on the dependent CartItem representing a specific choice. This information will be needed when pricing since the ItemChoice.getOverridePrice() should be used if the specific item doesn't have its own rather than using the underlying Product's or Variant's.
        Parameters:
        itemChoice - The parent ItemChoice of the dependentCartItem representing a SpecificItemChoice.
        dependentCartItem - The CartItem representing a SpecificItemChoice
      • isDiscountAllowed

        protected boolean isDiscountAllowed​(@NonNull
                                            @NonNull ItemChoice itemChoice)
      • isDiscountAllowed

        protected boolean isDiscountAllowed​(@NonNull
                                            @NonNull ItemChoice itemChoice,
                                            SpecificItemChoice specificItemChoice)
      • findDependentsMatchingItemChoice

        protected MatchingDependentsContext findDependentsMatchingItemChoice​(@NonNull
                                                                             @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems,
                                                                             @NonNull
                                                                             @NonNull ItemChoice itemChoice)
      • validateMinQuantity

        protected void validateMinQuantity​(@NonNull
                                           @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                           @NonNull
                                           @NonNull ItemChoice itemChoice,
                                           @NonNull
                                           @NonNull MatchingDependentsContext matchingCartItems,
                                           @NonNull
                                           @NonNull ProductOption option)
      • validateMaxQuantity

        protected void validateMaxQuantity​(@NonNull
                                           @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                           @NonNull
                                           @NonNull ItemChoice itemChoice,
                                           @NonNull
                                           @NonNull MatchingDependentsContext matchingCartItems,
                                           @NonNull
                                           @NonNull ProductOption option)
      • getMessage

        protected String getMessage​(@NonNull
                                    @NonNull String errorMessage,
                                    @Nullable
                                    Object... args)
      • addItemConfigError

        protected void addItemConfigError​(@NonNull
                                          @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                          @NonNull
                                          @NonNull ItemChoice itemChoice,
                                          @NonNull
                                          @NonNull String errorCode,
                                          @NonNull
                                          @NonNull String errorMessage)
      • getMessageSource

        protected org.springframework.context.MessageSource getMessageSource()
      • getTypeFactory

        protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()