Search by page type

Permalink
Hello, i have a site which runs c5 + ecommerce.

I need to rebuild search block in way that it will have 2 radio buttons, which will select, if search by "product_detail" page type or "blog_entry" page type.

http://www.concrete5.org/documentation/how-tos/developers/modify-si...

On this how-to there is a solution to override the search block to search only within "product_detail" page type. This thing works separately, both for product_detail and blog_entry page type (just changing the last line of code)

I'm not so familiar with PHP to write the whole code by my own, so here is the question:

how to send selected checkbox to controller.php ? it must by something with post/get in php ;p

how should "if" condition look like, becuse one time it has to do code below:
$ipl->setSimpleIndexMode(true);
      if (isset($_REQUEST['query'])) {
         //$ipl->filterByKeywords($_q);
         $ipl->filterByName($_q);
      }
         $ipl->filterByCollectionTypeHandle('product_detail');


or (when "news" selected)

$ipl->setSimpleIndexMode(true);
      if (isset($_REQUEST['query'])) {
         //$ipl->filterByKeywords($_q);
         $ipl->filterByName($_q);
      }
         $ipl->filterByCollectionTypeHandle('blog_entry');


I think it would be easy for PHP developers, my php level allow me just to understand the code and basic modifications :)

any help would be appreciated !

grosik