Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom W 39 posts 96 karma points
    Oct 08, 2020 @ 12:15
    Tom W
    0

    Member group discount only applied after app restart, remain on logout.

    Hi Matt,

    I just wanted to flag this for you to confirm, before I add an issue to Github. I'm not sure it will an easy one to fix, depending on how the member group discounts are being applied.

    This has been picked up in UAT on the site we're hoping to put live in a few weeks,

    We have a discount for a member group, called "LOYALTY 10%". Members are automagically added to this group, based on an import from the client's back systems. Or, they are manually added to the group via the Backoffice.

    There are 2 distinct issues we've encountered.

    1. If I'm logged in as a customer, without the role, I get no discount. If I add the member to that role, the discounts on their existing basket are not applied until the app is restarted (by touching the web.config or recycling the app pool)
    2. Once I have my discount, if I then log out, the discounts are still applied in the basket until the app is restarted

    At the moment, I'm suspecting that relevant information is stored in the vendr- cookie. So, I could sort 2 by removing the cookie on logout. But 1, I'm not so sure...

    Have these been reported before? I couldn't see them here. Do you want me to add some issues to Github for them?

    Many thanks!

    Tom

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 08, 2020 @ 12:56
    Matt Brailsford
    100

    Hey Tom,

    I think there are two potential issues here.

    The first one is primarily how authentication cookies work (Which I think is your point 1). Which is when you change a members permissions those changes won't automatically get applied to any logged in members sessions. That member would need to log out and then log back in again for their cookie / session data to be updated with the new / removed role.

    The second issue will come in the fact that Vendr won't re-calculate the discounts unless the order actually changes (which I'm guessing is the issue of point 2).

    I guess really you'd need to force the member to re-authenticate if their permissions change mid session and if they log out / in, then you'd need to lookup their current order and calls it's .Recalculate() method (and re-save it).

    Matt

  • Tom W 39 posts 96 karma points
    Oct 08, 2020 @ 13:00
    Tom W
    0

    Nice one, thanks Matt!

    1. Of course, that's to be expected I guess, as the roles/groups are stored in the authentication ticket

    2. Great! I'll give that a go.

    Cheers

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft