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

#   product title too long for cart module

##

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

Less More

- Posts: 19
- Thank you received: 0
-
-

15 years 8 months ago [\#8735](#8735) by [kohypon](/forum/user/882-kohypon "View kohypon's Profile")  *[product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#8735 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")* was created by *[kohypon](/forum/user/882-kohypon "View kohypon's Profile")*

Hi,

I am using variants with pretty long characteristic values. My products are named like "product name + characteristic name".
That is fine in general, also in the checkout process.

But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.

I there a way to display the "name only" of a product in the cart module, but remain the full name in the checkout cart?

Thank you,
kohypon

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#8738](#8738) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#8738 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")*

Hi,

There is no option for that. However, you can go in the menu Display-&gt;Views and edit the file cart of the view product to change the display of the product name.

You could for example replace the code:
echo $row-&gt;product_name;

By:
echo substr($row-&gt;product_name,0,10).'...';

And that will display only the first 10 characters of the name followed by three dots.

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

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

Less More

- Posts: 19
- Thank you received: 0
-
-

15 years 8 months ago [\#8742](#8742) by [kohypon](/forum/user/882-kohypon "View kohypon's Profile")  Replied by *[kohypon](/forum/user/882-kohypon "View kohypon's Profile")* on topic *[Re: product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#8742 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")*

Hi Nicolas,

well that kind of solved it, but not very clean.

Maybe I should generally disable the product name to be added with the characteristic. I think I can remember, that there was a option for disabling the characteristic to be part of the product name. Unfortunately I cant find that option in Hikashop configuration.

Can you give me a hint, where this could be configured?

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#8743](#8743) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#8743 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")*

In the config, under the tab display, you have the option "Append characteristics value to product name"

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

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

Less More

- Posts: 19
- Thank you received: 0
-
-

15 years 8 months ago [\#8744](#8744) by [kohypon](/forum/user/882-kohypon "View kohypon's Profile")  Replied by *[kohypon](/forum/user/882-kohypon "View kohypon's Profile")* on topic *[Re: product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#8744 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")*

Hi,

I found the perfect solution for me. I added this function:

"function first_words($string, $num, $tail='&amp;nbsp;...')
{
/** words into an array **/
$words = str_word_count($string, 2);

/*** get the first $num words ***/
$firstwords = array_slice( $words, 0, $num);

/** return words in a string **/
return implode(' ', $firstwords).$tail;
}
"

and made an echo like "echo first_words( $row-&gt;product_name, 2)"

This takes only the first two words (my product names itself allways contain two words) and kills the characteristics in the string.

Thank you,
kohypon

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

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

Less More

- Posts: 78
- Thank you received: 0
-
-

15 years 8 months ago [\#9677](#9677) by [jasonm](/forum/user/712-jasonm "View jasonm's Profile")  Replied by *[jasonm](/forum/user/712-jasonm "View jasonm's Profile")* on topic *[Re: product title too long for cart module](/forum/4-how-to/8735-product-title-too-long-for-cart-module#9677 "Hi,  I am using variants with pretty long characteristic values. My products are named like &quot;product name + characteristic name&quot;. That is fine in general, also in the checkout process.  But I have displayed a cart module in a sidebar, that has only limited width. Therefore when I add a product to the cart, there is not enough space and e.g. the price is cut. Therefore I would need the cart to display the short product name only without the full characteristic text.  I there a way to display the &quot;name only&quot; of a product in the cart module, but remain the full name in the checkout cart?  Thank you, kohypon")*

Another solution which I used for this was to edit the cart module view (cart file of product view) and change out product_name for product_code, so the cart displays my short code and I also modified the cart file of the checkout view so the checkout displays code &gt; product name &gt; ....everything else.

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

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.075 seconds

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