Jump to content

Product categories in the Product Details


FL45H

Recommended Posts

{foreach from=Product::getProductCategories($product.id) item=cat}
	{if $cat > 2}
		{assign var='current_cat' value=Category::getCategoryInformations(array($cat))}
		<li><b><a href="{$link->getCategoryLink({$cat})}" title="{$current_cat[{$cat}]['name']}">{$current_cat[{$cat}]['name']}</a></b></li>
	{/if}
{/foreach}

Product categories in the Product Details

Ive been using the above code on v1.7.x however I am upgrading to v9 now, unfortunately getCategoryInformations() has been removed now. https://devdocs.prestashop-project.org/9/modules/core-updates/8.0/#removed-methods

Whats the replacement function/code?

Edited by FL45H (see edit history)
Link to comment
Share on other sites

On 11/18/2025 at 2:35 AM, FL45H said:
{foreach from=Product::getProductCategories($product.id) item=cat}
	{if $cat > 2}
		{assign var='current_cat' value=Category::getCategoryInformations(array($cat))}
		<li><b><a href="{$link->getCategoryLink({$cat})}" title="{$current_cat[{$cat}]['name']}">{$current_cat[{$cat}]['name']}</a></b></li>
	{/if}
{/foreach}

Product categories in the Product Details

Ive been using the above code on v1.7.x however I am upgrading to v9 now, unfortunately getCategoryInformations() has been removed now. https://devdocs.prestashop-project.org/9/modules/core-updates/8.0/#removed-methods

Whats the replacement function/code?

if you are upgrading to ps9 here is something you will need to know.

https://prestaheroes.com/blogs/prestashop-alerts/prestashop-9-urls-category-product-links-now-404-what-to-do

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...