Hi Alan;
On Tue, 20 Jun 2000, Alan McCoy scribed:
> I'm looking over the FT code and I've seen in the admin screen when adding
> attributes and variations, there is a field for defining a graphic for a
> attribute or variation. I thought this would be a great way to have a color
> swatch display for each variation. However, I can't find anything in the
> code that would let me do anything with this graphic. Has anyone done this?
> If so, a code snippet to test this out would be greatly appreciated. :-)
I asked this same question about a month and a half ago...Leon's
answer...code it in :-))
* ugly hack about to follow :-)) *
In the "item" file from the "screens" directory I added a query
just below the " //get list of attributes as comma-separated list"
query.
I stuck in this hack to grab the image and display it.
//get full variation info
//hack add query for variation image
$Query2 = "SELECT a.ID, a.Name, v.ID, v.Name, v.Graphic ";
$Query2 .= "FROM sku_variation sv, variation v, attribute a ";
$Query2 .= "WHERE sv.SKU = " . $Item["SKU"]["ID"][$index] . " ";
$Query2 .= "AND sv.Variation = v.ID ";
$Query2 .= "AND v.Attribute = a.ID ";
$Query2 .= "AND a.ID in ($MultiAttributes) ";
$Query2 .= "ORDER BY a.DisplayPrecedence, a.Name ";
$DataResult = mysql_query($Query2, $DatabaseLink);
while($DataRow = mysql_fetch_row($DataResult))
{
//hack add query for variation image
$tVariationGraphic = $DataRow[4];
if($tVariationGraphic != "") {
echo "<img src=\"images/items/$tVariationGraphic\"
align=\"middle\" hspace=\"0\" vspace=\"0\">\n";
}
else
{
echo "\n";
}
}
- hope this helps -
--
best regards
-michael
Michael Chopek <[EMAIL PROTECTED]>
Down to Earth Development Ltd - http://www.d2earth.com/
Website & Web Applications Development
Selena Sol's WebWare Mail List - http://www.d2earth.com/mail_list.html
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]