Discounts
Allow you to create discounts on products, categories and brands.
Methods
Invoke via \Components\Commerce\Discounts::method()
Click a method name to copy it.
Activates a discount with a specific code
Removes all discounts that have been activated by code
Returns whether a discount with a specific id has been applied
Gets a record from the database
Parameters
$iDiscountId
int
A record's discount_id
Return a set of records from the database
Deletes a record from the database
Parameters
$iDiscountId
int
A record's discount_id
Return
Returns true if record existed and was deleted, otherwise false
Retrieves the number of discounts which require a code and enabled for public
Gets a single field from a record
Parameters
$iDiscountId
int
A record's discount_id
Retrieves the contact id on which discounts are currently meant to be applied to.
This is useful for custom algorithm discounts
Returns the number of records in the database (matching the filter if specified)
Saves a record into the database
Saves a specific column of a row into a database
Parameters
$iDiscountId
int
A record's discount_id
Return
Array of
Discounts that match the search query.