DiscountCouponTable
DiscountCouponTable class for handling table with coupons for shopping cart discounts.
Class methods
Method | Description | Available from version |
---|---|---|
addPacket | Creates one or several coupons for shopping cart discounts. | |
checkCoupon | Checks if coupon is unique and exists. | |
checkDiscountId | Checks field with discount ID. | |
checkPacket | Checks data for creating a single or several coupons. | |
checkType | Checks the field TYPE (coupon type). |
|
clearDiscountCheckList | Clears list of discounts to update the flag Coupons available. | |
deleteByDiscount | Method deletes all coupons for discount with code $discount . |
|
disableCheckCouponsUse | Disables calculation for the flag Coupons available for discounts after calling methods add/update/delete . |
|
enableCheckCouponsUse | Allows calculation of the flag Coupons available for discounts after calling methods add/update/delete . |
|
generateCoupon | Generates a coupon code. | |
getCouponTypes | Returns list of coupon types. | |
getMap | Returns list of fields for table with shopping cart discount coupons. | |
getTableName | Returns name for table with shopping cart discount coupons in database. | |
isCheckedCouponsUse | Defines to calculate the flag Coupons available for shopping cart discounts applicable for processed coupons. | |
isValidCouponType | Checks if coupon type is valid. | |
onAfterAdd | Default 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 . |
|
prepareCouponData | Prepares coupon data. | |
saveApplied | Save information about applied coupons. | |
setDiscountCheckList | Fills out list of discounts to update the flag Coupons available. | |
updateUseCoupons | Updates the flag Coupons available for the list of shopping cart discounts. | |
validateCoupon | Returns 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