Solved

Cannot complete shipping method in opencart

Posted on 2013-06-12
4
1,481 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

948 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

21 Experts available now in Live!

Get 1:1 Help Now