Solved

Cannot complete shipping method in opencart

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
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.

696 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