Different Image on Product Listing page

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard Hikashop Business
1 year 2 months ago #355260

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 4.3.4

Hello,
I have my products setup with two images, the 'brand' first image I need to show on the Product Catgeory page. I would then like to have the second image, which is the actual product to be displayed on the Product detail page.

How can I 'swap' them around on the detail page?

Thanks

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355264

Hi,

Edit the show_block_img view file via the menu Display>Views, and at the top, add:

<?php array_shift($this->element->images); ?>
Note that this will apply for all the products on the website.

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

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard Hikashop Business
1 year 2 months ago #355334

Hello,
Thanks for the code. it does eem to work to some point, however, on products with only one image this is then replaced by the default image and not the product image.

On products with more than one image you do get the images reveresed, but then the thumbnails that should be below the images are now not shown.

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355337

Hi,

Yes. That's why I said

Note that this will apply for all the products on the website.

If you want this to apply only when products have several images, then you need to change the code to:
<?php if(count($this->element->images) > 1) array_shift($this->element->images); ?>

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

Time to create page: 0.056 seconds
Powered by Kunena Forum