public class PromotionMgrEE extends PromotionMgr implements PromotionMgrIf
PromotionMgr.StaticData
ALL, COUPON_DOESNT_EXIST, COUPON_EXISTS_ACTIVE, COUPON_EXISTS_INACTIVE, EXCLUDE, GIFT_CERTIFICATE_RELATION_TYPE, INCLUDE, log, mutex, PROMOTION_RELATION_TYPE, promotionUsageCountMaxRetries, promotionUseMutex, staticDataHM
templateBaseDir
Constructor and Description |
---|
PromotionMgrEE(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getProductMapKey(int prodId,
int prodOptionId,
int prodOptionValueId)
Create a unique key for the Product Map
|
PromotionIf |
getPromotion(int promotionId,
java.lang.String promotionName,
int languageId,
FetchPromotionOptionsIf prmOptions,
FetchProductOptionsIf prodOptions)
This API call is used to retrieve a single promotion matching an id or name.
|
ProductIf[] |
getPromotionsPerProducts(java.lang.String sessionId,
int customerId,
ProductIf[] products,
PromotionIf[] promotions,
java.lang.String[] couponCodes,
PromotionOptionsIf options)
This method is used to calculate a discount on individual products so that the discount can
be displayed without having to add the product to the cart.
The method receives an array of products and returns an array of products with attached PromotionResult objects that contain the results of one or more of the promotions passed in as a parameter. |
applyDiscount, checkCategory, checkCoupon, checkCoupon, checkCoupon, checkCustomer, checkCustomerGroup, checkCustomerUse, checkExpression, checkManufacturer, checkProduct, checkPromotion, getAllPromotions, getCouponPerId, getCouponsPerCode, getCustomerId, getOrderProductsFromProduct, getPromotionCategoryMap, getPromotionCategoryMapKey, getPromotionExpressionMap, getPromotionIdForGiftCertificate, getPromotionIdForGiftCertificate, getPromotionManufacturerMap, getPromotionManufacturerMapKey, getPromotionProductMap, getPromotionProductMapKey, getPromotionResultArray, getPromotions, getPromotionsPerCoupon, getPromotionsPerOrderTotalCode, getPromotionsPerOrderTotalCode, getPromotionUsageCountMaxRetries, insertCoupon, isEnhancedVariantHandlingModeEnabled, processPrice, refreshConfigs, setCouponCriteriaWithStandardAttributes, setPromotionCriteriaWithStandardAttributes, setPromotionUsageCountMaxRetries, updatePromotionUsage, validateCoupon
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkCoupon, getAllPromotions, getCouponPerId, getCouponsPerCode, getPromotionIdForGiftCertificate, getPromotions, getPromotionsPerCoupon, getPromotionUsageCountMaxRetries, insertCoupon, refreshConfigs, setPromotionUsageCountMaxRetries, updatePromotionUsage
public PromotionMgrEE(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic ProductIf[] getPromotionsPerProducts(java.lang.String sessionId, int customerId, ProductIf[] products, PromotionIf[] promotions, java.lang.String[] couponCodes, PromotionOptionsIf options) throws java.lang.Exception
getPromotionsPerProducts
in interface PromotionMgrIf
getPromotionsPerProducts
in class PromotionMgr
sessionId
- Only used if the customer is logged in. Otherwise set to null.customerId
- If the sessionId is set to null then the customerId should contain the id of the
temporary user which is a negative number. The temporary user id can be used for
evaluating expression rules.products
- An array of products to be processedpromotions
- The promotions which will be applied to the products if all rules are matched.couponCodes
- Coupon codes to use. If none of the promotions require coupons, it should be set
to nulloptions
- An object containing information to configure the calculation for applying one or
more promotion results to the product price.java.lang.Exception
- an unexpected exceptionpublic PromotionIf getPromotion(int promotionId, java.lang.String promotionName, int languageId, FetchPromotionOptionsIf prmOptions, FetchProductOptionsIf prodOptions) throws java.lang.Exception
The purpose of this method is mainly to determine what products, manufacturers or categories
are included or excluded from the promotion in order to be able to display this information
on the storefront. However if the FetchPromotionOptions
is configured to only
return the promotion if active, then we check the following:
couponCodes
attribute of the FetchPromotionOptions
object has been populated and the promotion requires a coupon then we check that at least one
coupon will activate the promotion.getPromotion
in interface PromotionMgrIf
getPromotion
in class PromotionMgr
promotionId
- The numeric id of the promotion used to identify it. It should be set to a
negative number in order to search for the promotion using the promotion name.promotionName
- If not set to null, the promotion name is used to search for the promotion instead
of the numeric id.languageId
- The id for the language that will be used when creating the attached products,
categories and manufacturers. Value of -1 selects the default language.prmOptions
- A FetchPromotionOptions object used to configure the API call. It may be set to
null for default functionality.prodOptions
- A FetchProductOptions used to configure the products (if any) attached to the
promotion. It may be set to null for default functionality.java.lang.Exception
- an unexpected exceptionprotected java.lang.String getProductMapKey(int prodId, int prodOptionId, int prodOptionValueId)
prodId
- the prodIdprodOptionId
- the prodOptionIdprodOptionValueId
- the prodOptionValueIdCopyright © 2018 DS Data Systems UK Ltd.