Reporting on TNEW Guest Checkout vs Web Login orders?

I'm trying to track the use of Guest Checkout vs Web Logins for online orders. Does any relevant information exist on the order level that can determine if Guest Checkout was used? I realize that the patron account may have a Guest Checkout attribute, but that is less helpful when accounts are merged or if that attribute needs to be deleted to facilitate a merge.

Parents Reply Children
  • Well, take for example the below code:

    USE impresario
    
    DECLARE	@web_mos_category INT = 3,
    		@order_start_dt DATETIME = '2018-08-01 00:00:00.000'
    
    SELECT	lt.id,
    		lt.description AS login_type,
    		COUNT(o.order_no) AS order_count
    FROM		T_ORDER o WITH (NOLOCK)
    	JOIN	T_EADDRESS e WITH (NOLOCK) ON o.eaddress_no = e.eaddress_no
    	JOIN	T_CUST_LOGIN cl WITH (NOLOCK) ON e.eaddress_no = cl.eaddress_no
    	JOIN	TR_LOGIN_TYPE lt WITH (NOLOCK) ON cl.login_type = lt.id
    	JOIN	TR_MOS m WITH (NOLOCK) ON o.MOS = m.id
    WHERE	o.order_dt > @order_start_dt
    	AND	m.category = @web_mos_category
    GROUP BY	lt.id,
    			lt.description
    ORDER BY	order_count DESC
    

    Assuming your web MOS category ID was 3 and you only wanted to look at orders after August 1st, 2018 (those are accurate for my database when we went live with TNEW; yours will obviously be different), this will group orders together.  But it is not perfect.  E-mail addresses are limited to one login per login type.  So one could have both a guest and regular login on the same e-mail address.  I am sure there are ways to report around that using SQL, but frankly I have never bothered to try to think on it.  Also, any number of changes can be made post-order that likely would not be trackable in any meaningful way.  But at least that would give you a baseline.

    John A. Moskal II