Post by eduardgr » Wed Jan 24, 2018 1:46 am

HI,

I am a little bit new to open cart, and was just wondering if there is any way I can change the product description character limit. Need to mention that I am running OC 2.3 with customised third party theme. Any help will be very much appreciated!

Also, I have changed the limit from admin from 100 to 9999, however this didn't work

Thanks,
Eddie
Last edited by eduardgr on Wed Jan 24, 2018 2:16 am, edited 1 time in total.

Newbie

Posts

Joined
Tue Jun 13, 2017 10:32 pm

Post by thekrotek » Wed Jan 24, 2018 1:59 am

There's no description limit besides database table restrictions. But you can load and cut description to desired length using mb_subtr() function. Providing you know some PHP, of course.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by IP_CAM » Sat Jan 27, 2018 9:56 am

Well, at least the v.2.3.0.2 product.php and the category.php have a product Description limit
setting build-in, and it is defined, by default at least, in the individual Theme Setting Section, as coded below,
as it looks at least. :D
---
in: catalog/controller/product/category.php + product.php
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
---
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
---
Hardcoded, it would look like this:

Code: Select all

'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
to LIMIT the description content to 100 Characters, and ADD two DOT's to the end.
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 328 guests