Page 1 of 1

how to limit the product description ?

Posted: Fri Jun 05, 2020 3:10 pm
by johans
Hi,

It is been a while and now i get back to development.
I need a guide how to limit the character in the products; to look good.
Example:
Product description: HELLO WORLD OPEN CART
I need like this view: HELLO WOR......

How to adjust like that kind of view to have a good view; because right now is not look good. Is there any plug in on this?

Image

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 3:34 pm
by OSWorX
First of all, what you have marked in the image is not the description, it is the title.
Second, displaying something like "HELLO WOR......" is good?
I would say "HELLO WORD .." looks better - my opinion.
Third, you call yourself a "developer" and now you are asking for such a simple task?

p.s: beeing a "developer" and "Webdesigner" and "promoting" a http website is not the best reputation.
The more this website does not exist!

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 4:17 pm
by johans
Sorry, I have not update my signature since 2011. Now is updated. I am not promoting for your information. I was using a different platform before. now that my client request an open cart so i go back here posting in the forum.

My questions is serious and i did not get proper answer.. I know it is a basic questions but i a like new here since 2011 i just get back so 9 years that i have not been working on this.. i need to catch up more time.

but if you give me a proper answer that will help.

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 4:42 pm
by OSWorX
johans wrote:
Fri Jun 05, 2020 4:17 pm
.. now that my client request an open cart ..
Means a "custom and paid" job?
Better you post a request in the commercial section of this forum for such tasks: viewforum.php?f=88
because asking for help for free and getting paid is really not the "fine art".

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 4:46 pm
by johans
wow! Things have changed a lot since 2011..
Now is more on commercial.
Before; i use to post in a forum to get support in the community.
You mentioned on your previous post is a basic question but you point me in wrong direction.

If it is just a simple question; you consider as a guru knows i supposed.

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 6:15 pm
by OSWorX
johans wrote:
Fri Jun 05, 2020 4:46 pm
wow! Things have changed a lot since 2011..
Now is more on commercial.
Time is changing some ..
johans wrote:
Fri Jun 05, 2020 4:46 pm
Before; i use to post in a forum to get support in the community.
You mentioned on your previous post is a basic question but you point me in wrong direction.

If it is just a simple question; you consider as a guru knows i supposed.
Maybe one of the Community will help you for free.
But as it seems, you are not understanding the point:
1. you have client
2. you get paid for this (from this client)
3. from this Forum (and his Members) you want a solution for free

Wrong approach.

Re: how to limit the product description ?

Posted: Fri Jun 05, 2020 6:20 pm
by johans
I am looking for idea on how to get this done. I am not looking for paid solution. For whatever purpose i will use this; this is none of other business anymore.

If you think this is just a simple and "basic" as you say; it is not helpful if you ask a question with a question.

Re: how to limit the product description ?

Posted: Thu Oct 15, 2020 12:03 pm
by mikahawkins
Hello,
You can go with the following:
Instead of editing files directly within the plugin (which is a very bad idea because once update the plugin and all of your changes will be lost!)

add_filter('woocommerce_short_description', 'limit_woocommerce_short_description', 10, 1);
function limit_woocommerce_short_description($post_excerpt){
if (!is_product()) {
$post_excerpt = substr($post_excerpt, 0, 20);
}
return $post_excerpt;
}

Regards,
Mika Hawkins

[SOLVED]Re: how to limit the product description ?

Posted: Thu Oct 15, 2020 12:18 pm
by johans
This topic was June bit old...but thanks for the response but this was solved already using this plug in:

https://www.opencart.com/index.php?rout ... n_id=39430