Copied to clipboard

Flag this post as spam?

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


  • Topic author was deleted

    Jul 02, 2015 @ 09:12

    MemberGroup Discount applying to all users

    I've been experiencing an issue with one of my MemberGroup discounts for Free Delivery. I've already posted this issue on uWebshop's GitHub but am reposting here to try and catch the wider Umbraco audience.

    When I get to the checkout stage, every single person gets the Free Delivery discount, despite the fact that I have restricted it to only a single MemberGroup. Even unregistered (i.e. not logged in) users get the Free Delivery.

    When I look at the order in the database, I can see that it has the discount applied:

    <Discounts>
        <OrderDiscount>
            <OriginalId>22484</OriginalId>
            <DiscountType>FreeShipping</DiscountType>
            <DiscountValue>0</DiscountValue>
            <RangesString />
            <Condition>None</Condition>
            <NumberOfItemsCondition>0</NumberOfItemsCondition>
            <RequiredItemIds />
            <MinimalOrderAmount>0</MinimalOrderAmount>
            <IncludeShippingInOrderDiscountableAmount>false</IncludeShippingInOrderDiscountableAmount>
            <MemberGroups>
                <string>Discount Member Group</string>
            </MemberGroups>
            <AffectedOrderlines />
            <Tags />
            <OncePerCustomer>false</OncePerCustomer>
            <Id>22484</Id>
            <TypeAlias>uwbsDiscountOrderMembergroup</TypeAlias>
        </OrderDiscount>
    </Discounts>
    

    Now, I've tried clearing my browser cache and cookies, using incognito mode, different browsers, different computers, and every time this happens. I've also cleared out the Umbraco TEMP folder and restarted IIS.

    I'm beginning to suspect that something has become "stuck" in Umbraco somewhere but I'm not sure where to look or how to diagnose this issue. Anybody out there experienced this or have an idea where to start?

    Any assistance greatly appreciated.

  • Casper Andersen 126 posts 508 karma points
    Jul 02, 2015 @ 13:16
    Casper Andersen
    0

    Dont know if this will work but it is worth a shot. A thing i found while working with uWebshop2 is that the uWebshop datatypes dont work, instead of using the uwebshop multiple member group picker, swap it with the already existing multiple member group picker, and if that does not exist, create a new one and set the content path and so on

  • Comment author was deleted

    Jul 02, 2015 @ 15:45

    Thanks again Casper, I've given this a shot but unfortunately it doesn't seem to make a difference.

    The MemberGroups are definitely being applied correctly to the discount (as in my XML above), but for some reason the check at basket/order stage passes the check even though the user isn't part of the assigned MemberGroup.

    Arnold has commented on my issue on Github suggesting it's related to this line of code.

    Very strange though, as I've tried RolesForCurrentUser() before but it correctly returns no items.

  • Casper Andersen 126 posts 508 karma points
    Jul 02, 2015 @ 15:48
    Casper Andersen
    0

    Are you passing in the correct user ? Are you able to debug the code and see what is passed in through the user and so on ?

  • Comment author was deleted

    Jul 03, 2015 @ 08:38

    Hey Casper, I've checked briefly in my Partial Views, but haven't had a chance to debug the code properly yet. Will hopefully get to this over the weekend and post what I find out on here.

Please Sign in or register to post replies

Write your reply to:

Draft