Smart Search and PHP7
Has anyone tried making the latest unencrypted version of Smart Search to work on PHP7? I just upgraded to PHP7, and found some errors with it.
On the front-end, the ajax predictive search show some errors regarding the use of some deprecated functions, the mysql_ functions and preg_replace. Managed to fix these. On the back-end, opening Tools - Smart Search just show a blank page. |
Re: Smart Search and PHP7
We could help you if you'd like to drop us an email. We would need access to the apache error log file to see what is wrong so we can better quote.
http://www.bcsengineering.com/free_quote/ thanks! Carrie |
Re: Smart Search and PHP7
we can get this fixed for you. Just open a ticket at https://www.cflsystems.com/support/
|
Re: Smart Search and PHP7
I got alterdcart onepage checkout to work with php 7 and xc4.7.7
remove: PHP Code:
from modules/cdseolinks/cdseo_config.php if you have that installed.. if not just add the code below to init.php and move it to /init.php after PHP Code:
and add a mysql_insert_id function so it looks like this PHP Code:
This will bring back the old mysql functions :) then mod /modules/Checkout_One/JSON.php (not sure this is required but I had to do it for hhvm to work). PHP Code:
finally change a template file: /skin/common_files/modules/Checkout_One/checkout_one_payment_methods.tpl line 29: PHP Code:
just comment out the code to make things display:none.. The radio buttons for payment were not available. seems to work.. I did a test order with a bad cc # and it declined it.. Using BSCE's authorize.net's DPM mod.. Still nned to figure out a way to subscribe mail chimp users still.. I'll update this as I work on it. also, there's a few @mysql_query functions in the Checkout_One code you need to change to @db_query find those.. cd modules/Checkout_One grep -r --include="*.php" "@mysql_query" find all instances and change to "@db_query" there's not that many. -Matt |
Re: Smart Search and PHP7
Check this cloud service: https://market.x-cart.com/addons/cloudsearch.html
It provides more functionality than SmartSearch |
Re: Smart Search and PHP7
Thanks for both the offers regarding Smart Search. I managed to fix it. Tools - Smart Search on the backend showed a blank page because it still uses the deprecated mysql_query function. It didn't show the error because there was this error suppresing operator '@' in front of those functions. The fix is just basically replacing all mysql_query function with xcart's db functions.
|
Re: Smart Search and PHP7
Quote:
The drawback I find with Cloud Search is that it couldn't search on custom fields, which I do need. And the pricing. Other than that it seems like good stuff. |
Re: Smart Search and PHP7
Quote:
you can modify modules/Cloud_Search/func.php to make it search custom fields! just mod the query func_query(" SELECT p.product AS name, p.productcode AS sku, p.descr AS description, p.fulldescr AS fullDescription, p.productid AS id, p.keywords AS keywords, then append to description: $products[$k]['description'].=" ".$p['keywords']; --- how bout that?! CS is pretty cheap compared to other search providers such as SLI search. -Matt |
Re: Smart Search and PHP7
Quote:
Thanks! I might look into this again later. |
Re: Smart Search and PHP7
Quote:
Thanks, whis also works when still on php 5.6 but upgrading to X-Cart 4.7.7, I did not have to change mysql_query though for just 4.7.7 on php 5.5. |
Re: Smart Search and PHP7
Quote:
yes, the mysql stuff is removed in php 7 so 5.5, 5.6 will work great.. |
Re: Smart Search and PHP7
tried this on 4.7.8 version (checkout one on php7), made all the modifications, and i get a error when adding to cart and then a blank page.
|
Re: Smart Search and PHP7
Quote:
Did you do the last part? also, there's a few @mysql_query functions in the Checkout_One code you need to change to @db_query find those.. cd modules/Checkout_One grep -r --include="*.php" "@mysql_query" find all instances and change to "@db_query" there's not that many. |
Re: Smart Search and PHP7
yes, I did the grep command and fixed the files it mentioned. Maybe 4.7.8 changed something.
|
Re: Smart Search and PHP7
Quote:
oh yeah,.. not sure.. I'm on 4.7.7 still.. check the XC php and db error logs to see if you find anything when that blank screen issue appears.. The @mysql_query or @db_query thing is elusive and suppresses errors so you may want to remove the @ operator if you don't see anything.. -Matt |
Re: Smart Search and PHP7
I got this in the php error log file..
Code:
[15-Jun-2017 17:53:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function dl() in /home/xxx/public_html/store478up/modules/Checkout_One/checkout_one_ajax.php:2 I don't have php7 ioncube loader installed so that may be the cause. |
Re: Smart Search and PHP7
I reprovisioned my easyapache, added ioncube for php7, now i get this:
Code:
[15-Jun-2017 18:30:08 UTC] PHP Fatal error: The file /home/xxx/public_html/store478up/modules/Checkout_One/checkout_one_ajax.php was encoded by the ionCube Encoder for PHP 5.0 and cannot run under PHP 7.0. |
Re: Smart Search and PHP7
Quote:
send me a PM with your email address and I can send you something that will fix that.. |
Re: Smart Search and PHP7
I replaced all the module files (except skin dir files), and now get this:
Code:
[15-Jun-2017 20:17:51 UTC] PHP Fatal error: Cannot use "self" when no class scope is active in /home/xxx/public_html/store478up/modules/Checkout_One/checkout_one_functions.php on line 793 |
Re: Smart Search and PHP7
is 793 this line:
$dirs[] = array_merge($file, $this->dirstats($filename)); if so go up to the top of the function and set $adv=false; so it doesn't execute the 'this->' statement.. up at 755 is the function declaration Code:
function checkout_listfiles_nr($dir, $dirs_only=false, $adv=false){ let me know if that helps. regards, Matt |
Re: Smart Search and PHP7
yes, my line 793 is: $dirs[] = array_merge($file, self::dirstats($filename));
nope, same results. Code:
[15-Jun-2017 23:22:48 UTC] PHP Fatal error: Cannot use "self" when no class scope is active in /home/xxx/public_html/store478up/modules/Checkout_One/checkout_one_functions.php on line 793 |
Re: Smart Search and PHP7
Quote:
OH I see.. I changed the 'self' to '$this' so use $dirs[] = array_merge($file, $this->dirstats($filename)); instead of $dirs[] = array_merge($file, self::dirstats($filename)); forgot that change. -Matt |
Re: Smart Search and PHP7
thanks, now the add to cart works, but when I go to the checkout page, I get a blank page. looking in logs now.. I'll let you know.
|
Re: Smart Search and PHP7
any new errors in the log files?
|
Re: Smart Search and PHP7
No php errors, but I get shipping error log update:
Code:
[16-Jun-2017 17:53:17] (shop: 16-Jun-2017 10:53:17) SHIPPING warning: |
Re: Smart Search and PHP7
even stranger, I no longer see Checkout One in my module list. It is still running that checkout page fine though.
|
Re: Smart Search and PHP7
I can see the module in the tables fine and its active in the tables, but its no longer showing on the admin side.
|
Re: Smart Search and PHP7
Quote:
did you run checkout_one_sql.php ? that is in the uploads folder of the mod.. it adds the values to the config table in order to show the mod under modules and also lets you change the settings. for the shipping module error.. I don't know about that, I don't use any shipping calculation modules.. they might be incompatible. I hacked my system so the shipping values change per SKU depending on where the item is located.. similar to what amazon does with their shipping templates.. |
Re: Smart Search and PHP7
for the blank page issue.. double check that the @db_query or @mysql_query thing has been fixed.. that took me 4ever to debug..
|
Re: Smart Search and PHP7
It WORKS!! The little grep -r --include="*.php" "@mysql_query" didnt work, i had to manually go through them and found a bunch that didnt update. Thanks!
Any other snafu's I should know about with php7? |
Re: Smart Search and PHP7
Quote:
great news! maybe u had to put a . after.. so the command probably should of been "grep -r --include="*.php" "@mysql_query" ." I think everything else works ok ;) |
Re: Smart Search and PHP7
now my LiveHelp app doesnt work so im back to 5 for now.
|
Re: Smart Search and PHP7
Quote:
can you run the livehelp app on another server? I run Kayako on another server cuz I have an old version of it which is not compatible with php7. there's also ways to run multiple versions of php on a server so that a certain subfolder will run php5 and another folder uses php7.. Nginx makes that easy.. I did not mess with that setup though since apache seems a little more intense to setup.. plus I just used an old webserver for the helpdesk.. I also removed the livechat feature from the site.. it was ok, but people can just call or email. |
Re: Smart Search and PHP7
yeah, i can make a help.xxx.com subdomain and run php5 on that.
|
Re: Smart Search and PHP7
this is an old thread, but where can I find the decrypted version of smart search module? We are now finally trying to upgrade to php7.
Thanks for any help |
Re: Smart Search and PHP7
Quote:
maybe try to contact bill? |
Re: Smart Search and PHP7
Quote:
Sent you a PM! |
Re: Smart Search and PHP7
Thanks for the help. Purchased the source for smart-search and made the recommended changed related to mysql_query.
I see that there are a few preg_replace() calls in smart_search_functions.php. Can someone please help on how what to change here? The search is failing as this is deprecated in php7. thanks for your help. |
Re: Smart Search and PHP7
Quote:
Are you sure that's the calls that are giving you troubles? That one is still in php 7. Are you referring to ereg_replace instead? Thanks, Carrie |
Re: Smart Search and PHP7
Yeah, I am pretty sure that is causing the issue.
The log files says preg_replace(): the /e modifier is deprecated, use preg_replace_callback instead and points to the smart_search_funtions.php |
All times are GMT -8. The time now is 05:44 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.