1

I have an product that is assigned to more than 1 category.

I am interested how can i select all the categories that the product is assigned to based on productID.

something like get Article Categories (id Article)

Herr Nentu'
  • 1,438
  • 3
  • 18
  • 49

1 Answers1

6

It's possible to get category ID's by using oxArticle::getCategoryIds(), but you have to have article object loaded like:

$oArticle = oxNew('oxarticle');
$oArticle->load('id');
$aCategories = $oArticle->getCategoryIds();

If you need objects just foreach to load them.

sanis
  • 1,329
  • 1
  • 10
  • 11