NIcolas
Beautiful! Plug-in gets called and works a treat!
BUT I now realise that the images for each product are not handily stored in a subdirectory but instead are referenced from all of the images of that particular size in the uploads/thumbnails directory. This means that I can't simply point the vsir plugin at a subdirectory.
So, to make it work I have to create a seperate images directory for each of the products that need to use the rotator. I'm using the product_code (which Hikashop forces to be unique) as the directory name and my code checks to see if this directory exists. If it does, the image rotator is called, if not, the normal hikashop single image display is called.
Although it's manageable, ideally it would be really good if hikashop shipped with an image rotator that can be enabled or disable on a per product basis.
If anyone else would like to use the technique I've used, I'm happy to share the code that I implemented in the View -> show_block_img.php
At the top of the file, set up the path (I'm using the [root]/images directory with subdirectories using the same name as the Product Code
/**
* bonzomedia - image rotator path set up
*/
$rotator_image_path = 'images/'.$this->element->main->product_code;
?>
Further down in show_block_img.php I test to see if the subdirectory exists, if it does I assume that the product images for the rotator have been placed in this directory and call the plug-in. If the directory does not exist I revert back to the standard Hikashop display.
<div class="hikashop_product_main_image_thumb" id="hikashop_image_main_thumb_div<?php echo $variant_name;?>" <?php echo $style;?> >
<div style="<?php if(!empty($divHeight)){ echo 'height:'.($divHeight+20).'px;'; } ?>text-align:center;clear:both;" class="hikashop_product_main_image">
<div style="position:relative;text-align:center;clear:both;<?php if(!empty($divWidth)){ echo 'width:'.$divWidth.'px;'; } ?>margin: auto;" class="hikashop_product_main_image_subdiv">
<?php
if (file_exists($rotator_image_path))
echo JHTML::_('content.prepare','{vsir '.$rotator_image_path .'}');
else
echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width, $height);
if(!empty($this->element->badges))
$this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0');
?>
</div>
</div>
</div>