Website
\Components\Website\Designs \Components\Website\Media \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories
Customers
\Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups
Marketing
\Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Locations
Commerce
\Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \Components\Settings\Domains
Other Apps
\Components\Website\Comments \Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards
Framework
\Framework\Assets\CSS \Framework\Assets\JavaScript \Framework\Caching\FileBased \Framework\Data\Util \Framework\Date \Framework\DOM\Renderer \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\GeoIP
.
.
.
Methods

\Components\Commerce\Products::

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

Class Methods

The following methods are available on this class:
void determinePriceWithOrderOptions($iProductId, $arrOrderOptionsPost)
Description
Parameters
$iProductId
mixed
$arrOrderOptionsPost
mixed
Return
void
array get($strKey)
Description
Gets a record from the database
Parameters
$strKey
mixed
Value of the primary key
Return
array getAll($arrProperties)
Description
Return a set of records from the database
Parameters
$arrProperties
array
Return
Array of Products
array getAllDeleted($arrProperties)
Description
Return all soft deleted entities in the database.
Parameters
$arrProperties
array
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 the number of rows in the database
Parameters
$arrFilter
array
Return
int
int getCountForCategoryAndBrand($iCategoryId, $iBrandId, $arrFilter)
Description
Returns the number of products in a category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrFilter
int
Return
int
int getCountForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrFilter)
Description
Returns product count given category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrFilter
mixed
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
array getIncludingDeleted($strKey)
Description
Returns an entity, regardless of whether or not it has been deleted
Parameters
$strKey
mixed
Value of the primary key
Return
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
void orderOptionsRequireRepost($arrOptionValues)
Description
Parameters
$arrOptionValues
mixed
Return
void
string renderPrice($fProductPrice, $strTags)
Description
Renders the price of a product
Parameters
$fProductPrice
float
$strTags
string
Return
string
string renderPriceExtras($arrProduct, $bShortDisplay)
Description
Renders any extra pricing information such as discounts or payment method hooks
Parameters
$arrProduct
array
$bShortDisplay
bool
Return
string
mixed save($arrEntity, $strReason)
Description
Saves a record into the database
Parameters
$arrEntity
array
$strReason
string
Return
mixed
mixed saveColumn($strKeyValue, $strColumn, $strValue, $strReason)
Description
Saves a specific column of a row into a database
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
bool delete($strKeyValue, $bDeleteMedia, $strReason)
Description
Deletes a record from the database
Parameters
$strKeyValue
string|array
$bDeleteMedia
bool
$strReason
mixed
Return
bool

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_deleted_datetime
datetime
product_disables_guest_checkout
tinyint (1)
product_gallery
longtext
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 (255)
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_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_price_usd
float
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