Post by Gui Siani » Tue Oct 11, 2011 11:14 pm

How can i get the category_id from product in catalog/product/product.php?

I tried many ways like this:

Code: Select all

$this->model_catalog_category->getProductsByCategoryId($this->request->get['product_id']);
No success... :'(

New member

Posts

Joined
Tue Jul 12, 2011 1:48 am

Post by Gui Siani » Wed Oct 12, 2011 1:30 am

You can use the product model to get all categories of a product
CODE: SELECT ALL

Code: Select all

$this->load->model('catalog/product');
$categories = $this->model_catalog_product->getCategories(YOURPRODUCTID);
BUT:
What are you going to do with products that are in more than one category?
Awnser from ckonig
Thanks and sorry for duplicate post!

New member

Posts

Joined
Tue Jul 12, 2011 1:48 am
Who is online

Users browsing this forum: Bing [Bot] and 106 guests