Checkout Completed Page - Reload Problem

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi there!

When customers placed an order, the link /checkout/completed/id remains valid forever, so customer can always open the page (logged in, of course) or refresh any time he wants, causing a lot of problems on google analitycs for example.

This problem occurs more frequently on mobile devices, because customers always leave this page opened and close the navigtion app. When it is open again, reload the page and another analytics transaction or whatever is processed twice.

Here we added a time validation on this line:


public ActionResult Completed(int? orderId)
...
if (order == null || order.Deleted || _workContext.CurrentCustomer.Id != order.CustomerId || order.CreatedOnUtc.AddMinutes(5) < DateTime.Now)


This fix this issue and customer will never open the link again, after 5 minutes.

Thanks!
8 years ago
Hi Ivan,

Thanks. But please note that with your suggested solution a customer can open this page 100 times during these 5 minutes (if he wants). Furthermore, some customers could need an hour to complete an order after redirection (we have such ones on the official nopCommerce site).
8 years ago
Andrei,

you are right, but talking about Google Analitycs, even if customer refreshes the page 100 times, it keeps the session Id and, on this specific situation, data will not be duplicated.

The main problem is on mobile devices, closing and reopening browser apps, where session id was expired.

We need to think a little bit more!

Ivan.
8 years ago
Hi Ivan,

Thanks. I'll think about better workaround. But 5 minutes is too little. Anyway, please find this work item here.
7 years ago
And fixed. Thanks again!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.