Hi i'm having a product collection, i'm getting those categories by $item->getCategoryIds();
On print_r($categoryIds = $item->getCategoryIds());
i'm getting
Array
(
[0] => 12
[1] => 26
)
Array
(
[0] => 22
[1] => 26
)
Array
(
[0] => 12
[1] => 26
)
Array
(
[0] => 12
[1] => 26
)
In these category id 12 is parent for categories 26,22
So is there any way to exclude parent category i.e 12 from array ? Smething like this i'm looking for
Array
(
[0] => 26
)
Array
(
[0] => 22
[1] => 26
)
Array
(
[0] => 26
)
Array
(
[0] => 26
)