Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 9 of 9

Thread: Shopping cart links at top of page

  1. #1
    mistersimon is offline Junior Member
    Join Date
    Sep 2008
    Posts
    2

    Default Shopping cart links at top of page

    Hi.

    I'd like to be able to have some other pages on my web site that perform other non-shopping cart tasks and are a bit complicated so its probably not appropriate to use the Topics feature for them.

    But I'd still like to have the following links at the top of these pages to match the rest of the shopping cart part of the site: "My Account", "Shopping Cart(0)", "My wishlist", "Logged in as...", "Logout".

    Probably the best thing for me to do is to query the database from these pages to get the information. I've looked at the CustomerSession table, but the CustomerSessionID and CustomerSessionGUID fields don't match the session.sessionid.

    Does anyone know how to do this?

    Much appreciated - thanks.

  2. #2
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    The CustomerSessionID and CustomerSessionGuid are populated by ASPDNSF. The Session.SessionID is the HTTPContext set on the browser and persisted across URLs (for the most part). I would take another look at topics. Although you didn't say exactly what was so complicated about these pages, I'd have to say that ASPDNSF Topics are a very versatile tool, and have the added benefit of fitting directly into the template.ascx, giving you access to all the information you're already looking for. Keep in mind that without inheriting the skinbase, you'll not have access to the tokenizer.
    Last edited by Jesse; 09-09-2008 at 08:31 AM.

  3. #3
    mistersimon is offline Junior Member
    Join Date
    Sep 2008
    Posts
    2

    Default

    Thanks for getting back to me Jesse.

    I'd like to be able to use asp.net validation controls on the form on these pages. If I do that using the topics they just output the asp code as html rather than rendering them as server controls.

    I'd also like to be able to write code in the page to process what the user has entered into the form. I can do this by posting the page to another asp.net page but this means I lose the functionality of asp.net and its acting more like a classic asp page.

    Also, I can't add any javascript for client side validation of forms - the topics page seems to strip out any javascript code I enter.

    That's why I thought it may be simpler to just write the code as a standard asp.net page and query the database for the logged in status and shopping cart status of the user in order to display the "shopping cart" and "logged in as" links at the top.

    However, I can't quite get my head around how to pull this information out of the database. Is there a cookie that's stored on the user's machine that matches the CustomerSessionID or the CustomerSessionGuid?

    Cheers, Simon

  4. #4
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    The cookie you'd be looking for is ASPDNSFGUID. It would also be able to be accessed using ThisCustomer.CustomerGUID property if you're correctly adding the aspx page to the active application and have access to the object.

  5. #5
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Post

    Quote Originally Posted by ASPDNSF Staff - Jesse View Post
    The cookie you'd be looking for is ASPDNSFGUID. It would also be able to be accessed using ThisCustomer.CustomerGUID property if you're correctly adding the aspx page to the active application and have access to the object.
    Same boat. I would like to show the shopping cart quantity and logged in status in my other .aspx pages using the ASPDNSFGUID cookie which does not inherit from skinbase. But when i log in the store, I can see the cookies such as SKINID, Lastviewedentity, etc... but not ASPDNSFGUID. How can i retrieve this value?

    I also tried to create the normal httpcookie and access the ASPDNSFGUID but it returns NULL. Is there anyway to get these value in my other pages.

  6. #6
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Smile

    Any suggestion on this?

  7. #7
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    What version are you running? The aspdnsfcustomerguid cookie is showing fine for me whether logged in or logged out (hint: set debug=true in one of the xmlpackages' package node to see debug output of the current cookies related to the application).

    As far as your modifications, the shopping cart quantity is easy (requires modifications though). You can either query the database directly for the number of items in the shopping cart based on the aspdnsfcustomerguid cookie, or you can implement a WSI call that makes the same type of query, then display the number.

    The login status is a bit trickier because our current logic checks the ThisCustomer object for the IsRegistered property (which would only be available on the object when the customer is logged in, therefore ensuring that the customer has already logged in). I suppose that you could go the same route though, and through direct database query or WSI check the IsRegistered field of the record based on the aspdnsfcustomerguid cookie; if the customer is not logged in, the GUID won't match their customer record and all anonymous customers (those that are not logged in) will have an IsRegistered value of 0.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  8. #8
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Post Loin Status

    We are using ASPDNSF latest version.

    As you said I can get the shopping cart count value and display it in my pages using cookie. Thats fine.

    But regarding Login Status, When we check ASPDNSFGUID and isregistered field only, if the user is already registered but not yet logged in the store. So now when the user visit my .aspx pages, it will display the login status as "Logged in(Logout)" because he is registered user and ASPDNSFGUID has his values. is that correct?

    Thanks for your support and valuable answers.


    Quote Originally Posted by ASPDNSF Staff - George View Post
    What version are you running? The aspdnsfcustomerguid cookie is showing fine for me whether logged in or logged out (hint: set debug=true in one of the xmlpackages' package node to see debug output of the current cookies related to the application).

    As far as your modifications, the shopping cart quantity is easy (requires modifications though). You can either query the database directly for the number of items in the shopping cart based on the aspdnsfcustomerguid cookie, or you can implement a WSI call that makes the same type of query, then display the number.

    The login status is a bit trickier because our current logic checks the ThisCustomer object for the IsRegistered property (which would only be available on the object when the customer is logged in, therefore ensuring that the customer has already logged in). I suppose that you could go the same route though, and through direct database query or WSI check the IsRegistered field of the record based on the aspdnsfcustomerguid cookie; if the customer is not logged in, the GUID won't match their customer record and all anonymous customers (those that are not logged in) will have an IsRegistered value of 0.

  9. #9
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Post Retrieve value from ASPDNSFGUID

    Just quick question. I can retrieve the value from ASPDNSFGUID, But how can i check that encrypted value against database query with CustomerGUID. its not a direct value. Is there anyway to retrieve this?