Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Order Tracking Link Expires After Single Use- Can I Fix This? Rate Topic   - - - - -

 
  • Smich
  • Advanced Member
  • Members
  • Join Date: 13-Jan 12
  • 65 posts

Posted 12 August 2015 - 02:16 PM #1

I commented elsewhere (*) about how guest users can track their order via a link emailed to them upon request.

Unfortunately, this link can only be used once before it expires. (**)

Is there a setting that can be changed which allows the tracking URL to be used as often as desired within a given period?

Thank you,

- Smich

(*) http://forum.cs-cart...k-their-orders/
(**) This is because as soon as it's used, the ekey in the URL is invalidated by automatically removing it from the cscart_ekeys table in the database; regardless of its TTL value. (I've checked this.)

Attached Thumbnails

  • Untitled-2.jpg
  • Untitled-3.jpg
  • Untitled-4.jpg


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1176 posts

Posted 17 November 2015 - 02:24 AM #2

Anybody have a fix for this ekey feature or (bug).  The Order Tracking links only work once. This is a stupid design by cs-cart.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 17 November 2015 - 08:34 AM #3

Please open the app/controllers/frontend/orders.php file and replace:

$ekey = fn_generate_ekey($order_info['email'], 'T', SECONDS_IN_HOUR);

with

$ekey = fn_generate_ekey($order_info['email'], 'T', SECONDS_IN_DAY * 365);

Then open the app/functions/fn.common.php file and replace:

db_query("DELETE FROM ?:ekeys WHERE ekey = ?s", $ekey);

with

//db_query("DELETE FROM ?:ekeys WHERE ekey = ?s", $ekey);

Edited by eComLabs, 17 November 2015 - 10:47 AM.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2960 posts

Posted 17 November 2015 - 09:30 AM #4

The Order Tracking links only work once.

 

 

TTL does not matter in case you use the 'ekey' link twice (in different browsers, for example). At the moment when you extract the 'ekey' data from the database, it will be removed from it, even if TTL is not expired.

This ekey functionality deals not only with Orders, but, for example, for downloading attachments to orders (when a product is down-loadable). And a customer should not be able to use this download link several times.

You can modify the 'fn_get_object_by_ekey' function in the 'app/functions/fn.common.php' file: add a new parameter which will trigger the removal or not depending on its value. And set this parameter in the 'fn_get_object_by_ekey' function calling in the 'app/controllers/frontend/orders.php' file.

We can develop this small modification for you. Please post a quote to https://simtechdev.com/helpdesk .


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 17 November 2015 - 10:45 AM #5

I have updated my post to disable ekey deletion. Hope this will help.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2960 posts

Posted 17 November 2015 - 11:39 AM #6

I should say it again, this function (fn_get_object_by_ekey) is called not only when you track an order, but in some other cases which require only single request via 'ekey' functionality. If it is OK, you can comment the deletion.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 17 November 2015 - 11:53 AM #7

I should say it again, this function (fn_get_object_by_ekey) is called not only when you track an order, but in some other cases which require only single request via 'ekey' functionality. If it is OK, you can comment the deletion.

 

It was clear from your post. Thank you, anyway


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • salvag
  • Junior Member
  • Members
  • Join Date: 20-Feb 07
  • 102 posts

Posted 28 June 2018 - 07:08 PM #8

I have tried using the fix outlined above but I get an error when using latest software version 4.8.1. Is there a current fix?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 29 June 2018 - 05:01 AM #9

I have tried using the fix outlined above but I get an error when using latest software version 4.8.1. Is there a current fix?

 

What error do you receive?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • salvag
  • Junior Member
  • Members
  • Join Date: 20-Feb 07
  • 102 posts

Posted 29 June 2018 - 12:07 PM #10

What error do you receive?


It is a JSON syntax error, it occurs when I comment out the line in fn.common.php

//db_query("DELETE FROM ?:ekeys WHERE ekey = ?s", $ekey);

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 29 June 2018 - 01:29 PM #11

It should not generate any errors. Try to backup fn.common.php file and completely remove the mentioned line


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • salvag
  • Junior Member
  • Members
  • Join Date: 20-Feb 07
  • 102 posts

Posted 29 June 2018 - 06:28 PM #12

It should not generate any errors. Try to backup fn.common.php file and completely remove the mentioned line

 

I deleted the entire line in fn.common.php and still get the following error: 

 

Error Oops, something went wrong (SyntaxError: Unexpected end of JSON input). Please try again.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 02 July 2018 - 07:28 AM #13

It is required to examine issue on your server. At the moment I do not see any reasons for error generation


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.