Jump to content

Get category link in ProductControler


Rissinko

Recommended Posts

You want to get a link to the default category of the product? Try the following in the init() function of ProductController anytime after $this->product is initialised:

$link = $this->context->link->getCategoryLink((int)$this->product->id_category_default);
  • Like 2
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...