"special" product image

  • Posts: 43
  • Thank you received: 1
11 years 6 months ago #143265

Hi.
I post this because it can be a useful feature for others developers.
In the same time I ask for help to complete the feature.

In the "product page" I would like to have una image as a sort of "special image".
The image have to be positioned as indicated by the green arrow in my attachment.




I believe the best thinghs to do is to dedicate one of the product images to this purpose.
For example: the first image (order number 1) is the "main one" (as it is now). The second image (order numer 2) will be the "special one" (as I wish) . The other images will be displayed at the bottom of the main image (as it is now).
To do that, first i changed this code in the Display -> View -> Products / Show_block_img, in order to disappear the image number 2.
It works!

<div id="hikashop_small_image_div<?php echo $variant_name;?>" class="hikashop_small_image_div">
<?php
if (!empty ($this->element->images) && count($this->element->images) > 1) {
$relatedImageNumber = 0 ;
foreach ($this->element->images as $image) {
$relatedImageNumber = $relatedImageNumber + 1 ;
if ($relatedImageNumber != 2)
echo $this->image->display($image->file_path, 'hikashop_main_image'.$variant_name, $image->file_name, 'class="hikashop_child_image"','', $width, $height);
}
}
?>

Now, let's face with the hard thingh.
I need to display the image number 2 in the position pointed by the green arrow showed in my attachment.
To do that, I go in Display -> View -> Products / Show_reversed
and under <div id="hikashop_product_left_part" I tried to put some code but I was unable to succeed.
Any help?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 84243
  • Thank you received: 13689
  • MODERATOR
11 years 6 months ago #143350

Hi,

If you want to put an image at the top of the description, why not actually put the image actually in the description, at the beginning of the text ? That's easy to do with the HTML editor of the description and will do it without having to mess with the image display system of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 43
  • Thank you received: 1
11 years 6 months ago #143520

Obviously, you're right! I lost the simple way. Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum