Templating
Global Functions
Website
\Components\Website\Designs \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\Caching\FileBased \Framework\Data\Util \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.

Methods

Invoke via \Components\Commerce\Products::method()
Click a method name to copy it.
void determinePriceWithOrderOptions($iProductId, $arrOrderOptionsPost)
Parameters
$iProductId
mixed
$arrOrderOptionsPost
mixed
array get($iProductId)
Gets a record from the database
Parameters
$iProductId
int unsigned
A record's product_id
Return
array getAll($arrQuery)
Return a set of records from the database
Parameters
$arrQuery
array|null
Return
Array of Products
array getAllDeleted($arrQuery)
Return all soft deleted records in the database.
Parameters
$arrQuery
array|null
Return
Array of Products
array getAllForCategoryAndBrand($iCategoryId, $iBrandId, $arrQuery)
Returns all products for a given category and brand
Parameters
$iCategoryId
int|null
$iBrandId
int|null
$arrQuery
array|null
Return
Array of Products
array getAllForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrQuery)
Returns all products for a given category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrQuery
array|null
Return
Array of Products
mixed getColumn($iProductId, $strColumn)
Returns a single column of an entity
Parameters
$iProductId
int unsigned
A record's product_id
$strColumn
string
Return
mixed
array getConsole($iProductId)
Returns an entity
Parameters
$iProductId
int unsigned
A record's product_id
Return
Entity
int getCount($arrFilter)
Returns the number of records in the database (matching the filter if specified)
Parameters
$arrFilter
array|null
Return
int
int getCountForCategoryAndBrand($iCategoryId, $iBrandId, $arrFilter)
Returns the number of products in a category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrFilter
int
Return
int
int getCountForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrFilter)
Returns product count given category and brand
Parameters
$iCategoryId
int
$iBrandId
int
$arrFilter
mixed
Return
int
void getFromPageURI($strPageURI)
Retrieves a product from its page URI suffix $strPageURI may be the full URL or just the suffix
Parameters
$strPageURI
string
array getIncludingDeleted($iProductId)
Returns a record, regardless of whether or not it has been deleted
Parameters
$iProductId
int unsigned
A record's product_id
Return
string getLabelForOrderOptionValue($arrOptionValue)
Returns a formatted label for an option value
Parameters
$arrOptionValue
mixed
Return
string
string getUnorderableMessage($arrProduct)
Returns the text reason why a product is unorderable
Parameters
$arrProduct
array
Return
string
void orderOptionsRequireRepost($arrOptionValues)
Parameters
$arrOptionValues
mixed
string renderPrice($fProductPrice, $strTags)
Renders the price of a product
Parameters
$fProductPrice
float
$strTags
string
Return
string
string renderPriceExtras($arrProduct, $bShortDisplay)
Renders any extra pricing information such as discounts or payment method hooks
Parameters
$arrProduct
array
$bShortDisplay
bool
Return
string
int unsigned save($arrEntity)
Saves a record into the database
Parameters
$arrEntity
array
Return
The record's product_id
void saveColumn($iProductId, $strColumn, $strValue)
Saves a specific column of a row into a database
Parameters
$iProductId
int unsigned
A record's product_id
$strColumn
string
$strValue
string
array search($strSearch, $arrQuery)
Performs a search
Parameters
$strSearch
string
$arrQuery
array|null
Return
array
bool delete($iProductId, $bDeleteMedia)
Deletes a record from the database
Parameters
$iProductId
int unsigned
A record's product_id
$bDeleteMedia
bool
Return
Returns true if record existed and was deleted, otherwise false

Database Fields

The following fields are used when retrieving and saving entities.
product_id
int unsigned (10)
product_title
string (127)
product_price_base
decimal unsigned (8,2)
Default value: 0.00
product_icon
string (255)
product_gallery
string (4294967295)
product_order
int (11)
product_content
string (4294967295)
product_order_form
string (4294967295)
product_created_datetime
datetime
product_modified_datetime
datetime
product_deleted_datetime
datetime
product_is_offline
0 or 1
product_is_unorderable
0 or 1
product_is_orderable_for_someone_else
0 or 1
product_disables_guest_checkout
0 or 1
product_code
string (63)
product_barcode
string (31)
product_sales_description
string (255)
product_order_options
string (65535)
product_is_shipping_required
0 or 1
Default value: 1
product_shipping_width_mm
int unsigned (10)
product_shipping_height_mm
int unsigned (10)
product_shipping_depth_mm
int unsigned (10)
product_shipping_weight_g
int unsigned (10)
product_inventory_level
int unsigned (10)
product_inventory_is_public
0 or 1
product_inventory_is_unorderable_sold_out
0 or 1
product_brand_id
int unsigned (10)
product_group_visibility
string (65535)
product_group_visibility_hidden_in_lists
0 or 1
product_max_quantity
int unsigned (10)
product_min_quantity
int unsigned (10)
product_uri_suffix
string (255)
product_uri_suffix_is_overridden
0 or 1
product_search_keywords
string (255)
product_search_keywords_is_overridden
0 or 1
product_search_title
string (255)
product_search_title_is_overridden
0 or 1
product_search_description
string (255)
product_search_description_is_overridden
0 or 1