Solved

Cannot complete shipping method in opencart

Posted on 2013-06-12
4
1,530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 110

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

749 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