As I was working on a Miva Merchant store today, I needed to show the user a link, but only if they were currently logged in. I know I have done this before, but I couldn’t find the code for the life of me. So I went to trusty ol’ Google and typed in “Miva Merchant detect if user logged in” and several other terms only to come up with nothing. So I dug through several other Merchant sites to find the code. I finally found it and have decided to post it here in case somebody else has the same problem.
UPDATE: Apparently you need to check that g.Basket:CUST_ID is not equal to zero. At first my solution only checked that it wasn’t null which was flawed.
<mvt:if expr="NOT ISNULL g.Basket:CUST_ID AND g.Basket:CUST_ID NE 0"> Welcome back, &mvte:global:customer:login;! <mvt:else> Hello anonymous user! </mvt:if>