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

#   Product Details group option products by category

##

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

Less More

- Posts: 38
- Thank you received: 1
-
-

10 years 4 months ago [\#244395](#244395) by [doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")  *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244395 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")* was created by *[doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")*

-- HikaShop version -- : latest
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : Chrome latest

Help please,

**What I have:**
I have products with "option products" linked.
Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.

**What I need:**
I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option.
Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for "RAM" followed by the RAM category option products, then a heading for "HDD" followed by the RAM category option products and so on, only letting them select one option from each category.

**My questions:**
1) I believe I only need to edit the Product Details view to make this happen, is this right?
2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?

Any helpful response within the next few hours would be appreciated.

Thank you,

MA.

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

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

Less More

- Posts: 38
- Thank you received: 1
-
-

10 years 4 months ago [\#244401](#244401) by [doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")  Replied by *[doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244401 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

Solved mostly:
I might just add Option products in place of category and add variants / characteristics to those option products.

New question related:
3)
How do I get the image of the option product selected to show on the page somewhere when selected?

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

10 years 4 months ago [\#244417](#244417) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244417 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

Hi,

Using options is the way to go I think.
However, there is no system to display the images of the options and refresh them.
It will require adding custom code in the file "option" of the view "product" via the menu Display&gt;Views to load the images, add their HTML to the page and hide/display that HTML based on what is selected by the customer.

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

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

Less More

- Posts: 38
- Thank you received: 1
-
-

10 years 4 months ago [\#244443](#244443) by [doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")  Replied by *[doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244443 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

I figured that, thank you.

What calls the image? I just need the code to past in here:

This line 126:
$options='&lt;img src="'.HIKASHOP_IMAGES.'info.png" alt="Information"/&gt;';

I want to replace "info.png" with something like:
$optionInfo-&gt;product_image

What is the correct way to call the image?

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

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

Less More

- Posts: 38
- Thank you received: 1
-
-

10 years 4 months ago [\#244444](#244444) by [doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")  Replied by *[doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244444 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

It has to call the image of the option, or the option's variant I should say. All of the options have variants with images attached that need to show when the variant of the option is selected.

Am I close with
$optionInfo-&gt;product_image
?

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

10 years 4 months ago [\#244463](#244463) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244463 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

Hi,

The options images are not loaded on the product page since there is no need to normally.
So, as I said, you first need to load them. You can do that with a MySQL query on the hikashop_file table like that: Code:

$db = JFactory::getDBO(); $db-&gt;setQuery('SELECT * FROM #__hikashop_file WHERE file_ref_id IN (XXX, YYY, ZZZ) AND file_type=\'product\''); $images = $db-&gt;loadObjectList();

And XXX, YYY and ZZZ are the ids of your products or variants (if you have options with variants, then it's the ids of the variants that you want to set in the query).
Then, to display the image with the index $k in the array $images, you can do like that: 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($images[$k]-&gt;file_path, array('width' =&gt; $width, 'height' =&gt; $height), $image_options); if(@$img-&gt;success) { echo '&lt;img title="'.$this-&gt;escape($images[$k]-&gt;file_description).'" alt="'.$this-&gt;escape($images[$k]-&gt;file_name).'" src="'.$img-&gt;url.'"/&gt;'; }

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

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

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

Less More

- Posts: 38
- Thank you received: 1
-
-

10 years 4 months ago [\#244531](#244531) by [doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")  Replied by *[doitsolutions](/forum/user/4298-doitsolutions "View doitsolutions's Profile")* on topic *[Product Details group option products by category](/forum/26-product-category-display/885343-product-details-group-option-products-by-category#244531 "-- HikaShop version -- : latest -- Joomla version -- : 3.5.1 -- PHP version -- : 5.4.35 -- Browser(s) name and version -- : Chrome latest  Help please,  What I have: I have products with &quot;option products&quot; linked. Eg. Main product = Computer, Option products = ram upgrade 8GB, HDD upgrade 2TB etc.  What I need: I simply need the product details page to show each category of the option products, and then show the option products with a radio button or single select drop-down option. Eg. If there are option products linked to this product from the RAM and HDD categories, we need a heading for &quot;RAM&quot; followed by the RAM category option products, then a heading for &quot;HDD&quot; followed by the RAM category option products and so on, only letting them select one option from each category.  My questions: 1) I believe I only need to edit the Product Details view to make this happen, is this right? 2) I desperately need this urgently today, I may not figure it out in time. Could any of you suggest code to point me in the right direction? I am also willing to pay a freelancer but cannot find a reliable one soon enough. Can any of you help me within 6 hours at a reasonable rate?  Any helpful response within the next few hours would be appreciated.  Thank you,  MA.")*

Thank you so very much for your solution, we will be applying it soon.
I appreciate your input, our devs were having trouble figuring out how to do that, I think you have just given them the key then need.

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

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