Documentation

DiscountCouponTable

DiscountCouponTable class for handling table with coupons for shopping cart discounts.

Class methods

MethodDescription Available from version
addPacketCreates one or several coupons for shopping cart discounts.
checkCouponChecks if coupon is unique and exists.
checkDiscountIdChecks field with discount ID.
checkPacketChecks data for creating a single or several coupons.
checkTypeChecks the field TYPE (coupon type).
clearDiscountCheckListClears list of discounts to update the flag Coupons available.
deleteByDiscountMethod deletes all coupons for discount with code $discount.
disableCheckCouponsUseDisables calculation for the flag Coupons available for discounts after calling methods add/update/delete.
enableCheckCouponsUseAllows calculation of the flag Coupons available for discounts after calling methods add/update/delete.
generateCouponGenerates a coupon code.
getCouponTypesReturns list of coupon types.
getMapReturns list of fields for table with shopping cart discount coupons.
getTableNameReturns name for table with shopping cart discount coupons in database.
isCheckedCouponsUseDefines to calculate the flag Coupons available for shopping cart discounts applicable for processed coupons.
isValidCouponTypeChecks if coupon type is valid.
onAfterAddDefault handler for the event onAfterAdd.
onAfterDelete Default handler for the event onAfterDelete.
onAfterUpdate Default handler for the event onAfterUpdate.
onBeforeAdd Default handler for the event onBeforeAdd.
onBeforeUpdate Default handler for the event onBeforeUpdate.
onDelete Default handler for the event onDelete.
onUpdate Default handler for the event onUpdate.
prepareCouponDataPrepares coupon data.
saveAppliedSave information about applied coupons.
setDiscountCheckListFills out list of discounts to update the flag Coupons available.
updateUseCouponsUpdates the flag Coupons available for the list of shopping cart discounts.
validateCouponReturns validator for the field COUPON (coupon code).
validateDiscountId Returns validator for the field DISCOUNT_ID (discount ID).
validateType Returns validator for the field TYPE (coupon code).

Fields for coupons for shopping cart discounts

Field Description Type Required
ID Coupon ID.Int Yes
DISCOUNT_ID Discount ID.Int Yes
ACTIVE Active status flag (Y/N). Char(1) Yes
ACTIVE_FROM Active from. Datetime No
ACTIVE_TO Active until. Datetime No
COUPON Coupon code.Varchar(32) Yes
TYPE Coupon type.Int Yes
MAX_USE Maximum possible number of coupon uses.Int Yes
USE_COUNT Coupon use count.Int Yes
USER_ID User ID - coupon owner.Int Yes
DATE_APPLY Date and time of last coupon application.Datetime No
TIMESTAMP_X Date and time of the last coupon update. Datetime No
MODIFY_BY User ID who was the last to update the coupon. Int No
DATE_CREATE Date and time when coupon was created.Datetime No
CREATED_BY User code who created a coupon.Int No
DESCRIPTION Comment to coupon. Text No


© «Bitrix24», 2001-2024
Up