[Skip to main content](#vessel-content)

#   Changing main image path

##

- **[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")**
- [![Jarkheld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35024-jarkheld "View Jarkheld's Profile") Topic Author
- [ Offline](/forum/user/35024-jarkheld)

Less More

- Posts: 7
- Thank you received: 0
-
-

11 years 11 months ago [\#180168](#180168) by [Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")  *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180168 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")* was created by *[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")*

-- HikaShop version -- : 2.2.3
-- Joomla version -- : 3.3.1

Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities.
I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com_hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick="return window.localPage.openImage('hikashop_main_image');" href="/media/com_hikashop/upload/xxxxxxxxxxxxx.jpg". I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show_block_image.php or image.php. i suppose ![:D](/bigsmile.gif ":D")

thank you so much!! :blush:

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 11 months ago [\#180172](#180172) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180172 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")*

Hi,

Yes you indeed have to edit the view "product / show_block_img" and replace: Code:

echo $this-&gt;popup-&gt;image($html, $img-&gt;origin_url, null, $attr);

By: Code:

echo $this-&gt;popup-&gt;image($html, $img-&gt;url, null, $attr);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")**
- [![Jarkheld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35024-jarkheld "View Jarkheld's Profile") Topic Author
- [ Offline](/forum/user/35024-jarkheld)

Less More

- Posts: 7
- Thank you received: 0
-
-

11 years 11 months ago [\#180301](#180301) by [Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")  Replied by *[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")* on topic *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180301 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")*

Hi, I tried to replace the code but the result was uncorrect ![:unsure:](/media/kunena/emoticons/22.png ":unsure:") :

this was the original code:
Code:

&lt;a onclick="return window.localPage.openImage('hikashop_main_image');" href="/media/com_hikashop/upload/splin_boots_ref_0159_010_49784865.jpg" rel="{handler:'image'}" target="_blank"&gt;&lt;img id="hikashop_main_image" class="JMProductImgMain" style="vertical-align:middle" title="Splin Boots Green" alt="Splin Boots Green" src="/media/com_hikashop/upload/thumbnails/600x600/splin_boots_ref_0159_014_1.jpg" width="600" height="600"&gt;&lt;/a&gt;

replacing the php code i now have the value of "href" after onclick function just alike the "src" one :
Code:

&lt;a onclick="return window.localPage.openImage('hikashop_main_image');" href="/media/com_hikashop/upload/thumbnails/600x600/splin_boots_ref_0159_010_49784865.jpg" rel="{handler:'image'}" target="_blank"&gt;&lt;img id="hikashop_main_image" class="JMProductImgMain" style="vertical-align:middle" title="Splin Boots Blue" alt="Splin Boots Blue" src="/media/com_hikashop/upload/thumbnails/600x600/splin_boots_ref_0159_0111.jpg" width="600" height="600"&gt;&lt;/a&gt;

What i'd need to do is the opposite thing: the result should be something like the one below, where the image loaded in the path of the main preview is the original file in place of the thumbnail one (found in 600x600 folder), letting the system use the 600x600 image only for the thumbnails on the right:
Code:

&lt;a onclick="return window.localPage.openImage('hikashop_main_image');" href="/media/com_hikashop/upload/splin_boots_ref_0159_010_49784865.jpg" rel="{handler:'image'}" target="_blank"&gt;&lt;img id="hikashop_main_image" class="JMProductImgMain" style="vertical-align:middle" title="Splin Boots Blue" alt="Splin Boots Blue" src="/media/com_hikashop/upload/splin_boots_ref_0159_010_49784865.jpg" width="600" height="600"&gt;&lt;/a&gt;

is it possible?

thank you so much ![:cheer:](/media/kunena/emoticons/10.png ":cheer:")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 11 months ago [\#180399](#180399) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180399 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")*

In that case, then instead of the previous code change, you want to change: Code:

$html = '&lt;img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this-&gt;escape(@$image-&gt;file_description).'" alt="'.$this-&gt;escape(@$image-&gt;file_name).'" src="'.$img-&gt;url.'"/&gt;';

by: Code:

$html = '&lt;img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this-&gt;escape(@$image-&gt;file_description).'" alt="'.$this-&gt;escape(@$image-&gt;file_name).'" src="'.$img-&gt;origin_url.'"/&gt;';

The following user(s) said Thank You: [Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")**
- [![Jarkheld's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35024-jarkheld "View Jarkheld's Profile") Topic Author
- [ Offline](/forum/user/35024-jarkheld)

Less More

- Posts: 7
- Thank you received: 0
-
-

11 years 11 months ago [\#180596](#180596) by [Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")  Replied by *[Jarkheld](/forum/user/35024-jarkheld "View Jarkheld's Profile")* on topic *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180596 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")*

thank you so so much ![:D](/bigsmile.gif ":D") it works perfectly!!!

I've got just one small issue to solve: is there any way to let the system show the thumbnail even if there is only one image referring the product?

thanks :blush:

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 11 months ago [\#180601](#180601) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing main image path](/forum/26-product-category-display/873094-changing-main-image-path#180601 "-- HikaShop version -- : 2.2.3 -- Joomla version -- : 3.3.1  Hi, first of all i'de like to thank you for the great effort you put on providing us a great e-commerce management plugin, with a lot of options and potencialities. I had a problem during the last weeks concerning the images that the system loads on the product page, as I could see from the code both the thumbnail images and main images are loaded from the same root/file: /media/com&#95;hikashop/upload/thumbnails/430x430/xxxxxxxxxxxxx.jpg , while the image loaded in the pop-up window (via onclick function) is loaded from a different one: onclick=&quot;return window.localPage.openImage('hikashop&#95;main&#95;image');&quot; href=&quot;/media/com&#95;hikashop/upload/xxxxxxxxxxxxx.jpg&quot;. I'd need to have the same source file loaded through the onclick function used as the main image file so that i will be able to manage the thumb files and the main image file singularly. Is it possibile to modify the php files in order to let the system do that? It should be somewhere in show&#95;block&#95;image.php or image.php. i suppose :D  thank you so much!! :blush:")*

Remove the code: Code:

&amp;&amp; count($this-&gt;element-&gt;images) &gt; 1

from that view and that should do it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzMwOTQtY2hhbmdpbmctbWFpbi1pbWFnZS1wYXRoP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.190 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
