ccrz.ccLogicCartAddTo.addCouponCode

Calls the ccrz.ccApiCoupon.apply method for applying a coupon code to the cart.

Compatibility

This reference applies to:

Release Managed Package Version API Version
B2B Commerce for Visualforce Winter ’21 4.13 12
B2B Commerce for Visualforce Spring ’20 4.12 11
B2B Commerce for Visualforce Summer ’19 4.11 10
B2B Commerce for Visualforce Spring ’19 4.10 9
B2B Commerce for Visualforce Summer ’18 4.9 8

Signature

global virtual Map<String, Object> addCouponCode(Map<String, Object>)

Inputs (Required)

This method accepts the working Map<String, Object> from the ccrz.ccLogicCartAddTo.fetchCart method.

This method executes only if the working map includes the following key with a value of true:

ccrz.ccApiCart.HAS_COUPON_CODE
Boolean
Value Usage
true The input map specified ccrz.ccApiCart.COUPON_CODE.
false The input map didn't specify ccrz.ccApiCart.COUPON_CODE.

This method also evaluates the following keys:

ccrz.ccApiCart.RESPONSE
Map<String, Object> that describes the status of the logic chain for this method, such as the current value of the ccrz.ccApi.SUCCESS return key.

This method passes the ccrz.ccApiCart.COUPON_CODE and ccrz.ccApiCart.CART_ENCID keys to the ccrz.ccApiCoupon.apply method.

Outputs

This method returns the working Map<String, Object>, and sets the following key:

ccrz.ccApiCart.ISREPRICE
Boolean that's set to true after the coupon is applied for repricing the cart.