Hi,
I joined the extra_fields table to the query that created the products array in func.cart.php. The query is in the func_products_from_scratch function, and the query is around line 1710 in version 4.2.2.
Quote:
$products_array = func_query_first("SELECT $sql_tbl[products].*, MIN($sql_tbl[pricing].price) as price, $sql_tbl[images_T].image_path, $sql_tbl[images_T].image_x, $sql_tbl[images_T].image_y, IF($sql_tbl[images_P].id IS NULL, '', 'P') as is_pimage, $sql_tbl[images_P].image_path as pimage_path, $sql_tbl[images_P].image_x as pimage_x, $sql_tbl[images_P].image_y as pimage_y, $sql_tbl[extra_fields].service_name as extra_field_name, $sql_tbl[extra_field_values].value as extra_field_value FROM $sql_tbl[pricing],$sql_tbl[products] LEFT JOIN $sql_tbl[images_T] ON $sql_tbl[images_T].id = $sql_tbl[products].productid LEFT JOIN $sql_tbl[extra_field_values] ON $sql_tbl[extra_field_values].productid = $sql_tbl[products].productid LEFT JOIN $sql_tbl[extra_fields] ON $sql_tbl[extra_fields].fieldid = $sql_tbl[extra_field_values].fieldid LEFT JOIN $sql_tbl[images_P] ON $sql_tbl[images_P].id = $sql_tbl[products].productid WHERE $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products].forsale != 'N' AND $sql_tbl[products].productid='$productid' AND $avail_condition ".(empty($active_modules['Wholesale_Trading']) ? "$sql_tbl[pricing].quantity = 1" : "$sql_tbl[pricing].quantity<='$amount'")." AND $sql_tbl[pricing].membershipid IN('$membershipid', '0') AND $sql_tbl[pricing].variantid = '$variantid' AND $sql_tbl[extra_fields].service_name = 'EXTRA_FIELD_SERVICE_NAME' GROUP BY $sql_tbl[products].productid ORDER BY $sql_tbl[pricing].quantity DESC");
|
I've indicated the parts you'll have to modify to suite your requirements.
This allowed me to access the value of the extra field in cart.tpl using '$product.
extra_field_value'.
I've not tried it in 4.2.3, so can't vouch for it there I'm afraid, but hope it helps.
Ian