Sample show formated price with tax:
<?php @ini_set('display_errors', 'on'); @error_reporting(E_ALL | E_STRICT); include('./config/config.inc.php'); include('./init.php'); $product_prices = array(); $getProductPrice = Db::getInstance()->executeS('SELECT id_product, price FROM '._DB_PREFIX_.'product'); foreach ($getProductPrice as $p){ $getMaxProductPrice = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.$p['id_product'].' ORDER BY price DESC'); if ($getMaxProductPrice['price'] > 0){ $max = Product::getPriceStatic($p['id_product'], true, $getMaxProductPrice['id_product_attribute']); } else { $max = Product::getPriceStatic($p['id_product'], true); } $product_prices[] = array('id_product' => $p['id_product'], 'min_price' => Tools::displayPrice($p['price']), 'max_price' => Tools::displayPrice($max)); } foreach ($product_prices as $product){ echo 'ID product: '.$product['id_product'].' - from '.$product['min_price'].' to '.$product['max_price'].'<br>'; } //print_r($product_prices);
Result: