Documentation

DiscountTable

DiscountTable class for handling table with product discounts.

Class methods

MethodDescription Available from version
addAdds a new discount according to data from the $data array.
checkTypeVerifies the field TYPE (discount type: standard or cumulative).
convertCurrencyRecalculates discount parameters in other currency (store currency).
deleteDeletes discount with $primary key.
getMapReturns list of fields for table with product discounts.
getTableNameReturns name for table with product discounts.
updateUpdates discount parameters with $primary key according to data from the $data array.
validateCouponReturns validator for the field COUPON (coupon code).
validateCurrencyReturns validator for the field CURRENCY (currency ID).
validateNameReturns validator for the field NAME (discount name).
validateNotesReturns validator for the field NOTES (discount brief description).
validateSiteIdReturns validator for the field SITE_ID (site identifier).
validateTypeReturns validator for the field TYPE (discount type: standard or cumulative).
validateXmlIdReturns validator for the field XML_ID (external ID).

Product discount fields

Field Description Type Required
ID Discount ID.Int Yes
XML_ID External ID.Varchar(255) No
SITE_ID Site ID.Char(2) Yes
TYPE Discout type: standard of cumulative.Int Yes
ACTIVE Active status flag. Char(1) Yes
ACTIVE_FROM Discount start date. Datetime No
ACTIVE_TO Discount end date. Datetime No
RENEWAL Flag "Applicable to subscription extension". Char(1) Yes
NAME Discount name. Varchar(255) No
SORT Sort order. Int Yes
MAX_DISCOUNT Maximum discount value. Decimal(18,4) No
VALUE_TYPE Discount type (P - in percent, F - fixed value, S - set price for product). Char(1) Yes
VALUE Discount length. Decimal(18,4) Yes
CURRENCY Currency. Char(3) Yes
TIMESTAMP_X Date and time for discount update. Datetime Yes
COUNT_PERIOD Period to calculate discount (U - for all the time, P - for the last days/months/years, D - for a period). Char(1) Yes
COUNT_SIZE Period length, with selected paid orders. Int Yes
COUNT_TYPE Period type (D - day, M - month, Y - year). Char(1) Yes
COUNT_FROM Date when discount calculation period starts. Datetime No
COUNT_TO Date when discount calculation period ends. Datetime No
ACTION_SIZE Discount period. Int Yes
ACTION_TYPE Discount validity deadline. Char(1) Yes
MODIFIED_BY Last user ID who modified a discount. Int No
DATE_CREATE Date and time for discount creation. Datetime No
CREATED_BY User ID who created discount. Int No
PRIORITY Application priority. Int Yes
LAST_DISCOUNT Flag "Last discount" (Y/N). Char(1) Yes
VERSION Discount engine version. Read only field. Int Yes
NOTES Brief description. Varchar(255) No
CONDITIONS Discount application conditions. Text No
UNPACK PHP code for discount application conditions. Read only field. Text No


© «Bitrix24», 2001-2022
Up