I know that there is already one accepted answer, but I need more information on how to get the price of the product.
The Prestashop built-in product class has a getPrice method.
/** * Get product price * Same as static function getPriceStatic, no need to specify product id * * @param bool $tax With taxes or not (optional) * @param int $id_product_attribute Product attribute id (optional) * @param int $decimals Number of decimals (optional) * @param int $divisor Util when paying many time without fees (optional) * @return float Product price in euros */ public function getPrice($tax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1) { return Product::getPriceStatic((int)$this->id, $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity); }
As you can see, you can indicate whether you want it with taxes, the number of decimal places given as a result, and the numeric divider.
So, if you want to get the price of a product by ID with and without taxes, you can achieve this like this
$product = new Product($id_product, $id_language) // Fill with your info $price_with_taxes = $product->getPrice(true); $price_wout_taxes = $product->getPrice(false);
Like other comments, if you are inside a template, you can get the product identifier depending on the type that you are changing.
In product.tpl (single product view) there is a $ product variable. In product-list.tpl, you have the $ products variable, an array containing all the products displayed in the list.
Hope this helps.