\ProductCore

Summary

Methods
Properties
Constants
__construct()
getFieldsShop()
add()
update()
initPricesComputation()
getTaxCalculationMethod()
updatePosition()
cleanPositions()
getDefaultAttribute()
setAvailableDate()
getAvailableDate()
updateIsVirtual()
validateField()
toggleStatus()
delete()
deleteSelection()
deleteFromCartRules()
deleteFromSupplier()
addToCategories()
updateCategories()
deleteCategory()
deleteCategories()
deleteTags()
deleteCartProducts()
deleteImages()
getProductAttributePrice()
getProducts()
getSimpleProducts()
isNew()
productAttributeExists()
addProductAttribute()
generateMultipleCombinations()
addCombinationEntity()
addProductAttributeMultiple()
deleteDefaultAttributes()
setDefaultAttribute()
updateDefaultAttribute()
updateProductAttribute()
addSupplierReference()
updateAttribute()
addAttribute()
updateQuantityProductWithAttributeQuantity()
deleteProductAttributes()
deleteAttributesImpacts()
deleteProductFeatures()
updateCacheAttachment()
deleteAttachments()
deleteCustomization()
deletePack()
deleteProductSale()
deleteSceneProducts()
deleteSearchIndexes()
addAttributeCombinaison()
addAttributeCombinationMultiple()
deleteAttributeCombination()
deleteFeatures()
getAttributesResume()
getAttributeCombinations()
getAttributeCombinationsById()
getCombinationImages()
getCombinationImageById()
hasAttributes()
getNewProducts()
getRandomSpecial()
getPricesDrop()
getProductCategories()
getProductCategoriesFull()
getCategories()
getCarriers()
setCarriers()
getImages()
getCover()
getPriceStatic()
priceCalculation()
convertAndFormatPrice()
isDiscounted()
getPrice()
getPublicPrice()
getIdProductAttributeMostExpensive()
getDefaultIdProductAttribute()
getPriceWithoutReduct()
convertPrice()
convertPriceWithCurrency()
displayWtPrice()
displayWtPriceWithCurrency()
getQuantity()
sqlStock()
updateQuantity()
reinjectQuantities()
isAvailableWhenOutOfStock()
checkQty()
checkDefaultAttributes()
getAttributesColorList()
getAttributesGroups()
deleteAccessories()
deleteFromAccessories()
getAccessoriesLight()
getAccessories()
getAccessoryById()
changeAccessories()
addFeaturesCustomToDB()
addFeaturesToDB()
addFeatureProductImport()
getFeatures()
getFeaturesStatic()
cacheProductsFeatures()
cacheFrontFeatures()
searchByName()
duplicateAttributes()
getAttributesImpacts()
_getAttributeImageAssociations()
duplicateAccessories()
duplicateTags()
duplicateDownload()
duplicateAttachments()
duplicateFeatures()
duplicateSpecificPrices()
duplicateCustomizationFields()
getLink()
getTags()
defineProductImage()
getProductProperties()
getTaxesInformations()
getProductsProperties()
getFrontFeaturesStatic()
getFrontFeatures()
getAttachmentsStatic()
getAttachments()
getAllCustomizedDatas()
addCustomizationPrice()
createLabels()
updateLabels()
getCustomizationFields()
getCustomizationFieldIds()
getRequiredCustomizableFields()
getRequiredCustomizableFieldsStatic()
hasAllRequiredCustomizableFields()
idIsOnCategoryId()
getNoPackPrice()
checkAccess()
checkAccessStatic()
addStockMvt()
getStockMvts()
getUrlRewriteInformations()
getIdTaxRulesGroup()
getIdTaxRulesGroupByIdProduct()
getTaxesRate()
getWsProductFeatures()
setWsProductFeatures()
getWsDefaultCombination()
setWsDefaultCombination()
getWsCategories()
setWsCategories()
getWsAccessories()
setWsAccessories()
getWsCombinations()
setWsCombinations()
getWsProductOptionValues()
getWsPositionInCategory()
setWsPositionInCategory()
getCoverWs()
setCoverWs()
getWsImages()
getWsStockAvailables()
getWsTags()
setWsTags()
deleteWsTags()
getWsManufacturerName()
resetEcoTax()
setGroupReduction()
existsRefInDatabase()
getProductAttributesIds()
getAttributesParams()
getAttributesInformationsByProduct()
getAnchor()
getProductName()
addWs()
updateWs()
getRealQuantity()
usesAdvancedStockManagement()
flushPriceCache()
getParentCategories()
loadStockData()
useAdvancedStockManagement()
setAdvancedStockManagement()
getDefaultCategory()
getShopsByProduct()
deleteDownload()
getAttributeCombinaisons()
deleteAttributeCombinaison()
getType()
hasAttributesInOtherShops()
getIdTaxRulesGroupMostUsed()
getIdByEan13()
getWsType()
modifierWsLinkRewrite()
getWsProductBundle()
setWsType()
setWsProductBundle()
isColorUnavailable()
getColorsListCacheId()
setPackStockType()
$tax_name
$tax_rate
$id_manufacturer
$id_supplier
$id_category_default
$id_shop_default
$manufacturer_name
$supplier_name
$name
$description
$description_short
$quantity
$minimal_quantity
$available_now
$available_later
$price
$additional_shipping_cost
$wholesale_price
$on_sale
$online_only
$unity
$unit_price
$unit_price_ratio
$ecotax
$reference
$supplier_reference
$location
$width
$height
$depth
$weight
$ean13
$upc
$link_rewrite
$meta_description
$meta_keywords
$meta_title
$quantity_discount
$customizable
$new
$uploadable_files
$text_fields
$active
$redirect_type
$id_product_redirected
$available_for_order
$available_date
$condition
$show_price
$indexed
$visibility
$date_add
$date_upd
$tags
$id_tax_rules_group
$id_color_default
$advanced_stock_management
$out_of_stock
$depends_on_stock
$isFullyLoaded
$cache_is_pack
$cache_has_attachments
$is_virtual
$id_pack_product_attribute
$cache_default_attribute
$category
$pack_stock_type
$_taxCalculationMethod
$definition
CUSTOMIZE_FILE
CUSTOMIZE_TEXTFIELD
PTYPE_SIMPLE
PTYPE_PACK
PTYPE_VIRTUAL
_getProductIdByDate()
_getCustomizationFieldsNLabels()
_checkLabelField()
_deleteOldLabels()
_createLabel()
$_prices
$_pricesLevel2
$_incat
$_cart_quantity
$_tax_rules_group
$_cacheFeatures
$_frontFeaturesCache
$producPropertiesCache
$cacheStock
$webserviceParameters
N/A
No private methods found
No private properties found
N/A

Constants

CUSTOMIZE_FILE

CUSTOMIZE_FILE

CUSTOMIZE_TEXTFIELD

CUSTOMIZE_TEXTFIELD

PTYPE_SIMPLE

PTYPE_SIMPLE

Note: prefix is "PTYPE" because TYPE_ is used in ObjectModel (definition)

PTYPE_PACK

PTYPE_PACK

PTYPE_VIRTUAL

PTYPE_VIRTUAL

Properties

$tax_name

$tax_name : string

Type

string — Tax name

$tax_rate

$tax_rate : string

Type

string — Tax rate

$id_manufacturer

$id_manufacturer : integer

Type

integer — Manufacturer id

$id_supplier

$id_supplier : integer

Type

integer — Supplier id

$id_category_default

$id_category_default : integer

Type

integer — default Category id

$id_shop_default

$id_shop_default : integer

Type

integer — default Shop id

$manufacturer_name

$manufacturer_name : string

Type

string — Manufacturer name

$supplier_name

$supplier_name : string

Type

string — Supplier name

$name

$name : string

Type

string — Name

$description

$description : string

Type

string — Long description

$description_short

$description_short : string

Type

string — Short description

$quantity

$quantity : integer

Type

integer — Quantity available

$minimal_quantity

$minimal_quantity : integer

Type

integer — Minimal quantity for add to cart

$available_now

$available_now : string

Type

string — available_now

$available_later

$available_later : string

Type

string — available_later

$price

$price : float

Type

float — Price in euros

$additional_shipping_cost

$additional_shipping_cost : float

Type

float — Additional shipping cost

$wholesale_price

$wholesale_price : float

Type

float — Wholesale Price in euros

$on_sale

$on_sale : boolean

Type

boolean — on_sale

$online_only

$online_only : boolean

Type

boolean — online_only

$unity

$unity : string

Type

string — unity

$unit_price

$unit_price : float

Type

float — price for product's unity

$unit_price_ratio

$unit_price_ratio : float

Type

float — price for product's unity ratio

$ecotax

$ecotax : float

Type

float — Ecotax

$reference

$reference : string

Type

string — Reference

$supplier_reference

$supplier_reference : string

Type

string — Supplier Reference

$location

$location : string

Type

string — Location

$width

$width : string

Type

string — Width in default width unit

$height

$height : string

Type

string — Height in default height unit

$depth

$depth : string

Type

string — Depth in default depth unit

$weight

$weight : string

Type

string — Weight in default weight unit

$ean13

$ean13 : string

Type

string — Ean-13 barcode

$upc

$upc : string

Type

string — Upc barcode

$link_rewrite

$link_rewrite : string

Type

string — Friendly URL

$meta_description

$meta_description : string

Type

string — Meta tag description

$meta_keywords

$meta_keywords : string

Type

string — Meta tag keywords

$meta_title

$meta_title : string

Type

string — Meta tag title

$quantity_discount

$quantity_discount : boolean

Type

boolean — Product statuts

$customizable

$customizable : boolean

Type

boolean — Product customization

$new

$new : boolean

Type

boolean — Product is new

$uploadable_files

$uploadable_files : integer

Type

integer — Number of uploadable files (concerning customizable products)

$text_fields

$text_fields : integer

Type

integer — Number of text fields

$active

$active : boolean

Type

boolean — Product statuts

$redirect_type

$redirect_type : boolean

Type

boolean — Product statuts

$id_product_redirected

$id_product_redirected : boolean

Type

boolean — Product statuts

$available_for_order

$available_for_order : boolean

Type

boolean — Product available for order

$available_date

$available_date : string

Type

string — Object available order date

$condition

$condition : \enum

Type

\enum — Product condition (new, used, refurbished)

$show_price

$show_price : boolean

Type

boolean — Show price of Product

$indexed

$indexed : boolean

Type

boolean — is the product indexed in the search index?

$visibility

$visibility : string

Type

string — ENUM('both', 'catalog', 'search', 'none') front office visibility

$date_add

$date_add : string

Type

string — Object creation date

$date_upd

$date_upd : string

Type

string — Object last modification date

$tags

$tags : 

Type

$id_tax_rules_group

$id_tax_rules_group : 

Type

$id_color_default

$id_color_default : 

We keep this variable for retrocompatibility for themes

Type

$advanced_stock_management

$advanced_stock_management : boolean

Type

boolean — Tells if the product uses the advanced stock management

$out_of_stock

$out_of_stock : 

Type

$depends_on_stock

$depends_on_stock : 

Type

$isFullyLoaded

$isFullyLoaded : 

Type

$cache_is_pack

$cache_is_pack : 

Type

$cache_has_attachments

$cache_has_attachments : 

Type

$is_virtual

$is_virtual : 

Type

$id_pack_product_attribute

$id_pack_product_attribute : 

Type

$cache_default_attribute

$cache_default_attribute : 

Type

$category

$category : string

Type

string — If product is populated, this property contain the rewrite link of the default category

$pack_stock_type

$pack_stock_type : integer

Type

integer — tell the type of stock management to apply on the pack

$_taxCalculationMethod

$_taxCalculationMethod : 

Type

$definition

$definition : 

Type

$_prices

$_prices : 

Type

$_pricesLevel2

$_pricesLevel2 : 

Type

$_incat

$_incat : 

Type

$_cart_quantity

$_cart_quantity : array

Type

array — is deprecated since 1.5.6.1

$_tax_rules_group

$_tax_rules_group : 

Type

$_cacheFeatures

$_cacheFeatures : 

Type

$_frontFeaturesCache

$_frontFeaturesCache : 

Type

$producPropertiesCache

$producPropertiesCache : 

Type

$cacheStock

$cacheStock : array

Type

array — cache stock data in getStock() method

$webserviceParameters

$webserviceParameters : 

Type

Methods

__construct()

__construct(  $id_product = null,   $full = false,   $id_lang = null,   $id_shop = null, \Context  $context = null) 

Parameters

$id_product
$full
$id_lang
$id_shop
\Context $context

getFieldsShop()

getFieldsShop() : array

Returns

array

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

update()

update(  $null_values = false) 

Parameters

$null_values

initPricesComputation()

initPricesComputation(  $id_customer = null) 

Parameters

$id_customer

getTaxCalculationMethod()

getTaxCalculationMethod(  $id_customer = null) 

Parameters

$id_customer

updatePosition()

updatePosition(boolean  $way, integer  $position) 

Move a product inside its category

Parameters

boolean $way

Up (1) or Down (0)

integer $position

return boolean Update result

cleanPositions()

cleanPositions(  $id_category,   $position) 

Parameters

$id_category
$position

getDefaultAttribute()

getDefaultAttribute(  $id_product,   $minimum_quantity) : integer

Get the default attribute for a product

Parameters

$id_product
$minimum_quantity

Returns

integer —

Attributes list

setAvailableDate()

setAvailableDate(  $available_date = '0000-00-00') 

Parameters

$available_date

getAvailableDate()

getAvailableDate(integer  $id_product, integer  $id_product_attribute = null) : \string/null

For a given id_product and id_product_attribute, return available date

Parameters

integer $id_product
integer $id_product_attribute

Optional

Returns

\string/null

updateIsVirtual()

updateIsVirtual(  $id_product,   $is_virtual = true) 

Parameters

$id_product
$is_virtual

validateField()

validateField(  $field,   $value,   $id_lang = null,   $skip = array(),   $human_errors = false) 

Parameters

$field
$value
$id_lang
$skip
$human_errors

toggleStatus()

toggleStatus() 

delete()

delete() 

deleteSelection()

deleteSelection(  $products) 

Parameters

$products

deleteFromCartRules()

deleteFromCartRules() 

deleteFromSupplier()

deleteFromSupplier() 

addToCategories()

addToCategories(mixed  $categories = array()) : boolean

addToCategories add this product to the category/ies if not exists.

Parameters

mixed $categories

id_category or array of id_category

Returns

boolean —

true if succeed

updateCategories()

updateCategories(  $categories, boolean  $keeping_current_pos = false) : array

Update categories to index product into

Parameters

$categories
boolean $keeping_current_pos

(deprecated, no more used)

Returns

array —

Update/insertion result

deleteCategory()

deleteCategory(mixed  $id_category, mixed  $clean_positions = true) : boolean

deleteCategory delete this product from the category $id_category

Parameters

mixed $id_category
mixed $clean_positions

Returns

boolean

deleteCategories()

deleteCategories(boolean  $clean_positions = false) : array

Delete all association to category where product is indexed

Parameters

boolean $clean_positions

clean category positions after deletion

Returns

array —

Deletion result

deleteTags()

deleteTags() : array

Delete products tags entries

Returns

array —

Deletion result

deleteCartProducts()

deleteCartProducts() : array

Delete product from cart

Returns

array —

Deletion result

deleteImages()

deleteImages() : boolean

Delete product images from database

Returns

boolean —

success

getProductAttributePrice()

getProductAttributePrice(  $id_product_attribute) 

Parameters

$id_product_attribute

getProducts()

getProducts(integer  $id_lang, integer  $start, integer  $limit, string  $order_by, string  $order_way,   $id_category = false,   $only_active = false, \Context  $context = null) : array

Get all available products

Parameters

integer $id_lang

Language id

integer $start

Start number

integer $limit

Number of products to return

string $order_by

Field for ordering

string $order_way

Way for ordering (ASC or DESC)

$id_category
$only_active
\Context $context

Returns

array —

Products details

getSimpleProducts()

getSimpleProducts(  $id_lang, \Context  $context = null) 

Parameters

$id_lang
\Context $context

isNew()

isNew() 

productAttributeExists()

productAttributeExists(  $attributes_list,   $current_product_attribute = false, \Context  $context = null,   $all_shops = false,   $return_id = false) 

Parameters

$attributes_list
$current_product_attribute
\Context $context
$all_shops
$return_id

addProductAttribute()

addProductAttribute(  $price,   $weight,   $unit_impact,   $ecotax,   $quantity,   $id_images,   $reference,   $id_supplier = null,   $ean13,   $default,   $location = null,   $upc = null,   $minimal_quantity = 1) 

addProductAttribute is deprecated

The quantity params now set StockAvailable for the current shop with the specified quantity The supplier_reference params now set the supplier reference of the default supplier of the product if possible

Parameters

$price
$weight
$unit_impact
$ecotax
$quantity
$id_images
$reference
$id_supplier
$ean13
$default
$location
$upc
$minimal_quantity

generateMultipleCombinations()

generateMultipleCombinations(  $combinations,   $attributes) 

Parameters

$combinations
$attributes

addCombinationEntity()

addCombinationEntity(  $wholesale_price,   $price,   $weight,   $unit_impact,   $ecotax, integer  $quantity,   $id_images,   $reference,   $id_supplier,   $ean13,   $default,   $location = null,   $upc = null,   $minimal_quantity = 1, array  $id_shop_list = array(),   $available_date = null) 

Parameters

$wholesale_price
$price
$weight
$unit_impact
$ecotax
integer $quantity

DEPRECATED

$id_images
$reference
$id_supplier
$ean13
$default
$location
$upc
$minimal_quantity
array $id_shop_list
$available_date

addProductAttributeMultiple()

addProductAttributeMultiple(  $attributes,   $set_default = true) 

Parameters

$attributes
$set_default

deleteDefaultAttributes()

deleteDefaultAttributes() 

Del all default attributes for product

setDefaultAttribute()

setDefaultAttribute(  $id_product_attribute) 

Parameters

$id_product_attribute

updateDefaultAttribute()

updateDefaultAttribute(  $id_product) 

Parameters

$id_product

updateProductAttribute()

updateProductAttribute(  $id_product_attribute,   $wholesale_price,   $price,   $weight,   $unit,   $ecotax,   $id_images,   $reference,   $id_supplier = null,   $ean13,   $default,   $location = null,   $upc = null,   $minimal_quantity,   $available_date) 

Update a product attribute

Parameters

$id_product_attribute
$wholesale_price
$price
$weight
$unit
$ecotax
$id_images
$reference
$id_supplier
$ean13
$default
$location
$upc
$minimal_quantity
$available_date

addSupplierReference()

addSupplierReference(integer  $id_supplier, integer  $id_product_attribute, string  $supplier_reference = null, float  $price = null, integer  $id_currency = null) 

Sets or updates Supplier Reference

Parameters

integer $id_supplier
integer $id_product_attribute
string $supplier_reference
float $price
integer $id_currency

updateAttribute()

updateAttribute(integer  $id_product_attribute, float  $wholesale_price, float  $price, float  $weight, float  $unit, float  $ecotax,   $id_images, string  $reference, string  $ean13, integer  $default,   $location = null, string  $upc = null, string  $minimal_quantity = null,   $available_date = null,   $update_all_fields = true, array  $id_shop_list = array()) : array

Update a product attribute

Parameters

integer $id_product_attribute

Product attribute id

float $wholesale_price

Wholesale price

float $price

Additional price

float $weight

Additional weight

float $unit
float $ecotax

Additional ecotax

$id_images
string $reference

Reference

string $ean13

Ean-13 barcode

integer $default

Default On

$location
string $upc

Upc barcode

string $minimal_quantity

Minimal quantity

$available_date
$update_all_fields
array $id_shop_list

Returns

array —

Update result

addAttribute()

addAttribute(float  $price, float  $weight,   $unit_impact, float  $ecotax, integer  $id_images, string  $reference, string  $ean13, boolean  $default, string  $location = null,   $upc = null, integer  $minimal_quantity = 1, array  $id_shop_list = array(),   $available_date = null) : mixed

Add a product attribute

Parameters

float $price

Additional price

float $weight

Additional weight

$unit_impact
float $ecotax

Additional ecotax

integer $id_images

Image ids

string $reference

Reference

string $ean13

Ean-13 barcode

boolean $default

Is default attribute for product

string $location

Location

$upc
integer $minimal_quantity

Minimal quantity to add to cart

array $id_shop_list
$available_date

Returns

mixed —

$id_product_attribute or false

updateQuantityProductWithAttributeQuantity()

updateQuantityProductWithAttributeQuantity() 

deleteProductAttributes()

deleteProductAttributes() : array

Delete product attributes

Returns

array —

Deletion result

deleteAttributesImpacts()

deleteAttributesImpacts() : \Deletion

Delete product attributes impacts

Returns

\Deletion —

result

deleteProductFeatures()

deleteProductFeatures() : array

Delete product features

Returns

array —

Deletion result

updateCacheAttachment()

updateCacheAttachment(  $id_product) 

Parameters

$id_product

deleteAttachments()

deleteAttachments(  $update_attachment_cache = true) : array

Delete product attachments

Parameters

$update_attachment_cache

Returns

array —

Deletion result

deleteCustomization()

deleteCustomization() : array

Delete product customizations

Returns

array —

Deletion result

deletePack()

deletePack() : array

Delete product pack details

Returns

array —

Deletion result

deleteProductSale()

deleteProductSale() : array

Delete product sales

Returns

array —

Deletion result

deleteSceneProducts()

deleteSceneProducts() : array

Delete product in its scenes

Returns

array —

Deletion result

deleteSearchIndexes()

deleteSearchIndexes() : array

Delete product indexed words

Returns

array —

Deletion result

addAttributeCombinaison()

addAttributeCombinaison(integer  $id_product_attribute, array  $attributes) : array

Add a product attributes combinaison

Parameters

integer $id_product_attribute

Product attribute id

array $attributes

Attributes to forge combinaison

Returns

array —

Insertion result

addAttributeCombinationMultiple()

addAttributeCombinationMultiple(  $id_attributes,   $combinations) 

Parameters

$id_attributes
$combinations

deleteAttributeCombination()

deleteAttributeCombination(integer  $id_product_attribute) : array

Delete a product attributes combination

Parameters

integer $id_product_attribute

Product attribute id

Returns

array —

Deletion result

deleteFeatures()

deleteFeatures() 

Delete features

getAttributesResume()

getAttributesResume(integer  $id_lang,   $attribute_value_separator = ' - ',   $attribute_separator = ', ') : array

Get all available product attributes resume

Parameters

integer $id_lang

Language id

$attribute_value_separator
$attribute_separator

Returns

array —

Product attributes combinations

getAttributeCombinations()

getAttributeCombinations(integer  $id_lang) : array

Get all available product attributes combinations

Parameters

integer $id_lang

Language id

Returns

array —

Product attributes combinations

getAttributeCombinationsById()

getAttributeCombinationsById(integer  $id_product_attribute, integer  $id_lang) : array

Get product attribute combination by id_product_attribute

Parameters

integer $id_product_attribute
integer $id_lang

Language id

Returns

array —

Product attribute combination by id_product_attribute

getCombinationImages()

getCombinationImages(  $id_lang) 

Parameters

$id_lang

getCombinationImageById()

getCombinationImageById(  $id_product_attribute,   $id_lang) 

Parameters

$id_product_attribute
$id_lang

hasAttributes()

hasAttributes() : integer

Check if product has attributes combinations

Returns

integer —

Attributes combinations number

getNewProducts()

getNewProducts(integer  $id_lang,   $page_number,   $nb_products = 10,   $count = false,   $order_by = null,   $order_way = null, \Context  $context = null) : array

Get new products

Parameters

integer $id_lang

Language id

$page_number
$nb_products
$count
$order_by
$order_way
\Context $context

Returns

array —

New products

getRandomSpecial()

getRandomSpecial(integer  $id_lang,   $beginning = false,   $ending = false, \Context  $context = null) : array

Get a random special

Parameters

integer $id_lang

Language id

$beginning
$ending
\Context $context

Returns

array —

Special

getPricesDrop()

getPricesDrop(integer  $id_lang,   $page_number,   $nb_products = 10, boolean  $count = false,   $order_by = null,   $order_way = null,   $beginning = false,   $ending = false, \Context  $context = null) : array

Get prices drop

Parameters

integer $id_lang

Language id

$page_number
$nb_products
boolean $count

Only in order to get total number (optional)

$order_by
$order_way
$beginning
$ending
\Context $context

Returns

array —

Prices drop

getProductCategories()

getProductCategories(  $id_product = '') : array

getProductCategories return an array of categories which this product belongs to

Parameters

$id_product

Returns

array —

of categories

getProductCategoriesFull()

getProductCategoriesFull(  $id_product = '',   $id_lang = null) 

Parameters

$id_product
$id_lang

getCategories()

getCategories() : array

getCategories return an array of categories which this product belongs to

Returns

array —

of categories

getCarriers()

getCarriers() 

Gets carriers assigned to the product

setCarriers()

setCarriers(  $carrier_list) 

Sets carriers assigned to the product

Parameters

$carrier_list

getImages()

getImages(integer  $id_lang, \Context  $context = null) : array

Get product images and legends

Parameters

integer $id_lang

Language id for multilingual legends

\Context $context

Returns

array —

Product images and legends

getCover()

getCover(  $id_product, \Context  $context = null) : array

Get product cover image

Parameters

$id_product
\Context $context

Returns

array —

Product cover image

getPriceStatic()

getPriceStatic(integer  $id_product, boolean  $usetax = true, integer  $id_product_attribute = null, integer  $decimals = 6, integer  $divisor = null, boolean  $only_reduc = false, boolean  $usereduc = true, integer  $quantity = 1,   $force_associated_tax = false, integer  $id_customer = null, integer  $id_cart = null, integer  $id_address = null,   $specific_price_output = null, boolean  $with_ecotax = true,   $use_group_reduction = true, \Context  $context = null,   $use_customer_price = true) : float

Get product price

Parameters

integer $id_product

Product id

boolean $usetax

With taxes or not (optional)

integer $id_product_attribute

Product attribute id (optional). If set to false, do not apply the combination price impact. NULL does apply the default combination price impact.

integer $decimals

Number of decimals (optional)

integer $divisor

Useful when paying many time without fees (optional)

boolean $only_reduc

Returns only the reduction amount

boolean $usereduc

Set if the returned amount will include reduction

integer $quantity

Required for quantity discount application (default value: 1)

$force_associated_tax
integer $id_customer

Customer ID (for customer group reduction)

integer $id_cart

Cart ID. Required when the cookie is not accessible (e.g., inside a payment module, a cron task...)

integer $id_address

Customer address ID. Required for price (tax included) calculation regarding the guest localization

$specific_price_output
boolean $with_ecotax

insert ecotax in price output.

$use_group_reduction
\Context $context
$use_customer_price

Returns

float —

Product price

priceCalculation()

priceCalculation(integer  $id_shop, integer  $id_product, integer  $id_product_attribute, integer  $id_country, integer  $id_state,   $zipcode, integer  $id_currency, integer  $id_group, integer  $quantity, boolean  $use_tax, integer  $decimals, boolean  $only_reduc, boolean  $use_reduc, boolean  $with_ecotax,   $specific_price,   $use_group_reduction,   $id_customer,   $use_customer_price = true,   $id_cart,   $real_quantity) : float

Price calculation / Get product price

Parameters

integer $id_shop

Shop id

integer $id_product

Product id

integer $id_product_attribute

Product attribute id

integer $id_country

Country id

integer $id_state

State id

$zipcode
integer $id_currency

Currency id

integer $id_group

Group id

integer $quantity

Quantity Required for Specific prices : quantity discount application

boolean $use_tax

with (1) or without (0) tax

integer $decimals

Number of decimals returned

boolean $only_reduc

Returns only the reduction amount

boolean $use_reduc

Set if the returned amount will include reduction

boolean $with_ecotax

insert ecotax in price output.

$specific_price
$use_group_reduction
$id_customer
$use_customer_price
$id_cart
$real_quantity

Returns

float —

Product price

convertAndFormatPrice()

convertAndFormatPrice(  $price,   $currency = false, \Context  $context = null) 

Parameters

$price
$currency
\Context $context

isDiscounted()

isDiscounted(  $id_product,   $quantity = 1, \Context  $context = null) 

Parameters

$id_product
$quantity
\Context $context

getPrice()

getPrice(boolean  $tax = true, integer  $id_product_attribute = null, integer  $decimals = 6, integer  $divisor = null,   $only_reduc = false,   $usereduc = true,   $quantity = 1) : float

Get product price Same as static function getPriceStatic, no need to specify product id

Parameters

boolean $tax

With taxes or not (optional)

integer $id_product_attribute

Product attribute id (optional)

integer $decimals

Number of decimals (optional)

integer $divisor

Util when paying many time without fees (optional)

$only_reduc
$usereduc
$quantity

Returns

float —

Product price in euros

getPublicPrice()

getPublicPrice(  $tax = true,   $id_product_attribute = null,   $decimals = 6,   $divisor = null,   $only_reduc = false,   $usereduc = true,   $quantity = 1) 

Parameters

$tax
$id_product_attribute
$decimals
$divisor
$only_reduc
$usereduc
$quantity

getIdProductAttributeMostExpensive()

getIdProductAttributeMostExpensive() 

getDefaultIdProductAttribute()

getDefaultIdProductAttribute() 

getPriceWithoutReduct()

getPriceWithoutReduct(  $notax = false,   $id_product_attribute = false,   $decimals = 6) 

Parameters

$notax
$id_product_attribute
$decimals

convertPrice()

convertPrice(array  $params,   $smarty) : string

Display price with right format and currency

Parameters

array $params

Params

$smarty

Smarty object

Returns

string —

Price with right format and currency

convertPriceWithCurrency()

convertPriceWithCurrency(array  $params, object  $smarty) : \Ambigous

Convert price with currency

Parameters

array $params
object $smarty

DEPRECATED

Returns

\Ambigous —

<string, mixed, Ambigous <number, string>>

displayWtPrice()

displayWtPrice(  $params,   $smarty) 

Parameters

$params
$smarty

displayWtPriceWithCurrency()

displayWtPriceWithCurrency(array  $params,   $smarty) : \Ambigous

Display WT price with currency

Parameters

array $params
$smarty

Returns

\Ambigous —

<string, mixed, Ambigous <number, string>>

getQuantity()

getQuantity(integer  $id_product, integer  $id_product_attribute = null,   $cache_is_pack = null) : integer

Get available product quantities

Parameters

integer $id_product

Product id

integer $id_product_attribute

Product attribute id (optional)

$cache_is_pack

Returns

integer —

Available quantities

sqlStock()

sqlStock(  $product_alias,   $product_attribute = null,   $inner_join = false, \Shop  $shop = null) : string

Create JOIN query with 'stock_available' table

Parameters

$product_alias
$product_attribute
$inner_join
\Shop $shop

Returns

string

updateQuantity()

updateQuantity() : mixed

Returns

mixed —

Query result

reinjectQuantities()

reinjectQuantities() 

isAvailableWhenOutOfStock()

isAvailableWhenOutOfStock(  $out_of_stock) 

Parameters

$out_of_stock

checkQty()

checkQty(integer  $qty) : boolean

Check product availability

Parameters

integer $qty

Quantity desired

Returns

boolean —

True if product is available with this quantity

checkDefaultAttributes()

checkDefaultAttributes() 

Check if there is no default attribute and create it if not

getAttributesColorList()

getAttributesColorList(array  $products,   $have_stock = true) 

Parameters

array $products
$have_stock

getAttributesGroups()

getAttributesGroups(integer  $id_lang) : array

Get all available attribute groups

Parameters

integer $id_lang

Language id

Returns

array —

Attribute groups

deleteAccessories()

deleteAccessories() : mixed

Delete product accessories

Returns

mixed —

Deletion result

deleteFromAccessories()

deleteFromAccessories() : mixed

Delete product from other products accessories

Returns

mixed —

Deletion result

getAccessoriesLight()

getAccessoriesLight(integer  $id_lang, integer  $id_product) : array

Get product accessories (only names)

Parameters

integer $id_lang

Language id

integer $id_product

Product id

Returns

array —

Product accessories

getAccessories()

getAccessories(integer  $id_lang,   $active = true) : array

Get product accessories

Parameters

integer $id_lang

Language id

$active

Returns

array —

Product accessories

getAccessoryById()

getAccessoryById(  $accessory_id) 

Parameters

$accessory_id

changeAccessories()

changeAccessories(array  $accessories_id) 

Link accessories with product

Parameters

array $accessories_id

Accessories ids

addFeaturesCustomToDB()

addFeaturesCustomToDB(  $id_value,   $lang,   $cust) 

Add new feature to product

Parameters

$id_value
$lang
$cust

addFeaturesToDB()

addFeaturesToDB(  $id_feature,   $id_value,   $cust) 

Parameters

$id_feature
$id_value
$cust

addFeatureProductImport()

addFeatureProductImport(  $id_product,   $id_feature,   $id_feature_value) 

Parameters

$id_product
$id_feature
$id_feature_value

getFeatures()

getFeatures() : array

Select all features for the object

Returns

array —

Array with feature product's data

getFeaturesStatic()

getFeaturesStatic(  $id_product) 

Parameters

$id_product

cacheProductsFeatures()

cacheProductsFeatures(  $product_ids) 

Parameters

$product_ids

cacheFrontFeatures()

cacheFrontFeatures(  $product_ids,   $id_lang) 

Parameters

$product_ids
$id_lang

searchByName()

searchByName(integer  $id_lang, string  $query, \Context  $context = null) : array

Admin panel product search

Parameters

integer $id_lang

Language id

string $query

Search query

\Context $context

Returns

array —

Matching products

duplicateAttributes()

duplicateAttributes(integer  $id_product_old, integer  $id_product_new) 

Duplicate attributes when duplicating a product

Parameters

integer $id_product_old

Old product id

integer $id_product_new

New product id

getAttributesImpacts()

getAttributesImpacts(  $id_product) 

Parameters

$id_product

_getAttributeImageAssociations()

_getAttributeImageAssociations(integer  $id_product_attribute) : array

Get product attribute image associations

Parameters

integer $id_product_attribute

Returns

array

duplicateAccessories()

duplicateAccessories(  $id_product_old,   $id_product_new) 

Parameters

$id_product_old
$id_product_new

duplicateTags()

duplicateTags(  $id_product_old,   $id_product_new) 

Parameters

$id_product_old
$id_product_new

duplicateDownload()

duplicateDownload(  $id_product_old,   $id_product_new) 

Parameters

$id_product_old
$id_product_new

duplicateAttachments()

duplicateAttachments(  $id_product_old,   $id_product_new) 

Parameters

$id_product_old
$id_product_new

duplicateFeatures()

duplicateFeatures(integer  $id_product_old,   $id_product_new) 

Duplicate features when duplicating a product

Parameters

integer $id_product_old

New product id

$id_product_new

duplicateSpecificPrices()

duplicateSpecificPrices(  $old_product_id,   $product_id) 

Parameters

$old_product_id
$product_id

duplicateCustomizationFields()

duplicateCustomizationFields(  $old_product_id,   $product_id) 

Parameters

$old_product_id
$product_id

getLink()

getLink(\Context  $context = null) 

Get the link of the product page of this product

Parameters

\Context $context

getTags()

getTags(  $id_lang) 

Parameters

$id_lang

defineProductImage()

defineProductImage(  $row,   $id_lang) 

Parameters

$row
$id_lang

getProductProperties()

getProductProperties(  $id_lang,   $row, \Context  $context = null) 

Parameters

$id_lang
$row
\Context $context

getTaxesInformations()

getTaxesInformations(  $row, \Context  $context = null) 

Parameters

$row
\Context $context

getProductsProperties()

getProductsProperties(  $id_lang,   $query_result) 

Parameters

$id_lang
$query_result

getFrontFeaturesStatic()

getFrontFeaturesStatic(  $id_lang,   $id_product) 

Parameters

$id_lang
$id_product

getFrontFeatures()

getFrontFeatures(  $id_lang) 

Parameters

$id_lang

getAttachmentsStatic()

getAttachmentsStatic(  $id_lang,   $id_product) 

Parameters

$id_lang
$id_product

getAttachments()

getAttachments(  $id_lang) 

Parameters

$id_lang

getAllCustomizedDatas()

getAllCustomizedDatas(  $id_cart,   $id_lang = null,   $only_in_cart = true,   $id_shop = null) 

Parameters

$id_cart
$id_lang
$only_in_cart
$id_shop

addCustomizationPrice()

addCustomizationPrice(  $products,   $customized_datas) 

Parameters

$products
$customized_datas

createLabels()

createLabels(  $uploadable_files,   $text_fields) 

Parameters

$uploadable_files
$text_fields

updateLabels()

updateLabels() 

getCustomizationFields()

getCustomizationFields(  $id_lang = false,   $id_shop = null) 

Parameters

$id_lang
$id_shop

getCustomizationFieldIds()

getCustomizationFieldIds() 

getRequiredCustomizableFields()

getRequiredCustomizableFields() 

getRequiredCustomizableFieldsStatic()

getRequiredCustomizableFieldsStatic(  $id) 

Parameters

$id

hasAllRequiredCustomizableFields()

hasAllRequiredCustomizableFields(\Context  $context = null) 

Parameters

\Context $context

idIsOnCategoryId()

idIsOnCategoryId(integer  $id_product, array  $categories) : boolean

Checks if the product is in at least one of the submited categories

Parameters

integer $id_product
array $categories

array of category arrays

Returns

boolean —

is the product in at least one category

getNoPackPrice()

getNoPackPrice() 

checkAccess()

checkAccess(  $id_customer) 

Parameters

$id_customer

checkAccessStatic()

checkAccessStatic(  $id_product,   $id_customer) 

Parameters

$id_product
$id_customer

addStockMvt()

addStockMvt(integer  $quantity, integer  $id_reason, integer  $id_product_attribute = null, integer  $id_order = null, integer  $id_employee = null) : boolean

Add a stock movement for current product

Since 1.5, this method only permit to add/remove available quantities of the current product in the current shop

Parameters

integer $quantity
integer $id_reason
  • useless
integer $id_product_attribute
integer $id_order
  • DEPRECATED
integer $id_employee
  • DEPRECATED

Returns

boolean

getStockMvts()

getStockMvts(  $id_lang) 

Parameters

$id_lang

getUrlRewriteInformations()

getUrlRewriteInformations(  $id_product) 

Parameters

$id_product

getIdTaxRulesGroup()

getIdTaxRulesGroup() 

getIdTaxRulesGroupByIdProduct()

getIdTaxRulesGroupByIdProduct(  $id_product, \Context  $context = null) 

Parameters

$id_product
\Context $context

getTaxesRate()

getTaxesRate(\Address  $address = null) : \the

Parameters

\Address $address

Returns

\the —

total taxes rate applied to the product

getWsProductFeatures()

getWsProductFeatures() : array

Webservice getter : get product features association

Returns

array

setWsProductFeatures()

setWsProductFeatures(  $product_features) : boolean

Webservice setter : set product features association

Parameters

$product_features

Returns

boolean

getWsDefaultCombination()

getWsDefaultCombination() : integer

Webservice getter : get virtual field default combination

Returns

integer

setWsDefaultCombination()

setWsDefaultCombination(  $id_combination) 

Webservice setter : set virtual field default combination

Parameters

$id_combination

id default combination

getWsCategories()

getWsCategories() : array

Webservice getter : get category ids of current product for association

Returns

array

setWsCategories()

setWsCategories(  $category_ids) 

Webservice setter : set category ids of current product for association

Parameters

$category_ids

category ids

getWsAccessories()

getWsAccessories() : array

Webservice getter : get product accessories ids of current product for association

Returns

array

setWsAccessories()

setWsAccessories(  $accessories) 

Webservice setter : set product accessories ids of current product for association

Parameters

$accessories

product ids

getWsCombinations()

getWsCombinations() : array

Webservice getter : get combination ids of current product for association

Returns

array

setWsCombinations()

setWsCombinations(  $combinations) 

Webservice setter : set combination ids of current product for association

Parameters

$combinations

combination ids

getWsProductOptionValues()

getWsProductOptionValues() : array

Webservice getter : get product option ids of current product for association

Returns

array

getWsPositionInCategory()

getWsPositionInCategory() : integer

Webservice getter : get virtual field position in category

Returns

integer

setWsPositionInCategory()

setWsPositionInCategory(  $position) : boolean

Webservice setter : set virtual field position in category

Parameters

$position

Returns

boolean

getCoverWs()

getCoverWs() : integer

Webservice getter : get virtual field id_default_image in category

Returns

integer

setCoverWs()

setCoverWs(  $id_image) : boolean

Webservice setter : set virtual field id_default_image in category

Parameters

$id_image

Returns

boolean

getWsImages()

getWsImages() : array

Webservice getter : get image ids of current product for association

Returns

array

getWsStockAvailables()

getWsStockAvailables() 

getWsTags()

getWsTags() 

setWsTags()

setWsTags(  $tag_ids) 

Webservice setter : set tag ids of current product for association

Parameters

$tag_ids

tag ids

deleteWsTags()

deleteWsTags() : array

Delete products tags entries without delete tags for webservice usage

Returns

array —

Deletion result

getWsManufacturerName()

getWsManufacturerName() 

resetEcoTax()

resetEcoTax() 

setGroupReduction()

setGroupReduction() 

Set Group reduction if needed

existsRefInDatabase()

existsRefInDatabase(  $reference) : boolean

Checks if reference exists

Parameters

$reference

Returns

boolean

getProductAttributesIds()

getProductAttributesIds(integer  $id_product,   $shop_only = false) : array

Get all product attributes ids

Parameters

integer $id_product

the id of the product

$shop_only

Returns

array —

product attribute id list

getAttributesParams()

getAttributesParams(integer  $id_product,   $id_product_attribute) : array

Get label by lang and value by lang too

Parameters

integer $id_product
$id_product_attribute

Returns

array

getAttributesInformationsByProduct()

getAttributesInformationsByProduct(integer  $id_product) 

Parameters

integer $id_product

getAnchor()

getAnchor(integer  $id_product_attribute) : string

Get the combination url anchor of the product

Parameters

integer $id_product_attribute

Returns

string

getProductName()

getProductName(integer  $id_product, integer  $id_product_attribute = null, integer  $id_lang = null) : string

Gets the name of a given product, in the given lang

Parameters

integer $id_product
integer $id_product_attribute

Optional

integer $id_lang

Optional

Returns

string

addWs()

addWs(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

updateWs()

updateWs(  $null_values = false) 

Parameters

$null_values

getRealQuantity()

getRealQuantity(integer  $id_product, integer  $id_product_attribute, integer  $id_warehouse, integer  $id_shop = null) : integer

For a given product, returns its real quantity

Parameters

integer $id_product
integer $id_product_attribute
integer $id_warehouse
integer $id_shop

Returns

integer —

real_quantity

usesAdvancedStockManagement()

usesAdvancedStockManagement(integer  $id_product) : boolean

For a given product, tells if it uses the advanced stock management

Parameters

integer $id_product

Returns

boolean

flushPriceCache()

flushPriceCache() 

This method allows to flush price cache

getParentCategories()

getParentCategories(integer  $id_lang = null) : array

Get list of parent categories

Parameters

integer $id_lang

Returns

array

loadStockData()

loadStockData() 

Fill the variables used for stock management

useAdvancedStockManagement()

useAdvancedStockManagement() 

setAdvancedStockManagement()

setAdvancedStockManagement(  $value) 

Parameters

$value

getDefaultCategory()

getDefaultCategory() 

get the default category according to the shop

getShopsByProduct()

getShopsByProduct(  $id_product) 

Parameters

$id_product

deleteDownload()

deleteDownload() : boolean

Remove all downloadable files for product and its attributes

Returns

boolean

getAttributeCombinaisons()

getAttributeCombinaisons(integer  $id_lang) 

Parameters

integer $id_lang

deleteAttributeCombinaison()

deleteAttributeCombinaison(integer  $id_product_attribute) 

Parameters

integer $id_product_attribute

getType()

getType() : integer

Get the product type (simple, virtual, pack)

Returns

integer

hasAttributesInOtherShops()

hasAttributesInOtherShops() 

getIdTaxRulesGroupMostUsed()

getIdTaxRulesGroupMostUsed() 

getIdByEan13()

getIdByEan13(string  $ean13) : integer

For a given ean13 reference, returns the corresponding id

Parameters

string $ean13

Returns

integer —

id

getWsType()

getWsType() 

modifierWsLinkRewrite()

modifierWsLinkRewrite() 

getWsProductBundle()

getWsProductBundle() 

setWsType()

setWsType(  $type_str) 

Parameters

$type_str

setWsProductBundle()

setWsProductBundle(  $items) 

Parameters

$items

isColorUnavailable()

isColorUnavailable(  $id_attribute,   $id_shop) 

Parameters

$id_attribute
$id_shop

getColorsListCacheId()

getColorsListCacheId(  $id_product) 

Parameters

$id_product

setPackStockType()

setPackStockType(  $id_product,   $pack_stock_type) 

Parameters

$id_product
$pack_stock_type

_getProductIdByDate()

_getProductIdByDate(  $beginning,   $ending, \Context  $context = null,   $with_combination = false) 

Parameters

$beginning
$ending
\Context $context
$with_combination

_getCustomizationFieldsNLabels()

_getCustomizationFieldsNLabels(  $product_id,   $id_shop = null) 

Parameters

$product_id
$id_shop

_checkLabelField()

_checkLabelField(  $field,   $value) 

Parameters

$field
$value

_deleteOldLabels()

_deleteOldLabels() 

_createLabel()

_createLabel(  $languages,   $type) 

Parameters

$languages
$type