id_lang; $isolang = Language::getIsoById($lang); $errors = array(); if ($cookie->isLogged() && Tools::getValue('id_order')) { $order = new Order((int)Tools::getValue('id_order')); $link = new Link(); if (Validate::isLoadedObject($order)) { $products = $order->getProducts(); $productList = ''; foreach ($products as $key => $product) { $p = new Product((int)$product['product_id'], false, $lang); if (isset($product['product_attribute_id']) AND (int)($product['product_attribute_id'])) { $image = Db::getInstance()->getRow(' SELECT id_image FROM '._DB_PREFIX_.'product_attribute_image WHERE id_product_attribute = '.(int)($product['product_attribute_id'])); } if ((isset($product['product_id']) AND (int)($product['product_id'])) || !$image) { $image = Db::getInstance()->getRow(' SELECT id_image FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)($product['product_id']).' AND cover = 1'); } $product_img_path = $link->getImageLink($p->link_rewrite, (int)$image['id_image'], 'small'); $productList .= '

'; $productList .= ''; $productList .= ''; $productList .= '

'; // Add quantity selector if ($product['product_quantity'] > 0) { $productList.= ''; } } if(!empty($productList)) { header('Content-Type: text/json'); die(json_encode(array("error"=> 'false',"result" => $productList))); } else { header('Content-Type: text/json'); die(json_encode(array("error"=> 'true'))); } } }