Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Changing default search to All Words

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 08-15-2016, 12:41 AM
 
john.hodson@iinet.net.au john.hodson@iinet.net.au is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 68
 

Default Website crashed while changing default search to All Words

Hi there,

Our website crashed while we were trying to change the default search parameter from 'any words' to 'all words' following this thread and the tutorials on that topic:

https://forum.x-cart.com/showthread.php?t=74262


http://devs.x-cart.com/en/getting_st...st_module.html
http://devs.x-cart.com/en/customizat... l_words.html

We created "<YOUR-DEVELOPER-ID>/<YOUR-MODULE-ID>" directory inside the "<Our website>\XLite\Module" directory. We then created Main.php as per the instruction in the first tutorial. We then created "SimpleForm.php" as per the second tutorial. We then redeployed the store through Cache Management in the Admin section. Unfortunately it got to step 6 and then it said "Fatal Error". We then accidentally closed that tab and now our website has crashed and we cannot even access our Admin.php.

Please, what can we do now?

Thank you.

John
__________________
John
XCart Business v.5.4.1.48
Reply With Quote
  #2  
Old 08-15-2016, 03:02 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

As far as I know, the issue has been fixed.

When such problem happens again, just rebuild cache in your X-Cart store manually, as follows:

1) Close all your web-site's pages (if any is opened in your browser).

2) Remove var/run folder and var/.rebuildStarted file in your X-Cart installation.

3) Open the X-Cart admin page in your browser, in order to initiate the cache re-generation process( for example: http://www.sportingoutbacksupplies.com.au/admin.php).
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #3  
Old 08-15-2016, 03:08 AM
 
john.hodson@iinet.net.au john.hodson@iinet.net.au is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 68
 

Default Re: Changing default search to All Words

Hi Seyfin,

Thank you very much. Yes, thank goodness, the X-Cart support group engineer fixed the problem for us and the website is now up and running again. Phew!

Do you know why in the process of changing the default search parameter from 'any words' to 'all words' by following the below thread and the tutorials on that topic, and then redeploying the store caused a "Fatal Error" to our website?

https://forum.x-cart.com/showthread.php?t=74262
http://devs.x-cart.com/en/getting_st...st_module.html
http://devs.x-cart.com/en/customizat... l_words.html

Does it have anything to do with the fact that we are using PHP5.5, instead of 5.3?

Thank you.
John
__________________
John
XCart Business v.5.4.1.48
Reply With Quote
  #4  
Old 08-15-2016, 05:29 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

Actually, if you follow the tutorials carefully, the new custom module should not cause any errors. Can you pack the custom module you created and upload it to the File Area >> My Files section in your personal Helpdesk? I will look at the code of the custom module.
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #5  
Old 08-15-2016, 06:51 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

I am attaching a sample custom module, both for 5.2 and 5.3 versions. This custom module changes the default behavior so the search is performed by "all words" instead of "any word". You can install it in your X-Cart store.
Attached Files
File Type: tar XCartDevs-ChangeSearchDefaults-v5_2_0.tar (5.5 KB, 166 views)
File Type: tar XCartDevs-ChangeSearchDefaults-v5_3_0.tar (18.0 KB, 167 views)
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #6  
Old 08-16-2016, 12:35 AM
 
john.hodson@iinet.net.au john.hodson@iinet.net.au is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 68
 

Default Re: Changing default search to All Words

Hi Sergey,

Thank you for your emails. Please excuse my ignorance. I just want to clarify a few more things so that I don't screw up again (once bitten, twice shy)!

Firstly, our version is X-Cart Business 5.2.16 so we should use the attached sample custom module for 5.2 version, is that right?

Secondly, I would like to clarify where to put the files "Main.php" and "SimpleForm.php". Currently, I already have an existing directory "sportingoutbacksupplies.com/classes/XLite/Module/", should I then just create new directories "XCartDevs/ChangeSearchDefaults" inside the above existing directory, and then put in the file "Main.php".
Similarly, should I then create new directories "/view/Form/Product/Search/Customer" inside the newly-created directories above, and then put in the file "SimpleForm.php"?

Thirdly, yesterday just before the website crash on redeploying the store, when I copied the texts as per the tutorials for "Main.php" and "SimpleForm.php", all the backslashes disappeared after I saved the respective files. I then had to type in double backslashes so that when I saved the files, one backslashes remained. Do you know whether it's because my website is using an incompatible PHP version (I'm using PHP5.5)?

Thank you again.

Cheers,
John
__________________
John
XCart Business v.5.4.1.48
Reply With Quote
  #7  
Old 08-16-2016, 02:01 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

1) You should install the attached sample custom module for 5.2 version.

Just install the module using the "Upload add-on" button, and you do not need to create any files manually.

2) If you upload/create the module's files manually, the you should create the following directories:

classes/XLite/Module/XCartDevs/ChangeSearchDefaults
classes/XLite/Module/XCartDevs/ChangeSearchDefaults/View/Form/Product/Search/Customer

And put the "Main.php" and "SimpleForm.php" files into respective directories.

3) As for the 3rd question: how did you edit and save the respective files, what file editor did you use?
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #8  
Old 08-16-2016, 02:07 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

Please note, the name of the directories is important, so when creating the directories use the same names with upper-case characters as shown below:

classes/XLite/Module/XCartDevs/ChangeSearchDefaults
classes/XLite/Module/XCartDevs/ChangeSearchDefaults/View/Form/Product/Search/Customer
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #9  
Old 08-16-2016, 02:46 AM
 
john.hodson@iinet.net.au john.hodson@iinet.net.au is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 68
 

Default Re: Changing default search to All Words

Hi Sergey,

It works!! Your "Upload add-on" of the sample module you gave works perfectly! Thank you very much!

As for the question of what file editor we used that removed the backslashes, to be honest, we are not sure! We saw the terms "Unix LF" and "Text Editor" when we created a new Main.php and SimpleForm.php files. Does that make sense?

Thanks again,
John
__________________
John
XCart Business v.5.4.1.48
Reply With Quote
  #10  
Old 08-16-2016, 06:40 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Changing default search to All Words

The disappearing backslashes issue might be related to the built-in Text Editor that you use within your web-site Control Panel to edit files. I would not recommend you to use that to edit X-Cart files. Instead, I would recommend you to use FTP and FileZilla to edit files on your web-site.
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote

The following user thanks seyfin for this useful post:
john.hodson@iinet.net.au (08-16-2016)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:40 PM.

   

 
X-Cart forums © 2001-2020