Post by sonnyp » Mon Jul 18, 2011 11:15 pm

Hello All,

this is my first post so be gentle.

I've just installed Opencart, everything seems fine (although I've still only just set it up) apart from the search function..

if i search for any keyword i get this error:

Fatal error: Call to undefined function mb_strtolower() in /home/spdweb/public_html/fever_store/catalog/model/catalog/product.php on line 397

but if i search hit search with nothing in the field it will take me to the search result page.

can anyone help?

Thank you.

Sonny

Newbie

Posts

Joined
Mon Jul 18, 2011 11:10 pm

Post by uksitebuilder » Tue Jul 19, 2011 12:34 am

[If you get this error:]
Fatal error: Call to undefined function: mb_strtolower() in ????.php on line ??

The PHP mbstring extension, which is required to handle international character sets, is not available on your server. Check your PHP configuration and make sure that PHP has been compiled with --enable-mbstring.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by SXGuy » Tue Jul 19, 2011 12:42 am

uksitebuilder wrote:[If you get this error:]
Fatal error: Call to undefined function: mb_strtolower() in ????.php on line ??

The PHP mbstring extension, which is required to handle international character sets, is not available on your server. Check your PHP configuration and make sure that PHP has been compiled with --enable-mbstring.
In short. contact your webhost and ask them if mbstring is enabled.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Daniel » Tue Jul 19, 2011 12:59 am

i'm going to change this now.


use mysql's LCASE instead.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Daniel » Tue Jul 19, 2011 1:06 am

fixed in svn. also re-uploading 1.5.1 with the fixes in.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by i2Paq » Tue Jul 19, 2011 1:15 am

Daniel wrote:fixed in svn. also re-uploading 1.5.1 with the fixes in.
Maybe you should use the SVN version number where this is fixt, I just download the SVN-486 and have no search error.
I see that the SVN is now 487 but I do not know if this is the version where the search is fixt.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Daniel » Tue Jul 19, 2011 1:56 am


OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by rsmck » Tue Jul 19, 2011 7:59 am

I'm still finding search is not working in the latest released 1.5.1 (and SVN r487)

Code: Select all

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,15' at line 1
Error No: 1064
SELECT p.product_id, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (LCASE(pd.name) LIKE LCASE('%your-search-here%') OR p.product_id IN (SELECT pt.product_id FROM product_tag pt WHERE pt.language_id = '1' AND LCASE(pt.tag) LIKE LCASE('%your-search-here%')) GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,15

Newbie

Posts

Joined
Sun Mar 20, 2011 9:01 am

Post by rsmck » Tue Jul 19, 2011 8:19 am

Seems a few errors crept in when changing from mb function to LCASE (was it really a good idea to REPLACE the working version with one from SVN without any change to version numbering - there must be several different 1.5.1 'releases' out there by now.

The following diff applied to model/catalog/product.php will correct the search, I have not tested any of the other files that were changed (yet) in the most recent SVN.

Code: Select all

74c74
<                                       $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR LCASE(pd.description) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%'))";
---
>                                         $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR LCASE(pd.description) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%')))";
76c76
<                                       $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%'))";
---
>                                         $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%')))";
395c395
<                               $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%')) OR LCASE(pd.description) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%'))";
---
>                                 $sql .= " AND (LCASE(pd.name) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%') OR p.product_id IN (SELECT pt.product_id FROM " . DB_PREFIX . "product_tag pt WHERE pt.language_id = '" . (int)$this->config->get('config_language_id') . "' AND LCASE(pt.tag) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%')) OR (LCASE(pd.description) LIKE LCASE('%" . $this->db->escape($data['filter_name']) . "%')))";

Newbie

Posts

Joined
Sun Mar 20, 2011 9:01 am

Post by scott23 » Tue Jul 19, 2011 11:02 am

I'm seeing the same error as you when attempting the search function. And your fix appears to work except for if you choose the search in product descriptions box.

Scott

User avatar
New member

Posts

Joined
Sun Feb 06, 2011 6:08 am

Post by Daniel » Tue Jul 19, 2011 12:53 pm

just fixed it on svn:

http://code.google.com/p/opencart/source/detail?r=489

i have also re-released 1.5.1 as this is a pretty bad bug.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 10 guests