Zen Cart Logo
Forums / Upgrading to 1.5.x / Plugin for Tracking mobile orders in 1.5.5

Plugin for Tracking mobile orders in 1.5.5

Views: 3,545

Results 1 to 14 of 14
10 Apr 2016, 12:57 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Plugin for Tracking mobile orders in 1.5.5

The Order Origin mod is now available in the Plugins area to help you determine which of your orders came from a mobile device.

https://www.zen-cart.com/downloads.php?do=file&id=2073

29 Sep 2016, 3:34 PM
#2
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

Hi Scott

Can I please ask - just installed the module but no M's showing up - will it only work now when new mobile orders come in. as I presume the data was not collected before that?

Are we able to back-track-it at all? even if its manually updating it - is there anywhere in DB that does show which were mobile orders?

Thank you

Installed on 1.5.4 did it line by line but other than nothing showing works fine :)

Thanks
Sarah

29 Sep 2016, 3:47 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Plugin for Tracking mobile orders in 1.5.5

Sarah, you are correct, it is for new orders only.
You can certainly update older orders but there's no admin interface; you'd need to use PHPMyAdmin or Install SQL Patches and do an update there.

29 Sep 2016, 3:52 PM
#4
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

Thanks Scott - are you able to tell me where that data is stored in the MySQL database so I can start pulling it out??

29 Sep 2016, 6:00 PM
#5
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,956
Plugin Contributions:
8

Re: Plugin for Tracking mobile orders in 1.5.5

it's an interesting bit of information.

as far as updating old orders, its seems the MobileDetect class is far more sophisticated that a simple sql string. but the following sql update could do all of the old orders.

as always with sql statements, use at your own peril, comes with no guarantees/warranties, etc.

update orders
set mobile_order = 1
where ord_user_agent REGEXP 'iPhone|iPad|Android|Blackberry'

someone else may want to chime in as i think that sql statement covers most of the mobile devices.

good luck.

29 Sep 2016, 6:50 PM
#6
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

carlwhat:

it's an interesting bit of information.

as far as updating old orders, its seems the MobileDetect class is far more sophisticated that a simple sql string. but the following sql update could do all of the old orders.

as always with sql statements, use at your own peril, comes with no guarantees/warranties, etc.

update orders
set mobile_order = 1
where ord_user_agent REGEXP 'iPhone|iPad|Android|Blackberry'

> 
> someone else may want to chime in as i think that sql statement covers most of the mobile devices.
> 
> good luck.

Thanks Carl - if nothing else that does tell me what table I am looking in anyway - and yes will test - at my own risk etc etc - much appreciated!
30 Sep 2016, 9:37 AM
#7
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

hmm ok I cannot find anything that matches that - where are you looking for that ord_user_agent .. ?

30 Sep 2016, 3:49 PM
#8
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,956
Plugin Contributions:
8

Re: Plugin for Tracking mobile orders in 1.5.5

sarah,
i APOLOGIZE!

i'm trying to reconstruct what i did. i think at some point, i saw the user_agent in the whos on-line page, and i then modified the create function within the order class with the following line:

'ord_user_agent' => substr(zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']), 0, 254)

which now stores that information in the order table. (i modified the orders table using an sql statement to add this extra field.) i have not been doing anything with it, but i have stored it! which i suppose for me makes this plugin a little superfluous. although i am unclear if my regular expression search is more definitive than the mobile detect class.

in looking at the order table, i'm not sure there is anything else stored there that will indicate mobile or not. nor am i seeing an other table where one could gather this information. although it "might" be there.

given that information, i am not sure one could reconstruct mobile or not for older orders.

again, i apologize for leading you a bit astray!

best.

1 Oct 2016, 11:57 AM
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Plugin for Tracking mobile orders in 1.5.5

@SarahL you would have to know which orders were placed by mobile - there's no way to determine this after the fact. But if you know you can set the mobile_order in a SQL statement.

3 Oct 2016, 1:51 PM
#10
sarahl avatar

sarahl

Zen Follower

Join Date:
May 2004
Location:
UK
Posts:
471
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

swguy:

@SarahL you would have to know which orders were placed by mobile - there's no way to determine this after the fact. But if you know you can set the mobile_order in a SQL statement.

thanks both - I think then this module is not for me as I don't log that information - I thought that was what the plugin did you see ! sorry

3 Oct 2016, 7:44 PM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,771
Plugin Contributions:
9

Re: Plugin for Tracking mobile orders in 1.5.5

Cool Hand Luke anyone?

3 Oct 2016, 10:57 PM
#12
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Plugin for Tracking mobile orders in 1.5.5

You are unlikely to find a plugin that has the ability to reveal what has already happened but not been recorded. :) All you can do is start with this mod and have the information going forward.

5 Oct 2016, 4:28 PM
#13
pratbirdman avatar

pratbirdman

New Zenner

Join Date:
Jun 2009
Location:
Prattville, AL
Posts:
5
Plugin Contributions:
0

Re: Plugin for Tracking mobile orders in 1.5.5

Using Zencart 1.5.5: Can you please tell where does it show the came from a mobile device?

Thanks

5 Oct 2016, 8:11 PM
#14
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Plugin for Tracking mobile orders in 1.5.5

It's on the Admin->Customers->Orders screen. There are screenshots on the help page.

(You have to install the plugin first.)