Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

shopping_cart.php breaks when an item is added..


evbeej

Recommended Posts

Hello again! 

 

I have recently copied a site over to a new subdomain to allow me to make some changes, i have edited the config files to allow me to work with a different database, and all is working as i'd expect except the shopping_cart.php page. 

 

If I have nothing in the shopping cart the page opens correctly with the normal 'Your Shopping Basket is empty!' however if i add an item and then try and go to the shopping cart it comes up with a server error 500. If i go back to homepage it shows there is an item there, so i know its adding it but something somewhere is breaking. 

 

Anyone have any ideas?? 

 

Thanks 

Link to comment
Share on other sites

Is this on the same server as before? Does the old site still work? If so, it doesn't sound like your hosting service just upgraded PHP in the middle of all this.

 

Did you by any chance edit shopping_cart.php? If so (even if you just accidentally saved it while using the editor to browse it), perhaps you ended up adding a blank/empty line at the beginning or end of the file. That will cause a 500 error. Make sure there are no blank or empty lines before the first <?php or after the last ?>.

 

There are lots of other things that can cause a 500 error, but if you're sure you haven't changed anything else, what I mentioned above are the most likely. Be sure to check the "last modified" timestamps on your files, to see if a hacker has been in there, or you accidentally modified a file during copying or browsing.

Link to comment
Share on other sites

Hello, thank you for your response. 

 

It is on the same server but a different domain, the old site still works perfectly. 

 

I havent edited anything on shopping_cart.php and to double check I have recopied that file over, still nothing. When i look at the site on firefox the page just appears blank, its only on chrome that i get the error come up. 

 

Just not sure why it would work if i havent added anything to the cart but not when there are items in it  :wacko:

Link to comment
Share on other sites

Im sure this is not going to be a good thing but it looks like the .htaccess file just seems to be full of commented out things.. :

 

 

# $Id$

#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
 
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
 
#<IfModule mod_setenvif.c>
#  <IfDefine SSL>
#    SetEnvIf User-Agent ".*MSIE.*" \
#             nokeepalive ssl-unclean-shutdown \
#             downgrade-1.0 force-response-1.0
#  </IfDefine>
#</IfModule>
 
# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
 
# AcceptPathInfo On
 
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
 
# php_value session.use_trans_sid 0
# php_value register_globals 1

 

I have to say i dont really know all that much about the htaccess or server side issues.. any advise? 

 

As I said, this is how it was on the current live site, and there are no issues there? 

 

Thanks,

Link to comment
Share on other sites

In your application_top file you can set it to put an error log in your site folder like this.  Look at the top around line 20 and change error reporting to all and thay might make it easer to see where the problem is.  Under that put the line creating a catalog_errors.log file.  It will show up in your includes folder.  But, I get the feeling you might not have the basics for troubleshooting this.  Perhaps you can post in the commercial help section of the forum and pay for help.

  error_reporting(E_ALL);

  ini_set('error_log', DIR_WS_INCLUDES . 'catalog_errors.log');

I'm not really a dog.

Link to comment
Share on other sites

[18-Nov-2015 16:06:14 Europe/London] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/isenterp/testing/includes/functions/database.php on line 20

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(includes/languages/english/modules/payment/on_account.php): failed to open stream: No such file or directory in /home/isenterp/testing/includes/classes/payment.php on line 41

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(includes/languages/english/modules/payment/on_account.php): failed to open stream: No such file or directory in /home/isenterp/testing/includes/classes/payment.php on line 41

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(): Failed opening 'includes/languages/english/modules/payment/on_account.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/isenterp/testing/includes/classes/payment.php on line 41

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(includes/modules/payment/on_account.php): failed to open stream: No such file or directory in /home/isenterp/testing/includes/classes/payment.php on line 42

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(includes/modules/payment/on_account.php): failed to open stream: No such file or directory in /home/isenterp/testing/includes/classes/payment.php on line 42

[18-Nov-2015 16:06:14 Europe/London] PHP Warning: include(): Failed opening 'includes/modules/payment/on_account.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/isenterp/testing/includes/classes/payment.php on line 42

[18-Nov-2015 16:06:14 Europe/London] PHP Fatal error: Class 'on_account' not found in /home/isenterp/testing/includes/classes/payment.php on line 44

any ideas?

Link to comment
Share on other sites

Yes, read through those lines and you'll see the file "on_account.php" doesn't exist.  If you have that turned on in your admin or installed in the database then that's causing your problems.  Follow the warnings and error lines in the error log when you have a problem and it will indicate where the problem is.  In this case it looks like your missing a payment module.  If this is a module you've added and want to use then you need to put those files in the proper folders.  I would suggest start your testing using the "COD" payment first then move on to other modules later.

I'm not really a dog.

Link to comment
Share on other sites

Thank you John, you have been very patient with me. 

 

I didnt realise those things would stop my shopping cart to appear. 

 

I will start working through those errors then, fingers crossed ill get somewhere! 

 

Wish me luck  :)

Link to comment
Share on other sites

A fatal error will cause the page to fail.  The error log is very helpful and you can find a lot of info on php errors in general with Google.  Stackoverflow has a lot of info. 

I'm not really a dog.

Link to comment
Share on other sites

Well i fixed the problem, the file on_account.php wasn't present on the site i copied. Not sure how it is working for one site and not the other without the file but nevermind. 

 

I found a copy of the needed file and now all works perfectly! 

 

Thank you for your help John, i wouldnt have known where to look without your help! 

Link to comment
Share on other sites

You're welcome Erika.  One other thing I noticed in those errors is the first line about mysql.  Based on that I don't think your testing site is the lates OSC.  Really think about using the 2.3.4 Bootstrap if your upgrading.  That mysql error will be a fatal error in php7.

 

As far as the on_account.php, if you're not using it, turn it off in admin.

I'm not really a dog.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...