I suggest to add Fancybox as supported image widget. This can be done by adding new function to uc_store.module:

/**
 * This function generates the Fancybox-specific HTML attributes.
 */
function uc_store_image_widget_fancybox($rel_count) {
  if (!is_null($rel_count)) {
    $img_index = 'uc_image_'. $rel_count;
  }
  else {
    $img_index = 'uc_image';
  }
  return ' class="imagefield-fancybox" rel="'. $img_index .'"';
}

and by extending uc_store_uc_image_widget() function:

  if (module_exists('fancybox')) {
    $widgets['fancybox'] = array(
      'name' => t('Fancybox'),
      'callback' =>'uc_store_image_widget_fancybox',
    );
  }

Comments

tr’s picture

Status: Active » Postponed

I'm going to postpone this issue because I don't think adding an if( module_exists()) clause for each and every possible *box is the right way to go - we need a workable strategy whereby a new image widget can be used without modifying Ubercart code. This requires abstracting out the notion of an image widget so that Ubercart can deal with a common shared interface without knowing the particular type of *box being used. Both #772472: Add support for Colorbox and #582334: Lightbox2, jQuery lightbox, etc. modularization strategy contain some discussion of where this is heading in the Drupal world.

longwave’s picture

Status: Postponed » Closed (won't fix)

This is already possible without modifying Ubercart core by using hook_uc_image_widget(), see #347086: Make the product pop-up images a pluggable system

As it has only been requested by one user it is unlikely this will be added to Ubercart core.