Unfortaunately it's a bit too hard to describe the pieces versus just doing the work!
There's probably a way to include a selector or radio group of 'groups' in the standard 'products' block but I'm unsure how to add that selector without my having to dig through more code. Ecom may comment on that.
The 'product showcase' (products.tpl) block is a wrapper around the list_templates/products_list.tpl template.
To me, the easiest way for you to accomplish this (it is NOT the best way but it is the easiest) is to copy and modify the current products block to filter items by group. This will filter by the specified array of group_ids and if there are no matches it will return the original list.
You should copy the design/themes/[your theme]/templates/blocks/products/products.tpl file to a new name and create a language variable by the same name. I.e. products_by_gid' with a value of "Products filtered by group id". Name the template design/themes/[your_theme]/blocks/products/products_by_gid.tpl
Replace the line that says
{** block-description:products **}
with
{** block-description:products_by_gid **}
and the line that looks like:
products=$items
with
products=$items|filter_items_by_gid:[5,7]
Note that [5,7] is an array of group_ids you want to filter on. If you want to select the group_ids, then it gets more complicated and you'll have to create a schema to define how to get the group_ids.
You would then create the following function in app/my_changes/func.php
function filter_items_by_gid(&$items, $gid_array) {
$filtered_items = array();
foreach($items as $product_id => $item) {
foreach($gid_array as $gid) {
if( in_array($gid, $item['usergroup_ids']) ) {
$filtered_items[$product_id] = $item;
break;
}
}
// if you want to use the original $items if the filter didn't catch anything, then
// return $filtered_items ? $filtered_items : $items;
// otherwise
return $filtered_items; // to return a possibly empty list
}
This should set the list of products to be displayed in the product_list.tpl template as only those products that are in the specified usergroups.
You will then need to find the definition of the 'products' block in app/schemas/block_manager/blocks.php. It will be a line that looks like:
'products' => array(
Copy that entire structure (up to the line that defines 'categories') to your clipboard and create a file
app/addons/my_changes/schemas/block_manager/blocks.post.php and paste what you copied above.
Modify the first line from
'products' => array(
to
and then at the end, remove the last ',' (comma) and replace it with a ';' (semicolon) and add
return $schema;
to the end of the file.
Hope this helps get you started.