开发者

How can I get current category id of Virtue Mart

开发者 https://www.devze.com 2023-02-13 04:09 出处:网络
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 ca

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.. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消