X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Changing default search to All Words (https://forum.x-cart.com/showthread.php?t=74315)

john.hodson@iinet.net.au 08-15-2016 12:41 AM

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

seyfin 08-15-2016 03:02 AM

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).

john.hodson@iinet.net.au 08-15-2016 03:08 AM

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

seyfin 08-15-2016 05:29 AM

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.

seyfin 08-15-2016 06:51 AM

Re: Changing default search to All Words
 
2 Attachment(s)
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.

john.hodson@iinet.net.au 08-16-2016 12:35 AM

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

seyfin 08-16-2016 02:01 AM

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?

seyfin 08-16-2016 02:07 AM

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

john.hodson@iinet.net.au 08-16-2016 02:46 AM

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

seyfin 08-16-2016 06:40 AM

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.


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.