Solved

Cannot complete shipping method in opencart

Posted on 2013-06-12
4
1,451 Views
Last Modified: 2013-07-08
I am getting an opencart error which wont allow me to complete shipping.

Notice: Undefined index: shipping in /home/mitch/public_html/shop/catalog/controller/checkout/shipping_method.php on line 11

If I got to the code I see this:
if ($this->customer->isLogged() && isset($this->session->data['shipping_address_id'])) {                              
                  $shipping_address = $this->model_account_address->getAddress($this->session->data['shipping_address_id']);            
            } elseif (isset($this->session->data['guest'])) {
                  $shipping_address = $this->session->data['guest']['shipping'];
            }

If I remove ['shipping'] I have
$shipping_address = $this->session->data['guest'];

This at least shows me an option for flat rate shipping, but then the new error messages say

2013-06-12 18:13:21 - PHP Notice:  Undefined index:  country_id in .../shop/catalog/model/shipping/flat.php on line 6

2013-06-12 18:13:21 - PHP Notice:  Undefined index:  zone_id in .../shop/catalog/model/shipping/flat.php on line 6

2013-06-12 18:15:39 - PHP Notice:  Undefined index:  shipping in .../shop/catalog/controller/checkout/shipping_method.php on line 104

2013-06-12 18:18:28 - PHP Notice:  Undefined index:  country_id in .../shop/catalog/model/shipping/flat.php on line 6

2013-06-12 18:18:28 - PHP Notice:  Undefined index:  zone_id in .../shop/catalog/model/shipping/flat.php on line 6

2013-06-12 18:19:07 - PHP Notice:  Undefined index:  shipping in .../shop/catalog/controller/checkout/shipping_method.php on line 11

Any advice would be great. I would prefer to know how to fix this and why it occurred, as opposed to just a quick answer.
0
Comment
Question by:mSprout
  • 3
4 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39242780
A PHP Notice about undefined variables or indexes is not an error -- the script keeps on running after making some assumptions about the "default" value for the missing information.  The standard installation of PHP suppresses Notice messages, allowing the missing information to silently assume some value.  So you have some sleuthing to do.

First, you can try suppressing the Notices.  Start with error_reporting(E_ALL ^ E_NOTICE) and see if that helps.  Next you can try looking at the scripts at the mentioned line numbers and tracing the properties back to their point of origin.  How are they supposed to get set?

You might also try posting the question here:
http://forum.opencart.com/
0
 

Author Comment

by:mSprout
ID: 39282395
Gary found more issues due to a captcha module, currently trying to reinstall site and omit plugin, then migrate the database.
0
 

Accepted Solution

by:
mSprout earned 0 total points
ID: 39299234
Just reinstalled everything, compared theme to new install, found issues.
0
 

Author Closing Comment

by:mSprout
ID: 39306648
This was the best method after all.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now