Post by naz_eg » Thu Sep 27, 2012 12:05 am

Hi guys, i have many errors related success.php in logs:

2012-09-26 18:51:49 - PHP Notice: Undefined index: last_order_id in ****/httpdocs/catalog/controller/checkout/success.php on line 68

This's the line:

$this->data['text_message'] = sprintf($this->language->get('text_guest'), $this->session->data['last_order_id'], $this->url->link('information/contact'));


Also my customers get SSL errors while virtual pos payment after checkout. What can be the problem?

New member

Posts

Joined
Sat May 29, 2010 6:25 pm

Post by sysiz » Fri Oct 19, 2012 2:45 am

Having exactly the same issue.

Newbie

Posts

Joined
Tue Oct 09, 2012 1:48 am

Post by bwana » Sun Oct 28, 2012 12:37 am

So, a month later. Have you guys received any help with this? I'm seeing the same problem.

Newbie

Posts

Joined
Tue Aug 21, 2012 6:28 am

Post by naz_eg » Sun Oct 28, 2012 12:57 am

No help :(

New member

Posts

Joined
Sat May 29, 2010 6:25 pm

Post by pedro1993 » Sun Oct 28, 2012 8:11 am

naz_eg wrote:Hi guys, i have many errors related success.php in logs:

2012-09-26 18:51:49 - PHP Notice: Undefined index: last_order_id in ****/httpdocs/catalog/controller/checkout/success.php on line 68

This's the line:

$this->data['text_message'] = sprintf($this->language->get('text_guest'), $this->session->data['last_order_id'], $this->url->link('information/contact'));


Also my customers get SSL errors while virtual pos payment after checkout. What can be the problem?
Hi there,

You said that you get many errors, is that the only error in that file?

Could you go back to that line in the success.php file and underneath that add:

Code: Select all

print_r($this->session->data);
die();
When you make an order a line of data will appear instead of the success.php page. Can you post that line here. Be sure to remove it afterwards so people can order again.

***UPDATE***

Could you also go to the catalog/controller/confirm.php file and double check this line exists:

Code: Select all

$this->session->data['order_id'] = $this->model_checkout_order->addOrder($data);
Thanks
Peter

For OpenCart & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support


Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by sysiz » Mon Oct 29, 2012 2:22 am

pedro1993 wrote: Hi there,

You said that you get many errors, is that the only error in that file?

Could you go back to that line in the success.php file and underneath that add:

Code: Select all

print_r($this->session->data);
die();
When you make an order a line of data will appear instead of the success.php page. Can you post that line here. Be sure to remove it afterwards so people can order again.

***UPDATE***

Could you also go to the catalog/controller/confirm.php file and double check this line exists:

Code: Select all

$this->session->data['order_id'] = $this->model_checkout_order->addOrder($data);
Thanks
Peter
Hi

Line below exists at least in my case (/controller/checkout/confirm.php):

Code: Select all

$this->session->data['order_id'] = $this->model_checkout_order->addOrder($data);
What I have noticed is that problem comes only from one payment method. Issue does not reproduce with test login of payment method, but for every successfull real transaction it happens, there is error in log (like with first post). Cannot therefore try to print the session info.

Br
Sysiz

Newbie

Posts

Joined
Tue Oct 09, 2012 1:48 am

Post by pedro1993 » Mon Oct 29, 2012 6:30 am

Is is a payment method from OC? Or is it an extension?

For OpenCart & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support


Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by sysiz » Sun Nov 04, 2012 2:04 am

Extension. http://www.opencart.com/index.php?route ... ion_id=726
Same issue seems to be posted to comments of the extension, but no reply from author.

Newbie

Posts

Joined
Tue Oct 09, 2012 1:48 am

Post by Ed_Rolla » Sat Nov 17, 2012 11:40 pm

Having the same problem over here... :-[

There seems to be something about this on this thread: http://forum.opencart.com/viewtopic.php ... hp#p359127

WIP Design Publicidade e Marketing Digital


User avatar
New member

Posts

Joined
Sun Jul 15, 2012 12:16 am
Location - Brazil, Rio de Janeiro

Post by pedro1993 » Wed Nov 21, 2012 5:06 am

Ed_Rolla wrote:Having the same problem over here... :-[
Are you also using this module?:
http://www.opencart.com/index.php?route ... ion_id=726
There seems to be something about this on this thread: http://forum.opencart.com/viewtopic.php ... hp#p359127

For OpenCart & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support


Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by codex73 » Sat Dec 08, 2012 3:11 am

The problem lies because the variable "$this->session->data['last_order_id']" is not been set because it didn't matched the condition for some reason. I'm not going to go into why it didn't but instead give you the solution. This is used to generate the success message where it displays the order number for the client upon checkout.

Open
/catalog/controller/checkout/success.php

Find this:

Code: Select all

if ( isset($this->session->data['order_id']) && ( ! empty($this->session->data['order_id']))  ) {
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Add this right after:

Code: Select all

else{
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Save the file and upload to your server.

Good luck.

New member

Posts

Joined
Wed Oct 28, 2009 1:53 am

Post by i2Paq » Sat Feb 16, 2013 1:03 am

codex73 wrote:The problem lies because the variable "$this->session->data['last_order_id']" is not been set because it didn't matched the condition for some reason. I'm not going to go into why it didn't but instead give you the solution. This is used to generate the success message where it displays the order number for the client upon checkout.

Open
/catalog/controller/checkout/success.php

Find this:

Code: Select all

if ( isset($this->session->data['order_id']) && ( ! empty($this->session->data['order_id']))  ) {
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Add this right after:

Code: Select all

else{
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Save the file and upload to your server.

Good luck.

Can someone confirm that this works?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by i2Paq » Thu Mar 14, 2013 9:46 pm

i2Paq wrote:
codex73 wrote:The problem lies because the variable "$this->session->data['last_order_id']" is not been set because it didn't matched the condition for some reason. I'm not going to go into why it didn't but instead give you the solution. This is used to generate the success message where it displays the order number for the client upon checkout.

Open
/catalog/controller/checkout/success.php

Find this:

Code: Select all

if ( isset($this->session->data['order_id']) && ( ! empty($this->session->data['order_id']))  ) {
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Add this right after:

Code: Select all

else{
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Save the file and upload to your server.

Good luck.

Can someone confirm that this works?
Can someone confirm that this works?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by erinb » Fri Mar 22, 2013 8:06 am

I can confirm it worked for me - v. 1.5.4 - however, I now get a new error:

Notice: Undefined index: order_id in /store/catalog/controller/checkout/success.php on line 10

Newbie

Posts

Joined
Wed Dec 21, 2011 10:59 pm

Post by erinb » Fri Mar 22, 2013 10:51 pm

i2Paq wrote:
codex73 wrote:The problem lies because the variable "$this->session->data['last_order_id']" is not been set because it didn't matched the condition for some reason. I'm not going to go into why it didn't but instead give you the solution. This is used to generate the success message where it displays the order number for the client upon checkout.

Open
/catalog/controller/checkout/success.php

Find this:

Code: Select all

if ( isset($this->session->data['order_id']) && ( ! empty($this->session->data['order_id']))  ) {
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Add this right after:

Code: Select all

else{
			$this->session->data['last_order_id'] = $this->session->data['order_id'];
		}
Save the file and upload to your server.

Good luck.

Can someone confirm that this works?
I have an update - the fix worked for me, v.1.5.4 and my other "new" error resolved itself when I placed a fresh order as a guest. I was refreshing the success page and the problem was because it was not referencing an order number anymore. When a new order was placed as a guest, the success page showed as it should with no errors. Great success!

Thank you for the fix!
Erin

Newbie

Posts

Joined
Wed Dec 21, 2011 10:59 pm

Post by teddy_leopold » Mon Mar 25, 2013 6:47 pm

Hi,
I tried this fix but ended up with a new error.
2013-03-25 10:41:14 - PHP Notice: Undefined index: order_id in /catalog/controller/checkout/success.php on line 9

So i guess you could say it doesn´t work correctly. :(

Newbie

Posts

Joined
Wed Oct 17, 2012 7:53 pm

Post by marlin.nl » Fri Apr 12, 2013 4:17 pm

The problem of:

PHP Notice: Undefined index: last_order_id in /data/catalog/controller/checkout/success.php on line 68

Is because people can direct access checkout/succes.
It has already been requested many times all over the site of Opencart but there are no answers or fix.
Also oc 1.5.5 / 1.5.5.1 still have it.

Also related topic:
http://forum.opencart.com/viewtopic.php ... &start=180

Live store Opencart 2.3.0.2 modified on https://webshopmarlin.nl


New member

Posts

Joined
Thu Aug 25, 2011 11:22 pm

Post by purnachandvenu » Tue Nov 28, 2017 12:00 am

Hello All,

I am getting similor error at line 26, Below is the error log, Can you please advice the fix?

Warning: sprintf(): Too few arguments in /var/www/html/catalog/controller/account/success.php on line 26
-----------
print_r($this->session->data);
die();

After adding above command after line 26,I can see below message, Pl advice the fix. Thanks in advance

Warning: sprintf(): Too few arguments in /var/www/html/catalog/controller/account/success.php on line 26Array ( [language] => en-gb [currency] => INR [user_id] => 1 [user_token] => NhJxHYteL41Q8DFGwzQRkCPscZ1xqO1I [customer_id] => 8 )


Posts

Joined
Wed Nov 08, 2017 2:04 pm

Post by straightlight » Wed Nov 29, 2017 12:12 am

Warning: sprintf(): Too few arguments in /var/www/html/catalog/controller/account/success.php on line 26Array ( [language] => en-gb [currency] => INR [user_id] => 1 [user_token] => NhJxHYteL41Q8DFGwzQRkCPscZ1xqO1I [customer_id] => 8 )
The user_token key does not exist by default in v1.5x releases of Opencart, in fact, not before v3.x releases. Unless using an extension, I would not suggest the use of that key name since it could affect your platform's security session whenever an upgrade is involved by still using that extension due to key name conflicts.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Google [Bot] and 33 guests