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

#   Display Variant / Characheristic options on Category layout

##

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 9 months ago [\#338928](#338928) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#338928 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")* was created by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")*

Hello,
I have a website that sells products with different color options. These are set as variants of the parent product.

When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.

To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.

I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:

[ ](https://www.hikashop.com/support/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category.html)[ www.hikashop.com/support/forum/4-how-to/...in-the-category.html](https://www.hikashop.com/support/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category.html)

Would it be possible for you to supply some sample code and the overrides required?

How do i request this as a feture to be included in future HikaShop relelases?

Thanks
Lee

- [ ![Screenshot2022-01-24at10.50.53.png](/forum/attachment/54264) ](/forum/attachment/54264 "...at10.50.53.png") [ ](/forum/attachment/54264?download=1 "...at10.50.53.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 9 months ago -  4 years 9 months ago [\#338936](#338936) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#338936 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

The code was provided by kyratn on the other thread. I've not tested it myself. Here is the code with the modifications we talked about in the other thread included: Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM #__hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_quantity&gt;0 AND product_published &gt; 0"; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadColumns(); $query = 'SELECT * FROM #__hikashop_variant AS v LEFT JOIN #__hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=XXX AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." ";; } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

this code is to be placed in product / listing_img_title via the menu Display&gt;Views.

Note however that this is only a crude version of the complete solution:
- there is no selection of the variant
- there is no possibility to add the variant directly to the cart from there, or see the different prices / stocks
/ images of each variant if you display that information on the listing.
- you'll likely need a bit of CSS as you have less space available than on the product details page

So it's not something we could implement like that in HikaShop.
We already have on our todo list the capability to have variants directly displayed and selectable on the listing. We've had it for years.
However, a complete solution is not easy and it raises several issues that make it difficult for us to implement it in a generic way compared to a solution specific to the needs of one shop.

Last edit: 4 years 9 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 9 months ago [\#338970](#338970) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#338970 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
Thanks for the reply, I have modified my template (and changed the table prefix from the example code) but now get SQL error:

syntax error, unexpected 'c' (T_STRING) for this line:

$query = 'select * from ozi8g_hikashop_variant as v left join ozi8g_hikashop_characteristic as c on v.variant_characteristic_id=c.characteristic_id where characteristic_parent_id=XXX and variant_product_id in ('.$parent_product_ids.') group by characteristic_id ORDER BY &#96;c&#96;.&#96;characteristic_ordering&#96; ASC';

Unfortunately my PHP / MySQL skills are not good enough to debug this error? Any advice?

I also fully understand your comments regaridng developing a solution that is suitable for 'everyone' and I suspect your todo list is long, but if there could be a discussion on developing some sort of solution, even if it is an extra plugin it would be greatly appreciated ![:-)](/media/kunena/emoticons/9.png ":-)")

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 9 months ago [\#338973](#338973) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#338973 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

Try replacing:
&#96;c&#96;.&#96;characteristic_ordering&#96;
by:
c.characteristic_ordering

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 9 months ago [\#339005](#339005) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339005 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
I've done that and now get:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''#__hikashop_product' WHERE (product_parent_id=1)' at line 1

![:-(](/media/kunena/emoticons/4.png ":-(") I Appreciate all your efforts, thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 9 months ago [\#339009](#339009) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339009 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

Could you provide a screenshot of the code you have now ?
Also, I've updated the code in my original message with some fixes, so that might help.

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 9 months ago [\#339120](#339120) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339120 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
With your updated code I have this eroor:
Code:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC' at line 1 /home/underdev/mxgroup-new.under-development.info/libraries/joomla/database/driver/mysqli.php (668)

I've attcahed a screenshot fo the code.

Lee

- [ ![hika-code.png](/forum/attachment/54311) ](/forum/attachment/54311 "hika-code.png") [ ](/forum/attachment/54311?download=1 "hika-code.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 9 months ago [\#339121](#339121) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339121 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

I've updated the code in my message for that error message.

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 9 months ago [\#339146](#339146) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339146 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
still does not seem 100% correct. With some help I managed to enter a var_dump to show the query and now get this:

*Warning: implode(): Invalid arguments passed in /home/underdev/mxgroup-new.under-development.info/templates/t4\_blank/html/com\_hikashop/product/listing\_img\_title.php on line 96
string(265) "SELECT \* FROM XXX\_hikashop\_variant AS v LEFT JOIN XXX\_hikashop\_characteristic AS c ON v.variant\_characteristic\_id=c.characteristic\_id WHERE characteristic\_parent\_id=9 AND variant\_product\_id IN () GROUP BY characteristic\_id ORDER BY c.characteristic\_ordering ASC"*

This is the code I now have:
Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM XXX_hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_quantity&gt;0 AND product_published &gt; 0"; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadColumns(); $query = 'SELECT * FROM XXX_hikashop_variant AS v LEFT JOIN XXX_hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=9 AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); var_dump($database-&gt;getQuery()); die; $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

I have chnaged the db prefix to XXX, and also add the specific ID of the characteristic.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 8 months ago [\#339184](#339184) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#339184 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

This means that the first MySQL query "SELECT group_concat(product_id) AS product_ids FROM XXX_hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_quantity&gt;0 AND product_published &gt; 0" doesn't find any variants for the current product.
That code was made supposing that all the products on the shop had variants.
So what you need to do is to add an extra check like this: Code:

if(!empty($parent_product_ids)) { $query = 'SELECT * FROM XXX_hikashop_variant AS v LEFT JOIN XXX_hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=9 AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); var_dump($database-&gt;getQuery()); die; $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } }

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 5 months ago [\#341536](#341536) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341536 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
Apologies just getting back on this project, I have now updated to Joomla 4 and Hikashop 4.5.1 but still cannot get the characteristics to display.

This is the code I have below, but when I have the **$parent\_product\_ids=$database-&gt;loadColumns();** active the page fails with a MySQLi failure:

**Call to undefined method Joomla\\Database\\Mysqli\\MysqliDriver::loadColumns()**

Can you help ![:-)](/media/kunena/emoticons/9.png ":-)")
Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM XXX_hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_quantity&gt;0 AND product_published &gt; 0"; $database-&gt;setQuery($query); //$parent_product_ids=$database-&gt;loadColumns(); if(!empty($parent_product_ids)) { $query = 'SELECT * FROM XXX_hikashop_variant AS v LEFT JOIN XXX_hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=9 AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); var_dump($database-&gt;getQuery()); die; $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 5 months ago [\#341537](#341537) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341537 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

The function name is loadColumn without the "s" at the end. That's why you get that error.

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 5 months ago [\#341562](#341562) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341562 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
Thanks for the reply, I have removed the rouge 's' and now get this error!
Code:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC' at line 1

Thanks for your help

Lee

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 5 months ago [\#341565](#341565) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341565 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

Could you provide the code you have now ?

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 5 months ago [\#341577](#341577) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341577 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
this is what I have:
Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM q19u3_hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_quantity&gt;0 AND product_published &gt; 0"; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadColumn(); if(!empty($parent_product_ids)) { $query = 'SELECT * FROM q19u3_hikashop_variant AS v LEFT JOIN q19u3_hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=9 AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); var_dump($database-&gt;getQuery()); die; $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

Could it be the var_dump or die statements? not sure why they are there?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 5 months ago [\#341579](#341579) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341579 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

The error message indicates that implode(',',$parent_product_ids) returns nothing. So either $parent_product_ids is empty or it's an array with no values or something like that.
Try changing :
if(!empty($parent_product_ids)) {
to:
if(!empty($parent_product_ids) &amp;&amp; count($parent_product_ids)) {

Also, if that doesn't help, try adding a var_dump($parent_product_ids); to see what's in that variable.

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

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

Less More

- Posts: 237
- Thank you received: 5
-
-

4 years 5 months ago -  4 years 5 months ago [\#341601](#341601) by [ltempest](/forum/user/1784-ltempest "View ltempest's Profile")  Replied by *[ltempest](/forum/user/1784-ltempest "View ltempest's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341601 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Nicolas,
Ok I have made some progress!

Looking at the code it had this:

**AND product\_quantity&gt;0**

Well my products do not have stock levels so it was never going to get the values as the database was showing product_quantity at -1!

removing that now gives me an array of ID's when I do the var_dump, for example:

**array(1) { \[0\]=&gt; string(![8)](/media/kunena/emoticons/2.png "8)") "16,17,18" }**

Next the second query that gets the variants uses this:

**WHERE characteristic\_parent\_id=ZZZ**

However my parent ID was not 9 as originally used in previous code. Looking in the XXX_hikashop_characteristic table and selelcting the correct characteristic_id, it is now displaying the product variant Characteristic as I need (see attached frontend screen shot).

So it is now 'working' finally we got there! ![:-)](/media/kunena/emoticons/9.png ":-)")

I really hope this functionality can be discussed and included as a feature request in future HikaShop releases.

Thank you for your time and efforts, it is most appreciated ![:-)](/media/kunena/emoticons/9.png ":-)")

Lee

For anyone else wanting this functionality here is the code that is added to a template override for **product/listing\_img\_title.php**. You need to change the XXX to your database table prefix and the ZZZ to the characteristic_id of the characteristic from the _hikashop_characteristic table of your database.
Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM XXX_hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_published &gt; 0"; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadColumn(); //var_dump($parent_product_ids); if(!empty($parent_product_ids) &amp;&amp; count($parent_product_ids)) { $query = 'SELECT * FROM XXX_hikashop_variant AS v LEFT JOIN XXX_hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=ZZZ AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

- [ ![Screenshot2022-05-13at13.58.28.png](/forum/attachment/54796) ](/forum/attachment/54796 "...at13.58.28.png") [ ](/forum/attachment/54796?download=1 "...at13.58.28.png")

Last edit: 4 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM4NzItZGlzcGxheS12YXJpYW50LWNoYXJhY2hlcmlzdGljLW9wdGlvbnMtb24tY2F0ZWdvcnktbGF5b3V0P3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

4 years 5 months ago [\#341602](#341602) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Variant / Characheristic options on Category layout](/forum/26-product-category-display/903872-display-variant-characheristic-options-on-category-layout#341602 "Hello, I have a website that sells products with different color options. These are set as variants of the parent product.  When a customer is viewing a category layout they only see the parent item and do nto know what colors are available until they go to the product view page.  To enhance the visitor experience (and hopefully increase sales) I would like to show the variant color options when they are browsing the main category page. On other e-commerce sites I have seen this displayed. If you look at the attcahed screesnhot this shows somethign similar to what I would like to display. The main prodicyt and then a simple set of colored blocks below which would be the variant options.  I did find a 5 year old forum post, but not sure this is still relevant or would work with the latest HikaShop:  Would it be possible for you to supply some sample code and the overrides required?  How do i request this as a feture to be included in future HikaShop relelases?  Thanks Lee")*

Hi,

Thanks for sharing your solution.

Note that you don't need to set the table prefix. You can use #__ and joomla will replace it for you.
Also, I think it's good to have the product_quantity check but instead of &gt;0 it's better to use !=0 so that it will match for unlimited and for a stock.

So here is the modified code: Code:

&lt;!-- product characteristics values --&gt; &lt;span class="listing-char listing-show-characteristics"&gt; &lt;?php $database = JFactory::getDBO(); $query="SELECT group_concat(product_id) AS product_ids FROM #__hikashop_product WHERE (product_parent_id=".$this-&gt;row-&gt;product_id.") AND product_published &gt; 0 AND product_quantity != 0"; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadColumn(); if(!empty($parent_product_ids) &amp;&amp; count($parent_product_ids)) { $query = 'SELECT * FROM #__hikashop_variant AS v LEFT JOIN #__hikashop_characteristic AS c ON v.variant_characteristic_id=c.characteristic_id WHERE characteristic_parent_id=ZZZ AND variant_product_id IN ('.implode(',',$parent_product_ids).') GROUP BY characteristic_id ORDER BY c.characteristic_ordering ASC'; $database-&gt;setQuery($query); $rows = $database-&gt;loadObjectList(); foreach($rows as $row){ echo $row-&gt;characteristic_value." "; } } ?&gt; &lt;/span&gt; &lt;!-- end --&gt;

So you just have to replace ZZZ by the id of the characteristic you want to use to get its available values for each product on the listing.

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

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

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

[](#top)
