In magento how to get the category id of each product from its product ID.
$items = $request->getAllItems();
$c = count($items);
for ($i = 0; $i < $c; $i++) {
if ($items[$i]->getProduct() instanceof Mage_Catalog_Model_Product) {
if ($items[$i]->getProduct()->getId()) {
$this->_dhlAllowed = false;
}
}
}
Here $items[$i]->getProduct()->getId()
returns product ID. I want its category ID.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…