?
Solved

Cannot complete shipping method in opencart

Posted on 2013-06-12
4
Medium Priority
?
1,687 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 111

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

839 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