Post by musicofthehart » Fri Jul 16, 2010 4:04 pm

I am using opencart v1.4.8b

Can anyone tell me how to increase the character limit on reviews? The current cap is at 1000.

I tried to change the code in food\admin\controller\catalog\review.php

I edited the lines
Line 480: if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {

Line 484: if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {

By increasing the "1000" entry, but that didnt work.
I am guessing that I need to change something in the mysql database? Can anyone help me with this step?

Will it break anything if I want to increase it to say... 6 or 7k?

Thanks for any help

New member

Posts

Joined
Fri Jul 16, 2010 3:42 pm

Post by JAY6390 » Fri Jul 16, 2010 7:50 pm

From what I can tell the reviews don't have a limit to them (in the front end anyway)
As for the back end you will need to remove the second one of those as it's a duplicate line that shouldnt be there. It should be

Code: Select all

        if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {
            $this->error['text'] = $this->language->get('error_text');
        } 
On it's own. You will then need to change the 1000 to whatever you want. I think the max a text field will hold is aroud 65535 characters which is well above your limit you want (the field is a TEXT field type and as such doesn't have a length attribute to set constraints on it)

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by musicofthehart » Fri Jul 16, 2010 10:46 pm

Thanks for your help. I followed your instructions and removed the duplicate entry, and changed the "1000" to "17000" but I still receive the error

Error: Review Text must be between 25 and 1000 characters!

I am definitely under "17000" characters.
There has to be a setting or a bit of code somewhere that I am missing. Have any other ideas?

New member

Posts

Joined
Fri Jul 16, 2010 3:42 pm

Post by Qphoria » Fri Jul 16, 2010 11:04 pm

a bit ridiculous to force the admin to have any type of min or max. I'll change to:

Code: Select all

if (strlen(utf8_decode($this->request->post['text'])) < 1) {
            $this->error['text'] = $this->language->get('error_text');
        }
 
in the next version

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by musicofthehart » Fri Jul 16, 2010 11:46 pm

That worked Qphoria. For anyone else that may be looking to do the same thing, I had to change the fields in

\admin\controller\catalog\review.php
AND
\catalog\controller\product\product.php

and replace to the code that Qphoria provided.

Qphoria you are my coding God, and I worship you... a little.

New member

Posts

Joined
Fri Jul 16, 2010 3:42 pm

Post by Qphoria » Fri Jul 16, 2010 11:51 pm

It still be good to leave that check on the catalog side. At least the min check to prevent smacktards from posting reviews like "balls!!!!!".

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SteveSherry » Fri Jul 16, 2010 11:55 pm

Could all of the limits not be set in the admin side, maybe as part of localisation?

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by barnesnet » Fri Oct 08, 2010 5:12 am

Trying to increase the review text limit on 1.4.9.1 but not having any luck. None of the above appears 100% relevant to the newer version.

Any help appreciated

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by fatpora » Wed Apr 06, 2011 12:03 am

This didnt work for me, i keep getting the error and did above. Keeps saying i need between 3 - 64 characters and i type more than 3 all the time, i have tried with symbols, with numbers etc nothing working ....

Newbie

Posts

Joined
Wed Dec 15, 2010 6:46 pm

Post by x2p » Wed Feb 29, 2012 7:35 pm

any can help, didnt work

x2p
New member

Posts

Joined
Sun Feb 12, 2012 9:16 pm

Post by OCMaster597 » Thu Nov 30, 2017 2:58 am

Here's how to do it and it works this way 100%.
-------------------------------------------------------
Find this file:
\admin\controller\catalog\review.php
AND
\catalog\controller\product\product.php
-------------------------------------------------------
In this file once you have it open> review.php
Search for: error_text
Replace the entire line of code in that file with (and save):
if (strlen(utf8_decode($this->request->post['text'])) < 1) {
$this->error['text'] = $this->language->get('error_text');
}

NEXT

In this file once you have it open> product.php
Search again for: error_text
Once you find the 'error-text' part of the code
Change '1000' to '5000' and save

That's it.

Newbie

Posts

Joined
Thu Nov 30, 2017 2:53 am

Post by Burt65 » Thu Nov 30, 2017 11:53 am

OCMaster597 wrote:
Thu Nov 30, 2017 2:58 am
Here's how to do it and it works this way 100%.
-------------------------------------------------------
Find this file:
\admin\controller\catalog\review.php
AND
\catalog\controller\product\product.php
-------------------------------------------------------
In this file once you have it open> review.php
Search for: error_text
Replace the entire line of code in that file with (and save):
if (strlen(utf8_decode($this->request->post['text'])) < 1) {
$this->error['text'] = $this->language->get('error_text');
}

NEXT

In this file once you have it open> product.php
Search again for: error_text
Once you find the 'error-text' part of the code
Change '1000' to '5000' and save

That's it.
In future you may want to check the date of the previous post before reply to it.... :D This question was asked in 2012...

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by OCMaster597 » Wed Feb 07, 2018 8:08 am

Burt65 wrote:
Thu Nov 30, 2017 11:53 am
OCMaster597 wrote:
Thu Nov 30, 2017 2:58 am
Here's how to do it and it works this way 100%.
-------------------------------------------------------
Find this file:
\admin\controller\catalog\review.php
AND
\catalog\controller\product\product.php
-------------------------------------------------------
In this file once you have it open> review.php
Search for: error_text
Replace the entire line of code in that file with (and save):
if (strlen(utf8_decode($this->request->post['text'])) < 1) {
$this->error['text'] = $this->language->get('error_text');
}

NEXT

In this file once you have it open> product.php
Search again for: error_text
Once you find the 'error-text' part of the code
Change '1000' to '5000' and save

That's it.
In future you may want to check the date of the previous post before reply to it.... :D This question was asked in 2012...


The question was unsolved, there are still people looking for this to work and no one stepped up to give a solid answer, so i did. But thanks for your post anyways.

Newbie

Posts

Joined
Thu Nov 30, 2017 2:53 am
Who is online

Users browsing this forum: paradoxx and 32 guests