Add an Image to the Cart
In CWIncShowCartSetup.php, add the product id to the query:
$query_rsCWGetCart = "SELECT P.product_Sort
to this:
$query_rsCWGetCart = "SELECT P.product_ID, P.product_Sort
then in the CWIncShowCart.php, whereever you want to display the image, some code like this:
<?php
/* Variables for manipulating product images */
$imageRoot = $cartweaver->settings->imageThumbFolder;
$imagePath = "";
$imageSRC = "";
$tempProdId = $row_rsCWGetCart["product_ID"];
$rsCWThumbnail_query = "SELECT prdctImage_FileName
FROM tbl_prdtimages
WHERE prdctImage_ProductID = $tempProdId
AND prdctImage_ImgTypeID = 1";
$rsCWThumbnail = $cartweaver->db->executeQuery($rsCWThumbnail_query);
$row_rsCWThumbnail = $cartweaver->db->db_fetch_assoc($rsCWThumbnail);
$imageSRC = $imageRoot . $row_rsCWThumbnail["prdctImage_FileName"];
$imagePath = expandPath($imageSRC);
if (file_exists($imagePath) && is_file($imagePath)) {
echo("<img src=\"$imageSRC\" border=\"0\">");
}else{
echo("No Image Available");
} ?>