---
title: "To Display Both the main Image and the additional image in the product view page"
description: "Show both the main image and the additional image on the product page by overriding the view_images.php layout."
url: "https://docs.j2commerce.com/common-overrides/to-display-both-the-main-image-and-the-additional-image-in-the-product-view-page"
markdown_url: "https://docs.j2commerce.com/common-overrides/to-display-both-the-main-image-and-the-additional-image-in-the-product-view-page.md"
last_updated: "2026-10-23T03:36:49+00:00"
version: "J2Store 4"
breadcrumbs:
  - title: "Home"
    url: "https://docs.j2commerce.com/"
  - title: "Common Overrides"
    url: "https://docs.j2commerce.com/common-overrides"
  - title: "To Display Both the main Image and the additional image in the product view page"
    url: "https://docs.j2commerce.com/common-overrides/to-display-both-the-main-image-and-the-additional-image-in-the-product-view-page"
---

# To Display Both the main Image and the additional image in the product view page

Please carry out the override as follows:

Navigate to “/components/com_j2store/templates/default/view_images.php”.

Copy the above file and paste it under “/templates/your template/html/com_j2store/your sub-template”.

Now edit the file under the overridden path and around line 39, you would find this:

````
<?php echo J2Store::product()->displayImage($this->product,array('type'=>'ViewMain','params' => $this->params)); ?>
<?php endif; ?>
</div>
<?php endif; ?>```
````

`Change it to:`

````
```    <?php elseif(!empty($this->product->main_image)):?>
    <?php echo J2Store::product()->displayImage($this->product,array('type'=>'ViewMain','params' => $this->params)); ?>
    <?php endif; ?>
    </div>
    <?php endif; ?>
    <div class="j2store-thumbnail-image">
    <?php if(JFile::exists(JPATH_SITE.'/'.JPath::clean($this->product->thumb_image))):?>
        <img itemprop="image" alt="<?php echo (!isset($this->product->thumb_image_alt) || empty($this->product->thumb_image_alt)) ? $this->product->product_name:$this->product->thumb_image_alt ;?>" title="<?php echo $this->product->product_name ;?>" class="j2store-img-responsive j2store-product-thumb-image-<?php echo $this->product->j2store_product_id; ?>" src="/<?php echo $image_path.$this->product->thumb_image;?>" />

    <?php elseif(!empty($this->product->thumb_image)):?>
    <?php echo J2Store::product()->displayImage($this->product,array('type'=>'Thumb','params' => $this->params)); ?>
    <?php endif; ?>
    </div>          
````

Save.

Now the main image as well as the thumbnail image should appear on the product view page.
