How can I get current category id of Virtue Mart
I want to cha开发者_如何学Pythonnge the default Featured Products module of Virtue Mart. I would like to this module show just the current category's featured product. So I need to get the current category id.
How can I get it?
Thanks!
JRequest::getInt(category_id);
$input = JFactory::getApplication()->input;
// should be article, categories, featured, blog...
$view = $input->get('view');
// if it's a category view, this will be the category id, else the article id
$id = $input->getInt('id');
// in an article view, this will be the cat id.
$catid = $input->getInt('catid');
// this is the menu item id i.e. what you call page id I guess.
$Itemid = $input->getInt('Itemid');
I hope this will help you.. :)
精彩评论