Hi Scott -
If I understand what you are trying to do correctly, maybe this will help.
In product.tpl, the variable $cat contains the categoryid of the current product, so you could do if-than statements based on the $cat variable.
If you do need the category order_by, you will need to add a query to the product.php file to get it. I think this should work if you add it after you see $cat defined:
Code:
$cat_order_by = func_query_first_cell("select order_by from $sql_tbl[categories] where categoryid = '$cat'");
$smarty->assign("cat_order_by",$cat_order_by);
Then, you can do if-than statements based on $cat_order_by
You can try printing the variables in product.tpl to make sure they are as expected:
PHP Code:
category: {$cat}<br />
parent: {$current_category.parentid}<br />
order_by: {$cat_order_by}
I've not done this before - so hopefully you won't find any unintended consequences.
Also - using
this tip helps show you what smarty variables are available so that you do not have to guess.