Here is the code that I used to get to the extra fields in products.tpl. This code must go inside the product loop. I put it immediately after this code:
Add this code:
Code:
{* Get the product ID as we loop through the products to be displayed *}
{assign var="productId" value=$products[product].productid}
{php}
global $sql_tbl;
// Get the product id from the smarty var
$productid=$this->get_template_vars('productId');
// Get the rows from the extra_field_values table for this product id
if($productid) {
$extra_fields = func_query(
"SELECT productid, fieldid, value as field_value
FROM $sql_tbl[extra_field_values]
WHERE productid = $productid"
);
}
$this->assign("extra_fields",$extra_fields);
{/php}
The extra fields are referenced in your code using $extra_fields[<field number>] like this:
Code:
{$extra_fields[2].field_value}
Have fun.