By including html elements as siblings of the $link element and attaching click callbacks to them, you can add buttons and specify their behavior.


$.fn.tagalys_templates = $.fn.tagalys_templates || {};
$.fn.tagalys_templates.product_tile = function(widget, product_details) {
  var $link = $('<a>', { class: 'product-link', href: product_details.link });
  // ...
  var $quick_look_link = $('<a>', { class: 'quick-look-link' });
  $quick_look_link.data('product-sku', product_details.sku);
  $quick_look_link.on('click', function(e) {
    alert('Quick look for product ' + $(this).data('product-sku'));
    e.preventDefault();
    e.stopPropagation();
  });
  return $link.add($quick_look_link);
};