Smarty code for Category URL


I have a client who wants to have a “Return to Category” link on all of his product details pages.

I was able to find the code to return the Category Name ( [color=#ff0000] {$product.main_category|fn_get_category_name}[/color]) but not the code to return the Category’s URL.

Can anyone help with this?

Take a look at your bread crumb code in /design/themes/your_theme/templates/common/breadcrumbs.tpl

Thanks for the response!

I checked in the Breadcrumbs template and that template is using [color=#ff0000]{$|fn_url}.[/color] I was able to put together this: [color=#ff0000]$product.main_category|fn_url [/color]but it returns which when clicked throws a 404 error.

We have the SEO add-on enabled. I disabled the add on and the category url isn't even close to that. Do you have a clue what I'm dong wrong?

Try using {"categories.view&category_id=`$product.main_category`"|fn_url}

Worked like a charm, tbirnseth! Thanks!