The most common. For me. Mostly from comments in source code.
bool Attribute->cleanPositions(int $id_attribute_group)
Reorder attribute position in group $id_attribute_group. Call it after deleting an attribute from a group.int Attribute::getHigherPosition(int $id_attribute_group)
Get the higher attribute position from a group attributebool AttributeGroup::cleanPositions()
Reorder group attribute position. Call it after deleting a group attribute.
bool string Configuration::deleteByName(string $key)
Delete a configuration key in databasestring Configuration::get(string $key)
Get a single configuration valuevoid Configuration::set(string $key, string $values)
Set TEMPORARY a single configuration valuebool Configuration::updateValue(string $key, string $values)
Update configuration key and value into database (automatically insert if key does not exist)
int Combination::getIdByReference(int $id_product, string $reference)
For a given product_attribute reference, returns the corresponding idbool Combination::isFeatureActive()
Check if combination is feature active in Prestashop
Retrieve logged user : $this->context->cookie->id_customer
, $this->context->cookie->email
bool Db::getInstance()->delete(string $table [, string $where ])
Delete in $table (without prefix) with $where conditionbool Db::getInstance()->execute(string $query)
Execute the $query (INSERT, UPDATE, DELETE)array Db::getInstance()->executeS(string $query)
Execute the $query (SELECT) and return the result as arrayarray Db::getInstance()->getRow(string $query)
Returns an associative array containing the first row of the $querystring Db::getInstance()->getValue(string $query)
Returns a value from the first row, first column of a SELECT $querybool Db::getInstance()->insert(string $table, array $data)
Insert $data in $table (without prefix)int Db::getInstance()->Insert_ID()
Get the ID generated from the previous INSERT operationint Db::getInstance()->numRows()
Get number of rows for last resultbool Db::getInstance()->update(string $table, array $data [, string $where ])
Update $data in $table (without prefix) with $where condition
int Image::getHighestPosition(int $id_product)
Return highest position of images for a productarray Image::getImages(int $id_lang, int $id_product [, int $id_product_attribute = null ])
Return available images for a productint Image::getImagesTotal(int $id_product)
Return number of images for a productbool Image::hasImages(int $id_lang, int $id_product [, int $id_product_attribute = null ])
Check if a product has an image available
array Language::getLanguages([ bool $active = true ])
Returns available languages
Retrieve global from PHP : $this->context->link
and from Smarty : {$link}
.
string Link->getAdminLink(string $controller [, bool $with_token = true ])
Use controller name to create a linkstring Link->getCategoryLink(Category $category [, string $alias = null [, int $id_lang = null [, string $selected_filters = null [, ... ]]]])
Create a link to a categorystring Link->getCMSCategoryLink(CMSCategory $cms_category, [ string $alias = null [, ... ]])
Create a link to a CMS categorystring Link->getCMSLink(CMS $cms, [ string $alias = null [, ... ]])
Create a link to a CMS pagestring Link->getImageLink(string $name, string $ids [, string $type = null ])
Returns a link to a product image for displaystring Link->getManufacturerLink(Manufacturer $manufacturer [, string $alias = null [, ... ]])
Create a link to a manufacturerstring Link->getModuleLink(string $module [, string $controller = 'default' [, array $params = array() [, ... ]]])
Create a link to a modulestring Link->getPageLink(string $controller [, ... ])
Create a simple linkstring Link->getProductLink(Product $product [, string $alias = null [, ... ]])
Create a link to a productstring Link->getSupplierLink(Supplier $supplier [, string $alias = null [, ... ]])
Create a link to a supplier
Module Module::getInstanceByName(string $module_name)
Return an instance of the specified modulebool Module->registerHook(string $hook_name)
Connect module to a hookbool Module->unregisterHook(string|int $hook_id)
Unregister module from hook (by name or id)
All Prestashop classes inherits of ObjectModel class so then can call these methods (Product, Combination, Shop... all classes in /classes)
bool ObjectModel->add()
Adds current object to the databasebool ObjectModel->associateTo(int|array $id_shops)
This function associate an item to its contextbool ObjectModel->delete()
Deletes current object from databaseObjectModel ObjectModel->duplicateObject()
Takes current object ID, gets its values from database, saves them in a new row and loads newly saved values as a new objectbool ObjectModel->save()
Saves current object to database (add or update)bool ObjectModel->update()
Updates the current object in the databasebool ObjectModel->validateFields([ bool $die = true [, bool $error_return = false ]])
Checks if object field values are valid before database interactionbool ObjectModel->validateFieldsLang([ bool $die = true [, bool $error_return = false ]])
Checks if multilingual object field values are valid before database interaction
OrderHistory->changeIdOrderState(int $new_order_state, int|object $id_order [, bool $use_existing_payment = false ])
Sets the new state of the given order
Product::__construct([ int $id_product = null [, bool $full = false [, int $id_lang = null [, int $id_shop = null ]]]])
bool Product->addCombinationEntity(float $wholesale_price, float $price, float $weight, float $unit_impact, float $ecotax, float $quantity, array $id_images, string $reference, int $id_supplier, string $ean13, int $default [, string $location = null [, string $upc = null [, int $minimal_quantity = 1 [, array $id_shop_list = array() [, string $available_date = null ]]]]])
Add a product attributebool Product->checkDefaultAttributes()
Check if there is no default attribute and create it if notbool Product->deleteDefaultAttributes()
Delete all default attributes for productbool Product->deleteImages()
Delete product images from databasearray Product->getAttributeCombinations(int $id_lang)
Get all available product attributes combinationsint Product::getDefaultAttribute(int $id_product)
Get the default attribute for a product (id_product_attribute)float Product::getPriceStatic(int $id_product [, bool $usetax = true [, int $id_product_attribute = null [, int $decimals = 6 [, int $divisor = null [, bool $only_reduc = false [, bool $usereduc = true [, int $quantity = 1 [, bool $force_associated_tax = false [, int $id_customer = null [, int $id_cart = null [, int $id_address = null ]]]]]]]]]]])
Returns product pricearray Product->updateAttribute(int $id_product_attribute, float $wholesale_price, float $price, float $weight, float $unit, float $ecotax, array $id_images, string $reference, string $ean13, int $default [, string $location = null [, string $upc = null [, int $minimal_quantity = 1 [, string $available_date = null [, bool $update_all_fields [, array $id_shop_list = array() ]]]]]])
Update a product attributeint Product::updateDefaultAttribute(int id_product)
array Shop::getContextListShopID()
Get a list of ID concerned by the shop context (E.g. if context is shop group, get list of children shop ID)int ShopGroup::getIdByName(string $name)
Return a group shop ID from group shop name
void StockAvailable::setQuantity(int $id_product, int $id_product_attribute, int $quantity [, int $id_shop = null ])
For a given id_product and id_product_attribute sets the quantity available
bool Tools::getIsset(string $key)
string Tools::getRemoteAddr()
Get the server variable REMOTE_ADDR, or the first ip of HTTP_X_FORWARDED_FOR (when using proxy)string Tools::getServerName()
Get the server variable SERVER_NAMEmixed Tools::getAllValues()
Get all values from POST / GETmixed Tools::getValue(string $key [, mixed $default_value = false ])
Get a value from POST / GET. If unavailable, take a default valuebool Tools::isSubmit(string $submit)
Check if submit has been postedstring Tools::str2url(string $str)
Return a friendly url made from the provided string