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

#   product Options part image

##

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 5 months ago -  12 years 5 months ago [\#158289](#158289) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#158289 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")* was created by *[kaya](/forum/user/25605-kaya "View kaya's Profile")*

Hi dear
when create a product we have a Options part and when select a item in Options don't show Options product image.
I want show in my product page Options selected item image. how can do it?
[ ![400](http://i59.tinypic.com/1177exy.jpg) ](http://i59.tinypic.com/1177exy.jpg "400")

this code for option part in my fronted: Code:

$html='&lt;span class="hikashop_option_name" &gt;&lt;a href="'.$optionInfo-&gt;product_url.'"&gt;'.$optionInfo-&gt;product_name.$options.'&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="padding-left:9px"&gt;'.JText::_( 'MAIN_OPTION_AF' ).'&lt;/span&gt;'.$html;

i want show each options item image.

Last edit: 12 years 5 months ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg2NjUtcHJvZHVjdC1vcHRpb25zLXBhcnQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) 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)
-

12 years 5 months ago [\#158356](#158356) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#158356 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Hi,

You have to edit the view "product / show_default" and display the images thanks to a code like the one which can be found in the view "product / show_block_img".
The code to adapt is this one: Code:

$image_options = array('default' =&gt; true,'forcesize'=&gt;$this-&gt;config-&gt;get('image_force_size',true),'scale'=&gt;$this-&gt;config-&gt;get('image_scale_mode','inside')); $img = $this-&gt;image-&gt;getThumbnail(@$image-&gt;file_path, array('width' =&gt; $width, 'height' =&gt; $height), $image_options); if($img-&gt;success) { $attr = ''; if (!empty ($this-&gt;element-&gt;images) &amp;&amp; count($this-&gt;element-&gt;images) &gt; 1) { $attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image'.$variant_name.'\');"'; } }

The following user(s) said Thank You: [kaya](/forum/user/25605-kaya "View kaya's Profile")

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 5 months ago [\#158374](#158374) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#158374 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Thank you dear Xavier
what code add in my view "product / show_default" for display options images?

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 5 months ago [\#158377](#158377) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#158377 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Hello Kaya,
Note that another solution can be to simply add your option images through your main product description.

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 5 months ago -  12 years 5 months ago [\#159317](#159317) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#159317 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Thank you dear Mohamed Thelji
but I want show images of selected product in options part.
this code show option part in product page Code:

$this-&gt;setLayout('option'); echo $this-&gt;loadTemplate();

I want show images of option layout
please help me how can do it?
thank you

Last edit: 12 years 5 months ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 5 months ago [\#159421](#159421) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#159421 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

no one help me?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg2NjUtcHJvZHVjdC1vcHRpb25zLXBhcnQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

12 years 5 months ago [\#159478](#159478) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#159478 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Hi,

Displaying the images of the options on the product page is not easy.
First, the options images need to be loaded from the database with a MySQL query on the hikashp_files table.
Then, the images need to be displayed with code similar (but a bit adapted) to the one of the show_img_block.
And if you want the option image displayed to change dynamically based on the selected option, you also need custom javascript code to do that.
Basically, it's not easy to do and requires proper development by a developer. If you're not one yourself, I would recommend to contact our partners for a quote on the project ( [ www.hikashop.com/home/our-partners.html](http://www.hikashop.com/home/our-partners.html) ), or to find a developer via our commercial jobs forum, joomlancers.com or resources.joomla.org

The following user(s) said Thank You: [kaya](/forum/user/25605-kaya "View kaya's Profile")

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 5 months ago -  12 years 5 months ago [\#159527](#159527) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[product Options part image](/forum/26-product-category-display/868665-product-options-part-image#159527 "Hi dear when create a product we have a Options part and when select a item in Options don't show Options product image. I want show in my product page Options selected item image. how can do it? &#91;image&#93;  this code for option part in my fronted:  i want show each options item image.")*

Thank you dear nicolas
i can echo option part images in product page by this code: Code:

foreach($this-&gt;element-&gt;options as $optionElement){ $image_options = array('default' =&gt; true); $height = $this-&gt;config-&gt;get('product_image_y'); $width = $this-&gt;config-&gt;get('product_image_x'); $product_id = $optionElement-&gt;product_id; $producturl = JRoute::_("index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=$product_id"); foreach($optionElement-&gt;images as $img){ $imgs = $this-&gt;image-&gt;getThumbnail(@$img-&gt;file_path, array('width' =&gt;$width, 'height' =&gt; $height), $image_options); echo '&lt;img src="'.$imgs-&gt;url.'" /&gt;'; }

it's php foreach loop now i want show each option product image with product name.
this code echo option product name outside my php foreach loop: Code:

$html='&lt;span class="hikashop_option_name" &gt;'.$optionInfo-&gt;product_name.$options.'&lt;/span&gt;&lt;/td&gt;&lt;td&gt;'.$html

thank you

Last edit: 12 years 5 months ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg2NjUtcHJvZHVjdC1vcHRpb25zLXBhcnQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) 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.061 seconds

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