Generic error in shopping cart step 3
Автор: John W.
Просмотрено 3093,
Подписчики 1,
Размещенный 0
I have just encountered a "Generic Error" in the shopping cart process on the website when trying to progress
from Step 3 to Step 4. When selecting the Buy Now button in step three, the screen flashes and will not
go onto step 4. Instead, it just says Generic Error in a pop up. And stays in step 3.
I have re-uploaded the website, using a full upload, not just changes. And I have tried this in both
Internet Explorer and Firefox, so it does not seem to be a browser problem.
Any ideas of what is stopping step 4 from loading?
It did work previously. But that was an earlier version of version 19. I am on 19.2 now.
Размещено
Автор
I just tested in in the X5 built in browser and step 3 did go on to step 4. But in IE and Firefox, it did not.
I also just noticed, I have the cookies message set to display on the bottom of the screen. I did not see this
message in Firefox or IE. And in the X5 browser, it did not display on the page I hit the preview button on.
But it did finally display in step 3 of the cart process in the X5 browser. Isn't this an odd coincidence?
Check out https://helpcenter.websitex5.com/ru/post/217115 and see if the solution from there works.
Автор
Hi Craig,
A lot of what is in that post is way beyond me. I am thinking it is a bug, and the bug is the goto-next step
of the cart. Step 3 does not want to go to step 4. It is live on a shared host, there are no e-mail messages
being sent. The cart will just not go from step 3 onward. So I would imagine some sort of switch got turned
off or erased. Not sure when I first noticed it, but version 19 has had many little patches made to it since 19.0.
Автор
To anyone who can help. Some additional steps I took.
a) I created a new quick several page site.
b) I erased all files and folders in the public_html folder except .htaccess.
c) I uploaded the new tiny site with a couple of product items and a contact form.
d) Results: the same. Step 3 of the cart process will not progress to step 4. Comes up with Generic Error.
e) Further results, contact form stopped working and now asks to open ImEmailForm.php from the server.
Which of course wants to open dreamweaver, which I do not even use. Now it's getting nuts.
Basically, it seems a lot is messed up now. So I am wondering, is there corruption in the program?
One of the uploads I must have done in the last month or so stopped step 3 from going on to step 4, in the cart.
But now a contact form is asking permission to open a php file, that seems way wrong. Users are not going to
want to do that. It will freak them out.
So please, if there is a deep diving tech guy there, please let me know what might be going wrong.
Look for a file called x5engine.php and look for the following function in the file:
private function sendOrderEmail($isOwner, $from, $to, $filters = array())
This will probably be on line 2134 in the file.
the lines following are:
global $imSettings;
global $ImMailer;
$orderData = $filters['order'] ? $this->applyFilter($this->orderData, $filters['order']) : $this->orderData;
$settings = $filters['settings'] ? $this->applyFilter($this->settings, $filters['settings']) : $this->settings;
Change the highlighted lines to:
$orderData = isset($filters['order']) ? $this->applyFilter($this->orderData, $filters['order']) : $this->orderData;
$settings = isset($filters['settings']) ? $this->applyFilter($this->settings, $filters['settings']) : $this->settings;
This solved my "Generic Error" issue.
Craig
Hello John
e) Further results, contact form stopped working and now asks to open ImEmailForm.php from the server.
This seems to be some kind of issue due to the lack of PHP running on your server. Do you have PHP active on your hosting provider? If unsure of this, please try to contact your hosting's support and ask them to check it for you. Keep in mind that you need PHP v5.6 or higher (better if 7.x)
Additionally, post your URL here so that I might test your shop for you. It might help understand the problem better
Thank you
Stefano
Автор
Stefano,
URL is http://www.eclectic-ware.net
It is an ugly site, only meant for testing functions. Not pretty by any means. My main site, the .com version I
just finished writing and had major plans to upload 220+ pages on Nov. 1st. Not sure if that will happen without
the cart and contact forms not potentially working.
Автор
Craig, am I to look for that file on the server or on my PC?
If on the server and I change it, what happens when I do another upload of site updates, would that file change
back to what it was and overwrite my manual changes to it?
Автор
Craig, I did a search for that file on my PC, and it is in approx. 60 different locations. In the back up folders, in
ver. 13 folder, in file history, in users, it is all over the place. Should I be looking for one occurance of it on
the server? And again, when publishing future updates, any worries about over writing it and reverting it backward
again?
Автор
Craig,
I found the file on the server and copied a copy to my PC. I am going to hunt for those lines. No line numbers in
notepad. I do see in the beginning it has: @version WebSite X5 Professional 13.0.0
Since I have version 19.2.6, shouldn't the file have been updated?
Before I ever uploaded anything to that server, I was already on version 17. But I did have version 13 before
upgrading to ver. 16.
Автор
Well, Craig, it did not work. I used the find command in Notepad for
private function sendOrderEmail($isOwner, $from, $to, $filters = array())
There is only one occurance of it in the file. I changed those two lines to contain isset( )
And the results are the same, generic error still occurs.
Next thought? Is the x5engine.php file old? Should I have a newer version of it?
Автор
Craig, x5engine.php file that I altered is attached.
The file looks correct. This corrected my shopping cart mail out issues.
I'm using XAMPP as a localhost to test my website, so I have easy access to the Apache "error.log" file. This is actually how I found the cause of the "Generic Error". Do you have access to your web servers error log file?
I'm using the latest version, I keep it up to date. I am currently using 2019.3.9
I updated the X5engine.php on my PC as well, and when I get a Website X5 update. If I upload to the web it is the updated version that gets sent.
Craig
Hello John,
Please do not modify any of the Incomedia program files. This is not necessary and will only make troubleshooting more difficult.
If you have not already done so please restore the original files to the server: your issue is not related to these files.
Your problem is due to an incorrectly configured PHP installation on the server, like Stefano said.
When building a website with WebSite X5, the Incomedia software is only 50% of the equation. The other 50% lies in the configuration of your server and it is absolutely crucial that everything on the server is configured correctly, otherwise WebSite X5 may appear to be at fault.
I have cast my eye over your other thread (https://helpcenter.websitex5.com/ru/post/218441) and I am going to close it so that we can continue as one on this thread, as your two 'problems' are linked. Having all the relevant information on this thread will make it easier to assist.
I realise that at some point in the recent past you did not experience the current issues; however, there has been a change, server side. This change may have been made inadvertently, or perhaps even without your knowledge, by a server update perhaps. In a way the reason for the change is immaterial. What matters now is rectifying the matter.
In the first instance you need to add a 'handler' to your server configuration so that your server understands how to deal with PHP files. This can be rather technical, and it is something which your webhost should be able to assist you with.
The purpose of the handler is to ensure that when a request is made by a browser to the server, that the PHP code is executed on the server instead of being downloaded as a file to the user.
Once this configuration change has been effected, then we can progress to the next stage.
Are you hosting your website yourself, on your own hardware? In other words, are you the server administrator?
Kind regards,
Paul
Search the WebSite X5 Help Center
Автор
Hi Paul,
Thank you for this. I did save a copy of the file before changing it and I just put the original back. I will copy your
full note and pass it on to my web host provider. I do not host it myself. My web host has handled my main site
for 19 years and does a good job. And I have not even tested my Website X5 file on the main domain yet.
Settings on it could be the same, or not. My main domain is https://www.eclectic-ware.com.I have used http://www.eclectic-ware.netasmypracticesite-WHICHISNOTSECURE.SowhenIgettothemain
site, no clue as if these problems are going to follow me or not. Just highly alarms me that they might.
If customers take all the time to add items to a cart, or fill out a long door quotation form, only for the result to
blow up in their faces, I am going to be making some people not too happy. Including me.
So you think the version change in X5 is not the main culprit, but something on this server not playing nice.
I will ask and see what I can find out.
Thank you.
Автор
Paul,
I sent your note onward. I asked if PHP 7.2 is present. Mentioned the Handler thing. And thought some more.
The two issues very well could be related. When you hit send on the contact form, it wants to open imEmailForm.php.
I have looked at that script, it is populated with the fields and text I created in Website X5 (pretty cool).
When in step 3 of the cart going on to step 4, that is when the program is instructed to send the auto responder
to the customer, and I have the add the collected data checked also. So it is trying to auto respond to the
customer. Both operations do seem to be the same operation.
When I hear back from the host about the server configurations, I will update you.
Thanks John, we will resolve this for you, rest assured.
Just a minor point in the meantime... PHP version 7.2 (which you made reference to) is not mandatory. WebSite X5 will be perfectly happy with any PHP version from 5.6 onwards, including 7.3 - but setting the correct version on the server is only the beginning... there are other aspects of the PHP installation which must be configured correctly after that.
However, once you have a working PHP version of some sort on the server then it becomes progressively easier to troubleshoot other problems.
Paul,
Here is the problem, if "sendOrderEmail" is called without 4th argument, the "$filters['order']" and "$filters['settings']" will fail. Is "sendOrderEmail" called without a 4th Argument?
Yes, both "sendOwnerEmail" and "sendBeforePaymentEmail" calls it with only 3 arguments, so these functions will fail.
I will fix code if it is broken. If Incomedia wants to fix it great, until then, to get my website to work I'll edit the code.
I once found a bug in an inventory program that caused Windows to crash because it used up all of Windows' non-paged memory. I actually went through the program and Windows with a debugger and found the exact cause. I gave company a extremely detailed report of the bug, the cause and even the solution. They took 2 YEARS to fix it. I have no idea when Incomedia will fix this issues, my site uses "sendBeforePaymentEmail" and having my site fail because of a bug I know how to fix is a no brainer, I'll fix it, and wait until Incomedia developers catch-up. Hopefully it won't be 2 years.
Craig
Hello Craig,
Please continue on the thread you opened previously, if necessary:
https://helpcenter.websitex5.com/ru/post/217115
John has a different issue which will require a different approach.
Many thanks!
Автор
Hi Paul,
No update from the host yet. I did try something. I copied the contact form and put it on another page, and
then triggered the send e-mail to the sender off. Tried the form, and the same bad result. So it seems that the
form results it is trying to e-mail me is hanging it up. Which also is the completion of step three in the cart,
results are sent to me in an e-mail.
Sadly there is no shortcut to success here, John.
Certain features in WebSite X5 simply cannot run (at all) without a properly configured PHP installation on the server. At various stages control is passed to PHP scripts which should be executed on the server, and if the required PHP engine is not present or not correctly installed then these scripts will crash/abort/fail with error messages.
The contact form and shopping cart both use PHP to generate the emails sent from WebSite X5:
What are the minimum requirements for the server?
We will assist as much as we possibly can, but unfortunately the PHP handler issue can only be rectified by yourself, your webhost, or a third party with access to your server.
We remain here to help further once the necessary PHP handler has been implemented on your server.
Please keep us updated.
Автор
will do.
Hi Paul,
The gist of my comments is to look to the error logs:
Apache “error.log”:
PHP’s Log “php_error_log”:
Both of these logs pointed to:
With this error in place and uncorrected, I would get message sent to me from the mail server, but the order would NOT move forward to STEP 4.
The order generates an order in the database as well. However, if I started, a new order for the user account, it would use the previous order and add to it as if the order never completed, since it never made it to STEP 4 it didn’t actually complete. Because STEP 4, didn’t complete the order information did NOT get flush, what else is not done due to this failure. This could cause a lot of problems such as the user reordering because they are not sure if the order went through. I would think this would be a priority bug.
The code I used to correct the problem gets me to STEP 4, and the previous order information gets flushed. This may seem like a different problem but many of the issues are very similar, such as the transition from STEP 3 to STEP 4 in the cart. If this does fix John’s issue it is one of the steps to troubleshooting the problem. I have mentioned to check the error logs, they pointed me in the right direction.
In an older version of x5engine.php, “sendOrderEmail” was defined as:
private function sendOrderEmail($isOwner, $from, $to)
but is now defined using:
private function sendOrderEmail($isOwner, $from, $to, $filters = array())
And the fact that $filter is given a default value of “array()” causes a bug to show itself later in the coded of “sendOrderEmail”.
So this is a recent change, so PHP Configuration may not be the issue and rather the issue maybe in the changes made to x5engine.php since the addition of the “$filters = array()” to the parameter list of “sendOrderEmail”.
Craig
Автор
Paul and Craig,
FYI, I am not touching anything, but I did take a peek. In the x5engine.php files that seem to be stored in
separate subdirectories for various versions of the program that I have updated this test site within, one from
March 2019 does NOT have the 4th parameter of $filters = , and the most recent copies from Oct. 2019 do have
it in there. (March was still version 17, currently I am on 19.2.9.)
I am not changing anything, I am just confirming that there is a change in that file from what it was.
And I would suspect that there are other updates on other lines, it is a very long file. Files evolve. And
sometimes files drive us all bananas.
Yes John, that file is revised with virtually every edition of WebSite X5, as new features and updates are added. There is nothing unusual or abnormal about that.
Thank you for your comments, Craig, which I am sure Incomedia will read and act on if they deem it necessary.
However, I am afraid I disagree with you on almost all points. I've no appetite for a firefight here, but as you are persisting I will state my reasons once and then leave it be:
Please understand that I have carefully considered everything you said, and as always we are very grateful for each and every user's input. But this is a public forum, and other users apart from John may well find this thread in the future and look to it for guidance. So I felt it was important to offer a detailed reply to your detailed message.
Anyway, it's late now here. Best wishes to you, Craig.
Автор
Paul,
I logged into the Cpanel and took some screen shots of things that seem related to PHP and Apache Handlers. Here are 3 visuals. I look forward to hearing from you tomorrow if these are of help.
Автор
#2
Автор
#3
Your second screenshot suggests that PHP version 7.2 is installed, which is good.
Your webhost will be able to make the necessary changes on your behalf, John. Once these have been implemented the browser will stop trying to download PHP files, and the code will run on the server instead. At that point we can then address any additional issues which may manifest themselves.
Автор
Hi Paul,
What kind of changes or handler does he need to have installed. Can you give me an idea what I should relay to him?
Hello John,
Section 8 of this article from the official PHP documentation should tell him all he needs to know:
https://www.php.net/manual/en/install.unix.apache2.php
For the avoidance of doubt, that section begins, "Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse .php files as PHP..."
Those instructions are for Apache 2 which you'll most likely be hosted on. But if you're on any other system then we'll need different instructions which I'll fetch for you if you just let me know.
He may also need to set up the MIME type for PHP as per the section entitled 'AddType' in this document:
https://www.tutorialspoint.com/php7/php7_apache_configuration.htm
Автор
Cool. This info has been forwarded to the host provider. I know he will understand it. Fingers crossed.
Автор
Paul,
Getting closer. The host is going to set up my test site from scratch because he seemed to think there were some
files missing in the PHP aspect of the server. When that is ready, I will upload and test. Then I hope he is able to
determine that all is correct on the main site. I will keep you aprised.
Great stuff, thanks for keeping us updated, John.
Автор
Hi Paul,
Better news. My host wiped my practice server clean and set it back up from scratch. I just uploaded the full
test site to it and the cart function worked, and the contact form worked. I received the correct submissions
via e-mail as the merchant. And my e-mail address as the customer received the correct auto-responder e-mails.
So the practice site is functioning as it was back in March. All is good there.
I have asked my host just to double check the PHP setting on my main site server, which is a secure server.
Some settings might be slightly different. If he tells me all is good, then I will plan for this Friday late afternoon
to upload the new site over my old site. I have already tested that on my test site by leaving old pages there.
It just wrote the URLs and wrote over the .htaccess, sitemap.xml, and robots.txt on its own. My old site is in a
directory structure and the X5 site writes a flat structure. So when the time comes to remove old html pages and
graphics, it is easy enough to delete one directory at a time without interfering with any new pages from X5.
All URL's are changing except for index.html.
So I will throw another update your way probably from Saturday onward.
If there is anything else I should be thinking about, please let me know. Yes, I have backed up the site. The old
pages will still be present. If anything fails, I have the option of using my old software to quickly put the old
home page back and continue with the old until the new wants to play nice.
Thanks for your help thus far. Be back to you in a few days.
Автор
Paul,
Here is something for you to clue me in on. The new .htaccess file has only the 404 error page code in it that
X5 obviously just wrote for it. No file was present prior to my upload just now. But the old .htaccess that I backed
up before discovering all this nonsense had this in it:
<Files 403.shtml>
order allow,deny
allow from all
</Files>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^eclectic-ware.net
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
RewriteRule (.*) http://www.eclectic-ware.net/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]
# WebSite X5 - Removed Code - ErrorDocument 404 http://www.eclectic-ware.net/notfound/notfound.html
Redirect 301 /contact/testpage.htm http://www.eclectic-ware.net/the-stuff/the-stuff.html
# WebSite X5 - Start Code [do not edit]
ErrorDocument 404 /not-found.html
# WebSite X5 - End Code
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
There seems to be commands in there about the PHP handler, which are not in the current file on the server
right now. Could that have been causing any issue? AND, should any of this code be put back? Because on my
main site, I know there is a bit of code prior to all of my 301 redirects.
I'm really pleased to hear you've got everything working now, John! Well done, your perseverance has paid off. Hopefully it will all be plain sailing from here on in, but if you encounter further obstacles then we are all here to help.
As regards the .htaccess file... no, I wouldn't put the section you refer to in your new .htaccess file... I mean this section:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Leave that out completely, especially if everything is now working as it should. This entry is clearly no longer required. It may be that there is an .htaccess file further up your directory structure, or your webhost may have chosen an alternative method of configuring PHP.
The best .htaccess file is the most lightweight one.
Автор
Okay, thanks for that. I looked at the .htaccess on my main site. And all code above all my 301 redirect is
extremely short. Basically just the rewrite stuff and the error page code, not much more.
I just ran the site through another test of the cart and all is still good.
May the Force be with me on Friday evening!
Автор
Paul,
I just uploaded the main site. I bounced around on a lot of pages, placed 5 orders myself, tested the contact form,
checked the e-mail results and auto responder results. All is working fine. I just looked at it on a phone also,
and the responsive settings are responding well. Thank you for all your help. I have a ton of typos and
misspellings to sniff out, but that is extremely minor. The architecture is working.
https://www.eclectic-ware.com
The site looks great, John. I can tell that is the result of many hours of hard work. I had a good look around myself and agree that everything seems to be working fine
Incidentally, you have an astonishing amount of positive testimonials, and I was impressed that you ship all over the globe.
Best wishes for the future.
Автор
Thanks, Paul. I actually stopped adding to the testimonials maybe 7 to 8 years ago when social media started
blowing up. Pretty much all those testimonials are from before smart phone days. And now I hope to reboost
my international sales once Google starts smiling upon the site again for it being mobile friendly and having a
better UX. I know I lost a lot of link momentum and the old site looked real crappy on a smart phone.
Marketing can re-commense now. I'll get Alexa happy with me again too. I'm 19 years into this business.
Potentially another 8 to 12 to go before I slow down. Thanks for all your help.