Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Advanced Search Highslide Integration


beatznbleepz

Recommended Posts

I have successfully developed a system to display horizontal and vertical images and flash animations on my site with Highslide.

 

All my image filenames begin with H_ or V_.

 

I parse the file name then compare it to see if it starts with H_ - if so I output the required format to display Horizontal images - works the same for V_ and Vertical images.

 

I had to do this for the zooming of the images to send the right data to Highslide for displaying the flash animations or stills in the right format.

 

I discovered recently that the advanced search function - although it uses the same product_listing.php - the results are handled by the "Buy Now routine" which displays a list of results for the search.

 

The problem is that the images are not encapsulated by my code and when clicked open full screen in the browser...!

 

Here is the original code for displaying a product listing:

 

case 'PRODUCT_LIST_IMAGE':
           $lc_align = 'center';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
           } else {
             $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
           }
           break;

 

Here it is with my Horizontal / Vertical Mods that are currently in use on the site:

 

case 'PRODUCT_LIST_IMAGE':
  // get the current image name
         $string = ($listing['products_image']);
  // reformat the name int flash syntax
  $flash_filename  = (substr_replace($string, '.swf', -4, 4));

  // check if vertical or Horizontal image

if ( ( $string[0] == 'V' ) && ( $string[1] == '_' ) ) { 
  //  Show Vertical (420 x 220)
    $lc_align = 'center';
   $p_pic = ' <a id="thumb' . $listing['products_id']  . '" class="highslide"  href="' . DIR_WS_IMAGES .  $flash_filename . '" onclick="return hs.htmlExpand(this, {  objectType: \'swf\', width: 281, objectWidth: 281, objectHeight: 420 })"><img src="'  . DIR_WS_IMAGES .  $string . '" alt="'. $listing['products_name'] .'"></a> ';   
      }
if ( ( $string[0] == 'H' ) && ( $string[1] == '_' ) ) { 
  //  Show Horizontal (220 x 420)
  $lc_align = 'center';
$p_pic = ' <a id="thumb' . $listing['products_id']  . '" class="highslide"  href="' . DIR_WS_IMAGES .  $flash_filename . '" onclick="return hs.htmlExpand(this, {  objectType: \'swf\', width: 420, objectWidth: 420, objectHeight: 281 })"><img src="'  . DIR_WS_IMAGES .  $string . '" alt="'. $listing['products_name'] .'"></a> ';   
   }  
break;

 

Here is the next area of code that displays the Advanced Search results:

 

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $p_button =  $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now1.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';
       break;

 

My question - How do I cange the Advanced Search Results 'PRODUCT_LIST_BUY_NOW' - to encapsulate the same type of H_ or V_ check, formatting the final URL to work with Highslide as I did with the main product image routine?

 

Phew!

 

Any help with this would be much appreciated.

 

Robin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...