Page 1 of 1

Undefined index:

Posted: Tue Jul 05, 2016 4:05 pm
by rri
Hello,

Re website: http://www.regentroyalty.com

I am experiencing the following error when I attempt to access the Orders page in the Admin area:
2016-07-05 7:22:49 - PHP Notice: Undefined index: key in /home/rri/public_html/catalog/controller/api/login.php on line 11

I have the following code in the .htaccess file to redirect everything from http to https except for admin:
# For redirecting HTTP to HTTPS, comments are line by line
# below line checks for https flag
RewriteCond %{HTTPS} off
# below line excludes the mentioned URIs from redirection
RewriteCond %{REQUEST_URI} !^/(admin/)
# below line redirects all other URIs except the ones that are mentioned above
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I have attached an image of the error I am receiving as well. If I remove the code from the .htaccess file there are no errors, however, I do wish to have the store redirect customers to the secure https version of the site by default.

Any advice or help would be greatly appreciated!

~rri

Re: Undefined index:

Posted: Tue Jul 05, 2016 7:09 pm
by straightlight

Re: Undefined index:

Posted: Thu Jul 07, 2016 2:39 am
by straightlight
This solution may resolved the issue: http://forum.opencart.com/viewtopic.php?f=2&t=164930 . Although, do not consider to use, yet, as an official stable release at this time.

Re: Undefined index:

Posted: Thu Jul 07, 2016 1:48 pm
by rri
Hi,
I tried the steps with the two solutions you mentioned but unfortunately, they did not resolve the problem.

Thanks again.

~rri

Re: Undefined index:

Posted: Thu Jul 07, 2016 1:54 pm
by rri
I have a question, if remove the redirection code from the .htaccess file the problem does not happen. If I removed the code, will the customer who went to an http link version of the site and adds to cart and goes to check out, be directed to the https link or the non secure one?

Thanks.

Re: Undefined index:

Posted: Thu Jul 07, 2016 8:10 pm
by straightlight
rri wrote:I have a question, if remove the redirection code from the .htaccess file the problem does not happen. If I removed the code, will the customer who went to an http link version of the site and adds to cart and goes to check out, be directed to the https link or the non secure one?

Thanks.
By default, it does not due to possible SSL interaction issues which merchants won't be able to track from the back-end other than viewing the error logs, in this case.

However, if you are willing to take the risk but to protect your customer's sessions while the product is being added to the cart, you can edit your catalog/controller/checkout/cart.php file by

finding:

Code: Select all

$json['redirect'] = str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));
replace with:

Code: Select all

$json['redirect'] = str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id'], true));
This should resolved the partial problem.

Re: Undefined index:

Posted: Mon Jul 11, 2016 4:03 pm
by rri
Thank you so much for the info/advice! I am debating weather or not to not use constant SSL in the .htaccess file.
Does this error effect the customer purchasing on the site? When the error occurs in the orders section on the admin side, will an order still show up after the error?

Thanks again.

Best regards,

~rri

Re: Undefined index:

Posted: Mon Jul 11, 2016 7:02 pm
by straightlight
Two solutions have been posted yesterday regarding this issue:

- http://forum.opencart.com/viewtopic.php?f=24&t=165085
- http://forum.opencart.com/viewtopic.php ... 83#p622978

See if both solutions resolves the issue, also during checkout.

Re: Undefined index:

Posted: Sun Jul 17, 2016 3:13 pm
by rri
A developer I was working with inadvertently resolved the problem for me.

In /system/config/admin.php and catalog.php set:

Code: Select all

$_['site_ssl']          = true;
Best regards,