Components \ commerce \ affiliates administrators commissions payments \ configuration paymentmethods \ shippingmethods \ methods delivery discounts \ products brands categories \ recurringsales storedcards \ sales items \ receipts allocations \ customers \ contacts passwords referrertypes \ relationships types \ groups contacts \ marketing \ emailmarketing \ sends contacts unsubscribers \ events attendees locations \ reminders \ automation eventremindertrigger \ settings administrators components configurationitems cpanel customfields \ developer scheduledtasks threads domains \ website \ analytics sessions comments \ designs generator media pages \ posts categories Framework \ architecture publicassets \ assets css javascript \ caching filebased \ components textualids \ data util \ database mainconnection date \ dom currentcontext renderer \ html converters highlighter javascript \ http redirection request session useragent \ i18n companytypes countries languages \ network cidr dns geoip random \ reflection api \ system filenames filesystem toasts
.
.
.
quick access
\ methods

\Components\Commerce\Products::

Access, create, update and delete the products in your online catalogue.

Class Methods

The following static methods are available on this class:
string configGetValue($strConfigId)
Description
Retrieves the value of a config item for the current component
Parameters
$strConfigId
string
Return
Config item value
bool delete($strKeyValue, $bDeleteMedia, $strReason)
Description
Deletes an entity and triggers the pre/post component events
Parameters
$strKeyValue
string
$bDeleteMedia
bool
$strReason
mixed
Return
bool
void determinePriceWithOrderOptions($iProductId, $arrOrderOptionsPost)
Description
Parameters
$iProductId
mixed
$arrOrderOptionsPost
mixed
Return
void
array get($strKey)
Description
Returns an entity
Parameters
$strKey
mixed
Value of the primary key
Return
{Array} getAll($arrProperties)
Description
Return all entities in the database.
Parameters
$arrProperties
mixed
Return
Array of Products
array getAllForCategoryAndBrand($iCategoryId, $iBrandId, $arrProperties)
Description
Returns all products for a given category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrProperties
mixed
Return
array
array getAllForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrProperties)
Description
Returns all products for a given category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrProperties
mixed
Return
array
mixed getColumn($strKey, $strColumn)
Description
Returns a single column of an entity
Parameters
$strKey
string
$strColumn
string
Return
mixed
array getConsole($strKey)
Description
Returns an entity
Parameters
$strKey
mixed
Value of the primary key
Return
Entity
int getCount($arrFilter)
Description
Returns a count of all rows in the data adapter
Parameters
$arrFilter
array
Return
int
int getCountForCategoryAndBrand($iCategoryId, $iBrandId)
Description
Returns the number of products in a category and brand
Parameters
$iCategoryId
int
$iBrandId
int
Return
int
void getFromPageURI($strPageURI)
Description
Retrieves a product from its page URI suffix $strPageURI may be the full URL or just the suffix
Parameters
$strPageURI
string
Return
void
string getLabelForOrderOptionValue($arrOptionValue)
Description
Returns a formatted label for an option value
Parameters
$arrOptionValue
mixed
Return
string
string getUnorderableMessage($arrProduct)
Description
Returns the text reason why a product is unorderable
Parameters
$arrProduct
array
Return
string
string mediaFolderGet($strKey)
Description
Returns the media folder for this data adapter
Parameters
$strKey
mixed
Return
Folder
void orderOptionsRequireRepost($arrOptionValues)
Description
Parameters
$arrOptionValues
mixed
Return
void
void renderDiscountPrice($arrProduct, $strColor, $bShortDisplay)
Description
Parameters
$arrProduct
mixed
$strColor
mixed
$bShortDisplay
mixed
Return
void
void renderPrice($iProductPrice, $strTags)
Description
Parameters
$iProductPrice
mixed
$strTags
mixed
Return
void
mixed save($arrEntity, $strReason)
Description
Saves an entity and triggers the pre/post component events
Parameters
$arrEntity
array
$strReason
string
Return
mixed
mixed saveColumn($strKeyValue, $strColumn, $strValue, $strReason)
Description
Changes a column of an existing entity Supports primary keys spanning on several columns if passing $strKeyValue as an associative arry
Parameters
$strKeyValue
string
$strColumn
string
$strValue
string
$strReason
string
Return
Id
array search($strSearch, $arrProperties)
Description
Performs a search
Parameters
$strSearch
string
$arrProperties
array
Return
array

Database Fields

The following fields are used when retrieving and saving entities.
product_barcode
varchar (31)
product_brand_id
int unsigned (10)
product_code
varchar (63)
product_content
longtext
product_created_datetime
datetime
product_disables_guest_checkout
tinyint (1)
product_group_pricing_adjustments_base
text
product_group_pricing_show_adjustments
text
product_group_pricing_show_adjustments_labels
text
product_group_pricing_show_normal
text
product_group_pricing_show_normal_labels
text
product_group_pricing_visibility
text
product_icon
varchar (127)
product_id
int unsigned (10)
product_inventory_is_public
tinyint unsigned (1)
product_inventory_is_unorderable_sold_out
tinyint unsigned (1)
product_inventory_level
int unsigned (10)
product_inventory_purchase_cost
decimal unsigned (8,2)
product_is_offline
tinyint (1)
product_is_orderable_for_someone_else
tinyint unsigned (1)
product_is_recurring
int (11)
product_is_shipping_required
tinyint unsigned (1)
Default value: 1
product_is_unorderable
tinyint unsigned (1)
product_max_quantity
int unsigned (10)
product_min_quantity
int unsigned (10)
product_modified_datetime
datetime
product_order
int (11)
product_order_form
longtext
product_order_options
text
product_price_base
decimal unsigned (8,2)
Default value: 0.00
product_sales_description
varchar (255)
product_search_description
varchar (255)
product_search_description_is_overriden
tinyint unsigned (1)
product_search_keywords
varchar (255)
product_search_keywords_is_overriden
tinyint unsigned (1)
product_shipping_depth_mm
int unsigned (10)
product_shipping_height_mm
int unsigned (10)
product_shipping_weight_g
int unsigned (10)
product_shipping_width_mm
int unsigned (10)
product_title
varchar (127)
product_uri_suffix
varchar (255)
product_uri_suffix_is_overriden
tinyint unsigned (1)
product_xero_account
varchar (255)
recurring_sale_amount
decimal unsigned (10,4)
recurring_sale_requires_creditcard
tinyint (4)
recurring_sale_schedule_interval
enum ('','weekly','fortnightly','monthly','quarterly','yearly')
Default value: monthly