简体   繁体   中英

How to get the customer id if user is logged in , in volusion platform

I want to get the customerid to do some custom code in volusion. Please help me if there is any way so that I can fetch the customerid. I can see in cookie there is a cookie named "CustomerID" but I am unable to decrypt it .

I put this in the jquery .ready() function...

 $.ajax({ url: "/api/v1/users/current", dataType: "json", success: function (json) { firstName = json.data.firstName; lastName = json.data.lastName; email = json.data.email; id = json.data.id; alert (firstName + " " + lastName + " " + email + " " + id + " ") ; //return true; }, error: function(e){ //alert('error '+e.responseText); } });

You can use the Volusion frontend API:

www.yoursite.com /api/v1/users

This endpoint will return the logged in user as a JSON.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM