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

#   How could I show name of variants in the category?

##

- **[progreccor](/forum/user/4816-progreccor "View progreccor's Profile")**
- [![progreccor's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4816.jpg)](/forum/user/4816-progreccor "View progreccor's Profile") Topic Author
- [ Offline](/forum/user/4816-progreccor "Москва")
- SEO, webdesign

Less More

- Posts: 2293
- Thank you received: 315
-
-
-
- [](http://www.d-dd.ru)
-

10 years 1 month ago [\#251106](#251106) by [progreccor](/forum/user/4816-progreccor "View progreccor's Profile")  *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251106 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")* was created by *[progreccor](/forum/user/4816-progreccor "View progreccor's Profile")*

-- url of the page with the problem -- : par-store.ru
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6

I have products with variants.
All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?

[ ![2016-09-29&#95;23-50-30.png](/forum/attachment/33717) ](/forum/attachment/33717 "...9&#95;23-50-30.png")

---

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

- [ ![2016-09-29&#95;23-50-30.png](/forum/attachment/33717) ](/forum/attachment/33717 "...9&#95;23-50-30.png") [ ](/forum/attachment/33717?download=1 "...9&#95;23-50-30.png")

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

10 years 1 month ago [\#251128](#251128) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251128 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

The variants are not loaded there.
You would have to edit the file "listing_img_title" of the view "product" via the menu Display&gt;Views and add:
- a MySQL query on the hikashop_product with a condition on product_parent_id = $this-&gt;row-&gt;product_id
- display the product_name of the results of that MySQL query.

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

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 1 month ago [\#251152](#251152) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251152 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

What about characteristics? Is it possible to do same? To load one of the characteristics like Sizes as example...

Thank you

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

- **[progreccor](/forum/user/4816-progreccor "View progreccor's Profile")**
- [![progreccor's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4816.jpg)](/forum/user/4816-progreccor "View progreccor's Profile") Topic Author
- [ Offline](/forum/user/4816-progreccor "Москва")
- SEO, webdesign

Less More

- Posts: 2293
- Thank you received: 315
-
-
-
- [](http://www.d-dd.ru)
-

10 years 1 month ago [\#251180](#251180) by [progreccor](/forum/user/4816-progreccor "View progreccor's Profile")  Replied by *[progreccor](/forum/user/4816-progreccor "View progreccor's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251180 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

charachteristics is used to create variants of products, so this is the same thing

---

Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

10 years 1 month ago [\#251153](#251153) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251153 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

Then I would ask what do you want to do with the characteristics ?
Do you want to display a list of all the possible values ?
Or a list of the values of the product ?
Or you actually want the dropdown to be connected with the add to cart button ?
If it's the first, it's fairly easy to do with a bit of customization. If it's the second, it's still fairly easy but will require a bit more work.
And if it's the later, it's quite complex to do and will require some strong PHP skills.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 1 month ago -  10 years 1 month ago [\#251208](#251208) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251208 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

We have clothes shop and we use color and sizes as characteristics. I would like to show possible sizes of the product in category listing. So buyer wouldn't need to go into product page to see if product has size he needs. This is what I am looking to have. If you could give me some quick code I could use I would customize it for my needs.

Thank you Nicolas.

Last edit: 10 years 1 month ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

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

10 years 4 weeks ago [\#251259](#251259) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251259 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

You'll have to run a MySQL query ( [ docs.joomla.org/Selecting\_data\_using\_JDatabase](https://docs.joomla.org/Selecting_data_using_JDatabase) ) on the tables hikashop_variant hikashop_product and hikashop_characteristic with the corresponding joins to load the possible values of each product. You can do that in the "listing_img_title" view file for each product.
Once you load the necessary data based on the $this-&gt;row-&gt;product_id, all that's left is displaying the characteristic_value of each row of your results array.
If you know a bit about PHP development and know MySQL, it shouldn't be a problem to do all that.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 4 weeks ago [\#251343](#251343) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251343 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

Well after few hours of reading and trying I couldn't do it. If only php would be needed then I could handle it. Even sql would be fine but as it require to join 3 tables this is something I cant do as for now...
I also have tried to search forum but it looks like there is no one who tried to add it like I want....
So if someone could give me that my sql join code then I would be very thankful, otherwise I will have to leave it or to find someone who will do it for me.

Thanks

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

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 654
-
-

10 years 4 weeks ago -  10 years 4 weeks ago [\#251350](#251350) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251350 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hello,

I'm not sure of understand what you mean but for your **3 tables**,( without knowing your characteristics ) don't you have to create another table in order to rank value in simplified array ?
Because, so far I don't think you have **php function** to melt **3** array in one...
It's not a question of knowledge but of method, your algorithm must **select** your required values and includ it in a new array, like for example with your clothes size, the most little to the most tall and put it in a key like **Product\_available\_size** etc for all characteristics.

I can't really tell you more about this.

Hope you will be able to get what you looking for.

Regards

Last edit: 10 years 4 weeks ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 4 weeks ago -  10 years 4 weeks ago [\#251357](#251357) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251357 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

So with @kishoreweblabs help I have what I want. Looking into query I see what I was doing wrong...Thanks everyone for guiding and help.

p.s. new hikashop looks better ![:)](/media/kunena/emoticons/8.png ":)")

Last edit: 10 years 4 weeks ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 4 weeks ago [\#251465](#251465) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251465 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

This is the code i use and it works fine however i have 2 more small issues and i need help to resolve it as better as possible.
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 &#96;ozi8g_hikashop_product&#96; WHERE (&#96;product_id&#96; = ".$this-&gt;row-&gt;product_id ." OR product_parent_id=".$this-&gt;row-&gt;product_id.") and product_quantity&gt;0 "; $database-&gt;setQuery($query); $parent_product_ids=$database-&gt;loadResult(); $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=21 and variant_product_id in ('.$parent_product_ids.') group by characteristic_id ORDER BY &#96;c&#96;.&#96;characteristic_ordering&#96; 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;

1. As you can see if quantity is 0 size characteristic will be hidden. How can i add another check so if it is unpublished it would be hidden too? I have tried to add something like "and product_published&gt;0" but it doesnt work...

2. There is some clothes categories like pantyhose which has sizes 2, 3, 4 so i had to create different characteristic for it and ofcouse it has different ID. Should i create same query with that ID and exclude it based on category or this somehow can be connected in one?

Thanks

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

10 years 3 weeks ago [\#251466](#251466) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251466 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

1. The and product_published&gt;0 should do the job as far as I can see.

2. If you only have one characteristic on each product, then you can remove the piece characteristic_parent_id=21 and and it will work regardless of the characteristic used in each product. Otherwise, yes, you need to change the id in the query based on the product/category.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 3 weeks ago [\#251543](#251543) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251543 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

1. Yes, it works. I was adding to different view file...my bad...

2. I have 2 characteristics which are size and color for clothes like dress, shirts.... and 1 characteristic which is size for clothes like pantyhose.
So I understand I should create another query. Wouldn't to many queries slow down page or something?
How can I restrict query based on product category? I see problem like this. If product A is in category B but as new product he also is in category C so for few months he is in 2 categories. If I restrict to category B then in C it will not work. I hope I was clear enough with my question....

3. I see another issue with my query. If variant is default and has quantity 0 it still visible, and code "and product_quantity&gt;0" does not do the job...How could I fix it?

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

10 years 3 weeks ago [\#251546](#251546) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251546 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

Hi,

2. Well, the more queries you have the slower it gets, that's for sure. But it might not be perceptible. If it changes from 1.20 sec to 1.22 sec, it won't matter. So I would recommend to have a go at it and see if it really gets slower.
You can add a PHP check like that:
if($this-&gt;element-&gt;category_id ==XXX){
// do the queries for the category with the id XXX
}

3. You probably want to replace:
(&#96;product_id&#96; = ".$this-&gt;row-&gt;product_id ." OR product_parent_id=".$this-&gt;row-&gt;product_id.")
by:
(product_parent_id=".$this-&gt;row-&gt;product_id.")
so that you don't get the main product entries.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 3 weeks ago -  10 years 3 weeks ago [\#251646](#251646) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How could I show name of variants in the category?](/forum/4-how-to/886656-how-could-i-show-name-of-variants-in-the-category#251646 "-- url of the page with the problem -- : par-store.ru -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  I have products with variants. All works fine but I curtious about one thing - how could I show the names of variants of product in the category view?")*

All works.

Thanks

Last edit: 10 years 3 weeks ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

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

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

[](#top)
