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

#   Category in product display with custom &lt;hr&gt;

##

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 2 weeks ago [\#72274](#72274) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  *[Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#72274 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")* was created by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")*

ok this one is for price if not possible not possible.
what my client wants is that in the web wich has 8 categories, each one has a color code
this color is displayed underlining the category with a &lt;hr&gt; wich has different colors depending on the category.
and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need.
Thank you

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

14 years 2 weeks ago [\#72479](#72479) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#72479 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

I don't understand.
If the hr must be in the description, why not directly add it in the description and add to it a style attribute in order to define the color ?

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 2 weeks ago [\#73175](#73175) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#73175 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

I mean i have in my product view 4 parts top, right, left and bottom.
in top part all the width of the page is covered with the category name wich the product belongs to.
under it there is a custom &lt;hr&gt; with an image.
what i want is that the image changes when category changes.

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

14 years 2 weeks ago [\#73433](#73433) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#73433 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

So I understand that the hr and the image are added by yourself with custom code.
Could you tell us what code you're using for that ?

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 1 week ago [\#73668](#73668) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#73668 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

in the show.php of the product i just added the category php line and under it an &lt;hr class="line"&gt;
what i dont know how to do is that this hr changes depending on the category.

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

14 years 1 week ago [\#73986](#73986) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#73986 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

if you have the category data in a variable called $category, you can do like that:
if($category-&gt;category_name="My category"){
echo '&lt;hr class="line" style="color:red;"&gt;';
}elseif($category-&gt;category_name="My second category"){
echo '&lt;hr class="line" style="color:blue;"&gt;';
}else{
echo '&lt;hr class="line" style="color:black;"&gt;';
}

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 1 week ago [\#74460](#74460) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#74460 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

we are very close, first i should insert the code in the show.php or in other php?
second the color of the hr is a custom image so it should be something like hr class="line1" and the line2 depending on the category.
Thank you very much

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

14 years 1 week ago [\#74890](#74890) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#74890 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

In the show.php yes.

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 6 days ago [\#74982](#74982) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#74982 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

so in the style as it is an image i should put style="background=url("whatever");"

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 4 days ago [\#75590](#75590) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#75590 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

it did not work, i created this in show_default.php and i added the code after the line of category but something is wrong it stops reading in first case
&lt;div id="hikashop_product_top_part" class="hikashop_product_top_part"&gt;
&lt;h2&gt;
&lt;span&gt;
&lt;?php
foreach($this-&gt;categories as $category) echo $category-&gt;category_name;
?&gt;
&lt;/span&gt;&lt;br/&gt;

&lt;/h2&gt;
&lt;?php if($category-&gt;category_name="Linea Esencial"){
echo '&lt;hr class="linea"&gt;';
}elseif($category-&gt;category_name="Linea Equilibrante"){
echo '&lt;hr class="linea2"&gt;';
}elseif($category-&gt;category_name="Linea Multivitaminas"){
echo '&lt;hr class="linea3"&gt;';
}elseif($category-&gt;category_name="Linea Multiefectos"){
echo '&lt;hr class="linea4"&gt;';
}elseif($category-&gt;category_name="Linea de Barros"){
echo '&lt;hr class="linea5"&gt;';
}elseif($category-&gt;category_name="Linea Spa Corporal"){
echo '&lt;hr class="linea6"&gt;';
}elseif($category-&gt;category_name="Manicura &amp; Pedicura"){
echo '&lt;hr class="linea7"&gt;';
}elseif($category-&gt;category_name="Linea Spa Capilar"){
echo '&lt;hr class="linea8"&gt;';
}?&gt;

&lt;/div&gt;
only first i showing in all categories

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

14 years 4 days ago [\#75623](#75623) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#75623 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Your code is wrong.

You want to have something like that:
&lt;div id="hikashop_product_top_part" class="hikashop_product_top_part"&gt;

&lt;?php
foreach($this-&gt;categories as $category){
?&gt;
&lt;h2&gt;
&lt;span&gt;&lt;?php echo $category-&gt;category_name; ?&gt;
&lt;/span&gt;&lt;/h2&gt;&lt;br/&gt;

&lt;?php if($category-&gt;category_name=="Linea Esencial"){
echo '&lt;hr class="linea"&gt;';
}elseif($category-&gt;category_name=="Linea Equilibrante"){
echo '&lt;hr class="linea2"&gt;';
}elseif($category-&gt;category_name=="Linea Multivitaminas"){
echo '&lt;hr class="linea3"&gt;';
}elseif($category-&gt;category_name=="Linea Multiefectos"){
echo '&lt;hr class="linea4"&gt;';
}elseif($category-&gt;category_name="Linea de Barros"){
echo '&lt;hr class="linea5"&gt;';
}elseif($category-&gt;category_name=="Linea Spa Corporal"){
echo '&lt;hr class="linea6"&gt;';
}elseif($category-&gt;category_name="Manicura &amp; Pedicura"){
echo '&lt;hr class="linea7"&gt;';
}elseif($category-&gt;category_name=="Linea Spa Capilar"){
echo '&lt;hr class="linea8"&gt;';
}?&gt;

&lt;/div&gt;

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

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

14 years 3 days ago [\#75732](#75732) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#75732 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

everything ok now thank you

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

13 years 11 months ago [\#77251](#77251) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77251 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

i have another issue with this, i´ve change shor_default.php view to do that and it works in product display, how can i make it to work also in product listing, my default is listing_image_title but i tried it there and it did not work, thanks

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#77271](#77271) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77271 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Hi,

In the product listing view, you do not have the $category variable like in the product show view.
But you can retrieve it. Code:

$category_id = (int)trim($this-&gt;category_selected, '_'); $category = null; if($category_id &gt; 0) { $categoryClass = hikashop_get('class.category'); $category = $categoryClass-&gt;get($category_id); }

And you should have your category object !

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

13 years 11 months ago [\#77544](#77544) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77544 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Jerome but if you go to the webpage
[ miraur.pingraf.es](http://miraur.pingraf.es)
in main page you have categories
if you click on any of those
the title of the category is displayed i product listing without doing anything.
what do i have to cahnge there?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#77604](#77604) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77604 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Hi,

It is displayed because it's not a simple product listing.
It come from a category listing from your menu #102 (with id 102).

Exactly like our demo website.
If you go one the home page, you would see a menu at the bottom left.
You can click on the item "Peripherals" in the "Computing" section.
It points to : [ demo.hikashop.com/index.php?option=com\_h...ls&amp;Itemid=78&amp;lang=en](http://demo.hikashop.com/index.php?option=com_hikashop&ctrl=category&task=listing&cid=24&name=peripherals&Itemid=78&lang=en)
As you can see in the URL, it is a category listing, it display products in this category and at the top of the listing, there is the name of the category.

That is the "category listing".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

13 years 11 months ago [\#77675](#77675) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77675 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

so i should add my variable in category listing right?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#77794](#77794) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#77794 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Hi,

You have to edit the "category / listing" view.
At the beginning of the view, you would find the code which display the name of the category. Code:

if($this-&gt;params-&gt;get($title) &amp;&amp; JRequest::getVar('hikashop_front_end_main',0)){ ?&gt; &lt;&lt;?php echo $titleType; ?&gt;&gt; &lt;?php echo $this-&gt;params-&gt;get('page_title'); ?&gt; &lt;/&lt;?php echo $titleType; ?&gt;&gt; &lt;?php }

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")**
- [![condorazul's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4911.jpg)](/forum/user/4911-condorazul "View condorazul's Profile") Topic Author
- [ Offline](/forum/user/4911-condorazul)

Less More

- Posts: 441
- Thank you received: 24
-
- [](http://www.visual5.es)
-

13 years 11 months ago -  13 years 11 months ago [\#78025](#78025) by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile")  Replied by *[condorazul](/forum/user/4911-condorazul "View condorazul's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#78025 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Jerome i have to add this to generate the hr but i dont know where
&lt;?php if($category-&gt;category_name=="LINEA ESENCIAL MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea"&gt;';
}elseif($category-&gt;category_name=="LINEA EQUILIBRANTE MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea2"&gt;';
}elseif($category-&gt;category_name=="LINEA MULTIVITAMINAS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea3"&gt;';
}elseif($category-&gt;category_name=="LINEA MULTIEFECTOS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea4"&gt;';
}elseif($category-&gt;category_name="LINEA DE BARROS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea5"&gt;';
}elseif($category-&gt;category_name=="LINEA SPA CORPORAL MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea6"&gt;';
}elseif($category-&gt;category_name="MANICURA &amp; PEDICURA MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea7"&gt;';
}elseif($category-&gt;category_name=="LINEA SPA CAPILAR MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea8"&gt;';
}?&gt;

i added it here
f($this-&gt;params-&gt;get($title) &amp;&amp; JRequest::getVar('hikashop_front_end_main',0)){
?&gt;
&lt;&lt;?php echo $titleType; ?&gt;&gt;
&lt;?php echo $this-&gt;params-&gt;get('page_title'); ?&gt;
&lt;/&lt;?php echo $titleType; ?&gt;&gt;
&lt;?php if($category-&gt;category_name=="LINEA ESENCIAL MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea"&gt;';
}elseif($category-&gt;category_name=="LINEA EQUILIBRANTE MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea2"&gt;';
}elseif($category-&gt;category_name=="LINEA MULTIVITAMINAS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea3"&gt;';
}elseif($category-&gt;category_name=="LINEA MULTIEFECTOS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea4"&gt;';
}elseif($category-&gt;category_name="LINEA DE BARROS MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea5"&gt;';
}elseif($category-&gt;category_name=="LINEA SPA CORPORAL MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea6"&gt;';
}elseif($category-&gt;category_name="MANICURA &amp; PEDICURA MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea7"&gt;';
}elseif($category-&gt;category_name=="LINEA SPA CAPILAR MIRAUR Dermocosmetics"){
echo '&lt;hr class="linea8"&gt;';
}?&gt;
&lt;?php
but it always choose line 5 by default and does not display waht i want

Last edit: 13 years 11 months ago by [condorazul](/forum/user/4911-condorazul "View condorazul's Profile").

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

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

Less More

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

13 years 11 months ago [\#78140](#78140) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Category in product display with custom &lt;hr&gt;](/forum/2-general-talk-about-hikashop/72274-category-in-product-display-with-custom-hr#78140 "ok this one is for price if not possible not possible. what my client wants is that in the web wich has 8 categories, each one has a color code this color is displayed underlining the category with a  wich has different colors depending on the category. and this one should be displayed in product description. The second part is solved and i have the category in product description it´s just the underline changing depending on category what i need. Thank you")*

Hi,

Try with "$this-&gt;element-&gt;category_name" instead of "$category-&gt;category_name"

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

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