Add products to Buddypress search


I want to add a product search to the Buddypress search. I have been able to add the products to the search options. But now I need to be able to search the products. I used this code:

$selection_box .= ‘<option value=”products”>’ . __( ‘Products’, ‘buddypress’ ) . ‘</option>’; to bp_search_form_type_select() in bp-core-templatetags.php and this:

case ‘products’:

$slug = marketplace;

$var = ‘/?s=’;


to bp_core_action_search_site() in bp-core.php.

I have tried searching tags, and categories, but that’s not working. How would I go about getting something like marketplace/?s= and actually getting results, at the moment it is returning all products.

Also, I really want to add products to the activity stream. I have found code for adding to the activity stream, and I see that the Recent Global Posts widget displays the products, could you point me to where I can find where it gets that from, or is that the post indexer?

Thank you!!