\Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations \Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups \Components\Customers\Groups\Contacts \Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Locations \Components\Settings\Administrators \Components\Settings\Domains \Components\Website\Analytics\Sessions \Components\Website\Comments \Components\Website\Designs \Components\Website\Media \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories \Framework\Architecture\PublicAssets \Framework\Assets\CSS \Framework\Assets\JavaScript \Framework\Caching\FileBased \Framework\Data\Util \Framework\Database\MainConnection \Framework\Date \Framework\DOM\Renderer \Framework\HTML\Converters \Framework\HTML\Highlighter \Framework\HTML\JavaScript \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\CIDR \Framework\Network\DNS \Framework\Network\GeoIP \Framework\Random \Framework\System\FileNames \Framework\System\FileSystem \Framework\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','every two months','quarterly','half yearly','yearly')
Default value: monthly