Announcement

Collapse
No announcement yet.

Identifying the logged in buyer

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

    Identifying the logged in buyer

    I want to be able to identify who the buyer is when they are logged in so I can offer bespoke pages to them.

    I can see that the buyer table has a couple of fields - sUsername and nID - and I'm assuming that they are used in the Perl scripts... but I can't figure out how to access that information dynamically when the customer is logged into their account. I presume that it will be some JavaScript but I've no idea where it would pull that information from.

    Has anyone done anything similar before?
    Elysium:Online - Official Accredited SellerDeck Partner
    SellerDeck Design, Build, Hosting & Promotion
    Based in rural Northants

    #2
    It looks like itís stored in the cookies as a digest.

    https://community.sellerdeck.com/for...-eu-cookie-law

    converting back from the digest to identify the logged in user might not be an easy thing to do.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      https://community.sellerdeck.com/for...-visit-my-site

      Comment


        #4
        That's useful.

        It looks as if it's already setting the buyer and account info into the cookie for checkout. I can't remember which cookie it is but once you find it you can use the contents of that to display specific content / pages.

        -----------------------------------------

        First Tackle - Fly Fishing and Game Angling

        -----------------------------------------

        Comment


          #5
          Right.... nearly cleared my lockdown to-do list and this was at the bottom...

          I've looked at bentleybloke's link and implemented that code so I get a log of all users logging in - thanks for that.

          I'm trying to write some Javascript to identify the logged in Buyer ID but failing miserably.

          I can use the JS function IsLoggedIn to identify if someone is logged in or not - and I can output the entire contents of the ACTINIC_BUSINESS cookie if logged in.

          But, as soon as I try to access the contents of the cookie ACTINIC_BUSINESS everything stops working.

          Then I realised that the cookie doesn't actually contain the BuyerID..... no SD cookes have this.

          The logfile is produced in a Perl script and uses the variables $$pBuyer{AccountID}, $$pBuyer{ID} and $$pBuyer{Name}

          Can anyone point me in the direction of being able to access those variables through Javascript? Or are they local to Perl?
          Elysium:Online - Official Accredited SellerDeck Partner
          SellerDeck Design, Build, Hosting & Promotion
          Based in rural Northants

          Comment


            #6
            They’ll be server side in Perl and stored in the session files so you won’t have access to them.

            To access them in JavaScript it’s probably easiest to write them to a cookie in Perl so you can then access that cookie from your JavaScript. The code to do this in Perl doesn’t look that complicated and you could put it in the Perl script that’s used above to create the log of customers.
            -----------------------------------------

            First Tackle - Fly Fishing and Game Angling

            -----------------------------------------

            Comment

            Working...
            X