how do i create a new link in node.tpl.php by preprocess function in drupal?
This line will always return true, since you are assigning a value with the '=' operator:

if($variables['type']="product"){


This should be a comparison, so use '==':

if($variables['type']=="product"){