Help with custom field display

I added a field call ‘unit’ in the to hold values such as Pack, Dozen, etc. It was added to the ‘cscart_products’ table

I added it to products_detail.tpl like

{if $product.unit}



An while this works products_detail.tpl, it does not work on products_multicolumns.tpl. I don’t get the field value.

Can anyone tell me how I get this value on this page? Or at least point me to the page that holds the SQL for products_multicolumns.tpl.


you added it to the query in products.php right? did you add it in categories.php also? since the multicolumn template is actually part of the category display.

No, not sure how to do it. Can you assist?

product detail must have had a wildcard query as the new field just appeared in the results without changing any of the PHP.

Is there anyone that can help with this?

[quote name=‘YouRockDaddy’]Is there anyone that can help with this?[/QUOTE]

That is very easy…

No one wanna tell you…

If you still want to know, just PM me…

[quote name=‘joe’]That is very easy…

No one wanna tell you…

If you still want to know, just PM me…[/QUOTE]

If it is so easy, then answer his question here. This will help not only the OP but others looking to do the same in the future.


I need help with this too. Please help. It seems so easy but I can not for the life of me get it.

[quote name=‘joe’]

That is very easy…


Since this is far too easy for Joe to post a solution to i though i’d do it instead.

In /core/fn_catalog.php add the following at round line 1617:

// Get custom field
$product['unit'] = db_get_field("SELECT unit FROM $db_tables[products] WHERE product_id='$product[product_id]'");

If uses the function “fn_gather_additional_product_data”

Thanks baballuci,

I appreciate you helping out.

Your solution worked perfectly.