Different Image on Product Listing page

  • Posts: 230
  • Thank you received: 4
  • Hikashop Business
9 months 4 weeks 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: 82065
  • Thank you received: 13193
  • MODERATOR
9 months 4 weeks 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: 230
  • Thank you received: 4
  • Hikashop Business
9 months 3 weeks 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: 82065
  • Thank you received: 13193
  • MODERATOR
9 months 3 weeks 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.057 seconds
Powered by Kunena Forum