Post by kgkaraoke » Mon Aug 27, 2012 4:02 pm

This problem appears in OpenCart 1.5.3.1, 1.5.4, 1.5.4.1 and very likely earlier 1.5.X.X versions as well.

A registered user places an order, receives an order confirmation email which includes a link back to the order. The customer clicks the link and gets a "Page Not Found" notification. Here's the patch:

In /catalog/model/checkout/order.php find the following code:

Code: Select all

$text .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . "\n\n";
It SHOULD be:

Code: Select all

$text .= $order_info['store_url'] . 'index.php?route=account/order/info/order_id=' . $order_id . "\n\n";
THIS ERROR APPEARS AT THREE PLACES WITHIN THE FILE, AND IT ALSO APPEARS ONCE WITHIN admin/model/sale/order.php
Last edited by kgkaraoke on Mon Sep 24, 2012 1:29 pm, edited 3 times in total.

New member

Posts

Joined
Fri Oct 29, 2010 9:06 am

Post by Daniel » Mon Aug 27, 2012 5:30 pm

thx for letting me know.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by i2Paq » Mon Aug 27, 2012 9:08 pm

Why in some cases is there no problem with the link in the e-mail?

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 kgkaraoke » Tue Aug 28, 2012 2:37 am

Daniel wrote:thx for letting me know.
My pleasure.

New member

Posts

Joined
Fri Oct 29, 2010 9:06 am

Post by Daniel » Tue Aug 28, 2012 6:14 pm

just checked and this is not in any code i can find.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by bwingwing » Tue Aug 28, 2012 8:25 pm

/catalog/model/checkout/order.php

v1.5.3.1

line 468

New member

Posts

Joined
Sun Oct 24, 2010 3:54 am

Post by PixImage » Sat Sep 01, 2012 12:32 am

When the user is not logged in and click on the link in the comfirmation e-mail to view his order, get login and will redirect to cart with a new order (same products as ordered before) afther login.
When user "first login", and then click on the link in the comfirmation e-mail, then he can view his order.
That's the right thing.

By replacing the "&" by "/" the problem is solved.

I don't know mutch about code, but in the order.php are 3 times the code "route=account/order/info&order_id="
Do i need to replace them all 3 ?
I have done that, but don't know if it will effect some other functions in opencart v1.5.3.1

Sorry for my English

Newbie

Posts

Joined
Sat Sep 01, 2012 12:12 am

Post by i2Paq » Sat Sep 01, 2012 1:21 am

Could it be related to the server setup?

I have seen this same thing being reported with a extension called Request Reviews.
Some users claim the same sort problem that the & is not working (redirects you to the wrong page or no redirection at all) while using "/" in the e-mail link works.

I tested that Extension and like order-link in the e-mail for me it works in Gmail, Hotmail, Livemail and Outlook.

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 » Sat Sep 01, 2012 1:24 am

Daniel wrote:just checked and this is not in any code i can find.
It is in the file on line 468:

Code: Select all

			if ($order_info['customer_id']) {
				$text .= $language->get('text_new_link') . "\n";
				$text .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . "\n\n";
			}

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 PixImage » Sat Sep 01, 2012 8:20 am

Sorry, i have tested again, and again...
I was wrong. Still not working.

I think the best way is to remove the "order-ID number" from the link in the comfirmation e-mail in the code.
Then you get the order-overview (history) page. (With or without login)

Something like: YOURSTORE.COM/index.php?route=account/order/info&order
(= index.php?route=account/order)

In this case you dont get a cart with products in it.

Can somebody tell me what code need to be edited?

I think it's line in catalog\model\checkout\order.php :
$template->data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;

Thanks

Newbie

Posts

Joined
Sat Sep 01, 2012 12:12 am

Post by i2Paq » Sat Sep 01, 2012 5:00 pm

The issue is not in the code.

And a solution is given in this topic.

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 OC2PS » Mon Sep 17, 2012 7:04 pm

Confirming issue.

When a customer places an order, (s)he receives an email confirmation, with a link to the order.

If the customer clicks on the link, there are 2 scenarios:
  1. The customer is already logged into OpenCart, as would likely be the case for most fresh orders. In this case, the link works as expected and takes the customer to the particular order in his/her account.
  2. The other scenario is that the customer is not already logged in. This is where things fall apart.
    As expected, the customer is presented with a login screen (so far so good).
    But as soon the customer logs in, instead of being taken to his/her order, (s)he is taken to a shopping cart, and the cart contains all the items from the order under reference. This is bizarre, and deserves another look. Customers are particularly scared by the status message

    Code: Select all

    You have successfully added the products from order ID #x to your cart!
P.S. Changing & to / hasn't helped.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by i2Paq » Mon Sep 17, 2012 7:41 pm

I have no such issue, sure it has nothing to do with your e-mail client / server settings?

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 OC2PS » Mon Sep 17, 2012 7:46 pm

Have tried on 2 different servers and 10 different email systems.

When you click on the order link in confirmation email (and you aren't logged in), are you redirected upon login to the specific order?

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by i2Paq » Mon Sep 17, 2012 10:29 pm

OC2PS wrote:Have tried on 2 different servers and 10 different email systems.

When you click on the order link in confirmation email (and you aren't logged in), are you redirected upon login to the specific order?
Yes, I go the logon page of my store, I logon and I see the order the link was pointing to.

I could forward you the e-mail + account info?

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 OC2PS » Mon Sep 17, 2012 10:32 pm

i2Paq wrote:I could forward you the e-mail + account info?
Would be fantastic if you could PM this to me.

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Mon Sep 17, 2012 10:39 pm

Just checked your link, it seems to work perfectly.

Have you made any changes or is this OC's default behavior for you?

OC2PS
OC 2.3.0.2, vQmod 2.6.2, Journal2 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by i2Paq » Mon Sep 17, 2012 11:11 pm

OC2PS wrote:Just checked your link, it seems to work perfectly.

Have you made any changes or is this OC's default behavior for you?
This is a default OC with minor changes to the CSS (Header and colors).

I have some vQmod running but none interfere with the order-email.

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 kgkaraoke » Mon Sep 24, 2012 1:18 pm

Daniel wrote:just checked and this is not in any code i can find.
It is present in both 1.5.3.1 and 1.5.4.1 - probably others.

New member

Posts

Joined
Fri Oct 29, 2010 9:06 am

Post by kgkaraoke » Mon Sep 24, 2012 1:22 pm

i2Paq wrote:
Daniel wrote:just checked and this is not in any code i can find.
It is in the file on line 468:

Code: Select all

			if ($order_info['customer_id']) {
				$text .= $language->get('text_new_link') . "\n";
				$text .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . "\n\n";
			}
THIS ERROR APPEARS AT THREE PLACES WITHIN THE FILE, AND IT ALSO APPEARS ONCE WITHIN admin/model/sale/order.php

New member

Posts

Joined
Fri Oct 29, 2010 9:06 am
Who is online

Users browsing this forum: No registered users and 11 guests