Announcement

Collapse
No announcement yet.

Customer Account Number or Unique Identifier

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Customer Account Number or Unique Identifier

    Hi,

    I need to setup some customer image files on the server that will be used in a 3rd party application. The naming scheme I was hoping to use would use the customers account number or unique identifier as the prefix.

    So for example: 79884_logo.jpg

    I would use the customers name but the only issue is if they change their name from Mike to Michael in their account settings we will lose the images.

    Are customers assigned account numbers or unique identifiers and if so what is the variable I can use to pull that in order to display those images on the site?

    Thanks in advance,
    Mike

    #2
    Re: Customer Account Number or Unique Identifier

    Hey Mike -

    Yes. When a customer creates an account they are given an unique customer id. This does not change even if they change their username.

    You can access the customer id using this variable:

    &mvt:global:basket:cust_id;

    so if your trying to make an image path out of it it would look something like this:

    <img src="/images/&mvt:global:basket:cust_id;_logo.jpg" border="0" />
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Customer Account Number or Unique Identifier

      Thanks Brennan, exactly what I needed.

      Comment


        #4
        Re: Customer Account Number or Unique Identifier

        Last question, is there a conditional I can add in there so that if the file is not present it displays text "no logo on file"?

        Thanks.

        Comment


          #5
          Re: Customer Account Number or Unique Identifier

          Mistella: If you have tookit, you can attempt to check if the file exists like this:
          <mvt:item name="toolkit" param="sassign|filepath|/mm5/BASKquote2.php" /> (use your image file here)
          <mvt:item name="toolkit" param="fileread|content|script|filepath" />
          <mvt:if expr="g.content">
          yes
          <mvt:else>
          no
          </mvt:if>

          This worked for me when I tried it on our DEV site. Hope it will work for you too.
          Larry
          Last edited by wajake41; 01-10-13, 07:16 PM.
          Larry
          Luce Kanun Web Design
          www.facebook.com/wajake41
          www.plus.google.com/116415026668025242914/posts?hl=en


          Comment


            #6
            Re: Customer Account Number or Unique Identifier

            Originally posted by Brennan View Post
            Hey Mike -

            Yes. When a customer creates an account they are given an unique customer id. This does not change even if they change their username.

            You can access the customer id using this variable:

            &mvt:global:basket:cust_id;

            so if your trying to make an image path out of it it would look something like this:

            <img src="/images/&mvt:global:basket:cust_id;_logo.jpg" border="0" />
            Neat. Could that unique customer id be displayed as a field within the Customer Admin screen so it can also me exportable?

            Many uses come to mind, such as email campaigns. One could embed the customer id as a parameter using for example Google URL Builder

            Code:
            http://www.MySite.com/widgets.html?utm_source=MySite&utm_medium=eMail&utm_content=2013-01-11-One-Day-Sale&utm_campaign=customer_id
            This way, one knows which customer responds to email campaigns. Also good for "Welcome back Joe", and ease Sign-In if cookies were expired, deleted, and/or browsing in Private Mode, etc...
            Thank you, Bill Davis

            Comment


              #7
              Re: Customer Account Number or Unique Identifier

              Hi Larry,

              Thank you for your help.

              I almost had this, but it is giving me some trouble (see below). I have to be missing the obvious here, it's Friday so could be. In the code I have below it is doing the opposite. It is displaying "no photo on file" when there is one. I tried swapping things out and that didn't work for me.

              <mvt:item name="toolkit" param="sassign|filepath|images/customers/photo/&mvt:global:basket:cust_id;_photo.jpg " />
              <mvt:item name="toolkit" param="fileread|content|script|filepath" />
              <mvt:if expr="g.content">
              <img src="/images/customers/photo/&mvt:global:basket:cust_id;_photo.jpg" width="200" border="0" />
              <mvt:else>
              No photo on file
              </mvt:if>


              Thanks,
              Mike

              Comment


                #8
                Re: Customer Account Number or Unique Identifier

                Hi Mike: Have you gotten it to work? If not maybe try changing the conditional to:
                <mvt:if expr="NOT ISNULL g.content">
                < img src="/images/customers/photo/&mvt:global:basket:cust_id;_photo.jpg" width="200" border="0" />
                < mvt:else>
                No photo on file
                < /mvt:if>

                Even though the code I posted worked for me, on reflection I decided the NOT ISNULL conditional is a better way to code this.

                Larry
                Larry
                Luce Kanun Web Design
                www.facebook.com/wajake41
                www.plus.google.com/116415026668025242914/posts?hl=en


                Comment


                  #9
                  Re: Customer Account Number or Unique Identifier

                  Hi Larry,

                  No luck, this is what I used and get "No photo on file" in both instances.

                  <mvt:item name="toolkit" param="sassign|filepath|images/customers/photo/&mvt:global:basket:cust_id;_photo.jpg " />
                  <mvt:item name="toolkit" param="fileread|content|script|filepath" />
                  <mvt:if expr="NOT ISNULL g.content">
                  <img src="/images/customers/photo/&mvt:global:basket:cust_id;_photo.jpg" width="200" border="0" />
                  <mvt:else>
                  No photo on file
                  </mvt:if>



                  Thanks,
                  Mike

                  Comment


                    #10
                    Re: Customer Account Number or Unique Identifier

                    Are the path and the file name being rendered correctly?

                    As a test, try hardcoding the path & file ID to see if it works then.

                    Larry
                    Larry
                    Luce Kanun Web Design
                    www.facebook.com/wajake41
                    www.plus.google.com/116415026668025242914/posts?hl=en


                    Comment


                      #11
                      Re: Customer Account Number or Unique Identifier

                      Just noticed that the file paths you are using do not match. The toolkit sassign does not have the leading / that the <img tag has.
                      Larry
                      Luce Kanun Web Design
                      www.facebook.com/wajake41
                      www.plus.google.com/116415026668025242914/posts?hl=en


                      Comment

                      Working...
                      X