Hi,
Sure. Instead of that code change, in the same place, change the code:
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
to:
$url_itemid='&Itemid=XXX';
where XXX is the id of a menu item of the HikaShop component which has its "access level" setting set to "registered".
That way, the button will always display, but it will point to the contact page on a menu item which isn't accessible to him based on the Joomla access level setting of that menu item, and thus Joomla will automatically redirect the user to the login form with a message explaining the situation, which will also have a link for registration if necessary.