Zen Cart Logo
Forums / General Questions / When Add to cart 500 Error

When Add to cart 500 Error

Views: 1,701

Results 1 to 20 of 20
16 Mar 2013, 5:30 AM
#1
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

When Add to cart 500 Error

Hi, every one
I have one problem on our website. When customer click on add to cart got a error page like follow pictureAttachment 12174
Then I check Log file show me

[16-Mar-2013 01:17:43] PHP Fatal error: Call to undefined function zen_create_random_value() in /hsphere/local/home/c240915/diytoolsca.com/includes/classes/shopping_cart.php on line 1295

Please help me out here.
Thanks

16 Mar 2013, 7:02 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

diytools:

PHP Fatal error: Call to undefined function zen_create_random_value() in /hsphere/local/home/c240915/diytoolsca.com/includes/classes/shopping_cart.php on line 1295
Sounds like your /includes/functions/ files have been mixed up. You probably are using a mix of v1.3.x and v1.5.x files, but since some of those files were changed and some contents rearranged between ZC versions your symptoms indicate that you're either using incompatible plugins that made changes to those files or you failed to fully upgrade them all.

Put back the originals in your /includes/functions/ folder and then manually (yes, by hand) re-merge into them whatever changes are needed for your customizations and/or addons.

16 Mar 2013, 1:56 PM
#3
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

I am new built 1.5.0 version, should no any 1.3.x file there. only one thing when I know error happened I only change one php file it is 1.5.1 version about shipping, it is "shopping_cart.php", after no change only error line # from 1305 to 1295. I don't know what's going on. This I first time met this on my self website.

16 Mar 2013, 2:43 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

As I said, in v1.5.1 there were changes made to /includes/functions/password_funcs.php and /includes/functions/functions_general.php. Evidently you're using outdated versions of those files.

16 Mar 2013, 8:24 PM
#5
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

Please tell what can I do can get out here. as you said even I go back to 1.5.0 still not working. The problem was lose some thing on customer click on add to cart batten.

16 Mar 2013, 8:59 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

I already told you to replace the /includes/functions/password_funcs.php and /includes/functions/functions_general.php files with the originals.

17 Mar 2013, 2:58 AM
#7
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

your means is take 1.5.0 version file or other?

17 Mar 2013, 7:10 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

You said your site is 1.5.1, so you should be using the v1.5.1 files.
It's simple: DON'T MIX FILES BETWEEN VERSIONS. Don't use v1.5.0 files on v1.5.1. Don't use v1.5.1 files on v1.5.0.

17 Mar 2013, 5:29 PM
#9
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

l only change one file from 1.5.1. It is shopping_cart.PHP from new download 1.5.1 file. Other all 1.5.0 file. I changed it because I think maybe can work. even all 1.5.0 version file the problem still there. It is not happened by I mix file. Just the error happened I try to fix it only copy one file from 1.5.1. So like this error customer can't order online how get it out?

17 Mar 2013, 6:24 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

diytools:

how get it out?
Simple: undo whatever you did that broke it.

I'm having a VERY hard time understanding most of your posts. I'm not sure if it's a translation thing or not, but it's hard to piece together the logic in your posts.

If you changed a file and then your cart broke, remove the change.

17 Mar 2013, 11:04 PM
#11
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

Before I change already broken.
Just I need to fix it try to change one file. but it is not working.
It is not the error after change. It is before I change file customer found that error as above screen print.
I don't know why and search all place didn't find any one similar.
people see error page only error line # if 1.5.0 was 1305, not right now you see it 1295. Also if reload the page every thing OK? Can go through any way.
So, some bug there cord or some thing wrong there.
Thanks for you help.
I try to update to 1.5.1 all version maybe OK?
You think I need update it or not? Or you can tell best way I can do?

18 Mar 2013, 1:41 PM
#13
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

The error as follow with no file change ( I change it back 1.5.0 version):
Server error
The website encountered an error while retrieving http://diytoolsca.com/index.php?main_page=product_info&cPath=9_214&products_id=424&action=add_product. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

18 Mar 2013, 4:25 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

diytools:

HTTP Error 500 (Internal Server Error)
Details of the cause of the error will be in your server's errorlog. http://www.zen-cart.com/content.php?105-why-am-i-getting-500-internal-server-error
diytools:

Then I check Log file show me

[16-Mar-2013 01:17:43] PHP Fatal error: Call to undefined function zen_create_random_value() in /hsphere/local/home/c240915/diytoolsca.com/includes/classes/shopping_cart.php on line 1295
Is this error still appearing with today's date?

18 Mar 2013, 6:10 PM
#15
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

Your mean this relation about hosting server some security setting? But if I click on reload can working. Should I contact hosting or just change some file permissions? If so witch file I should change to 777?
Thank you very much about your help.

18 Mar 2013, 8:54 PM
#17
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

[18-Mar-2013 09:59:56] PHP Fatal error: Call to undefined function zen_create_random_value() in /hsphere/local/home/c240915/diytoolsca.com/includes/classes/shopping_cart.php on line 1295
I just got it from my server

18 Mar 2013, 10:09 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: When Add to cart 500 Error

The error message is telling you that the function named zen_create_random_value() is not in the PHP files on your server.
That tells me that the files in your /includes/functions/ folder are NOT CORRECT.
I already told you to replace those files with originals.
Until you do that, you will keep encountering that error.

18 Mar 2013, 10:22 PM
#19
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

thanks I will try after let you know

18 Mar 2013, 10:28 PM
#20
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: When Add to cart 500 Error

Thanks for a lot of.
I copy all file from 1.5.0 "function" folder right now is OK?
Thank you very much.