hello,
i would like add 3 images custom fields:
image_2,image_3,image_4
on product mapping page ( to add an image slider on product page, so i followed step here :
/node/4145#comment-16686
All steps are ok, except the last step for product.php modification, for me it's not for metatag so i don't know how make modification in this file...
At this time all my images are registred into my database but i can't display it on product page if i use this code:
<?php
if (isset($meta_rows[0]["custom_field_name"]) && ($meta_rows[0]["custom_field_name"]!=""))
{
print $meta_rows[0]["custom_field_name"];
}
?>
Thanks for help
Cocota
Hi Cocota,
Instead of making any changes in the main products.php file, edit html/product.php and first of all add the following code at the very top of the script:
<?php
$sql = "SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE name='".database_safe($product["products"][0]["name"])."' LIMIT 1";
if (database_querySelect($sql,$rows))
{
$custom = $rows[0];
}
?>
That will populate an array $custom containing the full `pt_productsmap` record for the product being viewed (if exists).
Then, within the main body of the file where the HTML is being generated, you could display image_2 as follows:
<?php
if (isset($custom["image_2"]) && $custom["image_2"])
{
print "<img src='".$custom["image_2"]."' />";
}
?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com