\Commerce\Products
Templating
Global Functions
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\Categories \Components\Marketing\Events\Locations
Commerce
\Components\Commerce\Carts \Components\Commerce\Carts\Current \Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products
METHODS
\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\CustomFields \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 \Framework\Data\Util \Framework\DOM\CurrentContext \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

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, $sKey)
Parameters
$iProductId
mixed
$arrOrderOptionsPost
mixed
$sKey
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
mixed
Return
Array of Products
array getAllDeleted($arrQuery)
Return all soft deleted records in the database.
Parameters
$arrQuery
mixed
Return
Array of Products
array getAllForCategoryAndBrand($iCategoryId, $iBrandId, $arrQuery)
Returns all products for a given category and brand
Parameters
$iCategoryId
mixed
$iBrandId
mixed
$arrQuery
mixed
Return
Array of Products
array getAllForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrQuery)
Returns all products for a given category and brand
Parameters
$iCategoryId
mixed
$iBrandId
mixed
$arrQuery
mixed
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
mixed
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
mixed
Return
int
int getCountForCategoryAndBrand($iCategoryId, $iBrandId, $arrFilter)
Returns the number of products in a category and brand
Parameters
$iCategoryId
mixed
$iBrandId
mixed
$arrFilter
mixed
Return
int
bool delete($iProductId, $bDeleteMedia)
Deletes a record from the database
Parameters
$iProductId
int unsigned
A record's product_id
$bDeleteMedia
mixed
Return
Returns true if record existed and was deleted, otherwise false
int getCountForCategoryAndBrandRecursive($iCategoryId, $iBrandId, $arrFilter)
Returns product count given category and brand
Parameters
$iCategoryId
mixed
$iBrandId
mixed
$arrFilter
mixed
Return
int
array getFromPageRequest()
Retrieves a product from its page URI and applies any posted order options
Return
array
void getFromPageURI($strPageURI)
Retrieves a product from its page URI
Parameters
$strPageURI
mixed
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
mixed
Return
string
void orderOptionsRequireRepost($arrOptionValues)
Parameters
$arrOptionValues
mixed
string renderPrice($arrProduct, $strTags)
Renders the price of a product
Parameters
$arrProduct
mixed
$strTags
mixed
Return
string
string renderPriceExtras($arrProduct, $bShortDisplay)
Renders any extra pricing information such as discounts or payment method hooks
Parameters
$arrProduct
mixed
$bShortDisplay
mixed
Return
string
string|int save($arrEntity)
Saves a record into the database
Parameters
$arrEntity
mixed
Return
string|int
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
mixed
$strValue
mixed
array search($strSearch, $arrQuery)
Performs a search
Parameters
$strSearch
mixed
$arrQuery
mixed
Return
array

Database Fields

The following fields are used when retrieving and saving entities.
product_id
int unsigned (10)
product_title
string (255)
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 (16777215)
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 (16777215)
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