需要你的帮助!如何使用产品 ID 获取图像的路径?
Link::getImageLink()——$name的第一个参数,不知?
$searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true);
foreach ($searchResults as &$product)
{
$product['product_link'] = $this->context->link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']);
$imageid = Product::getCover($product['id_product']);
// there i have image ID, how get image path $imagepath?
$product['image'] = $imagepath;
}
die(Tools::jsonEncode($searchResults));