Hi,
1. That would indeed require custom coding.
Supposing that we're talking about the product details page and that you're using the default layout, you would want to add such code
:
$my = JFactory::getUser();
jimport('joomla.access.access');
$userGroups = JAccess::getGroupsByUser($my->id);
$contact = false;
if(in_array(XX, $userGroups))
$contact = true;
after the code:
$contact = (int)$this->config->get('product_contact', 0);
in the file product / show_default.php via the menu Display>Views.
This will display the contact button only to the users in the user group with the id XX.
2. I don't understand what login button you're talking about ? You mean you want to display a link to the login form instead of the contact button when the user is not logged in ?