Copied to clipboard

Flag this post as spam?

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


  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 25, 2016 @ 12:49
    Tim Geyssens
    0

    Member specific prices and login/out

    Hey,

    On a site I'm currently working on I've implemented member specific pricing (so have a property member price on the product doc type and a custom product calculator and orderline calculater) those bits work great but I have a small issue

    When you aren't logged in then add items to the cart and log out , the items in the cart don't get updated to the member price...

    I assume it's also the other way around so when you are logged in, add items to the cart then come back later but not logged in anymore you get the member prices.

    Any ideas on how I can solve this issue? Thanks :)

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 25, 2016 @ 13:08
    Tim Geyssens
    0

    Also the confirmation email doesn't seem to reflect the correct prices (but I think I can update that one directly)

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 25, 2016 @ 13:26
    Tim Geyssens
    0

    So in the confiration email cshtml it does the following

                        var originalPrice = orderLine.OriginalUnitPrices.FirstOrDefault();
                        var price = orderLine.UnitPrice.Value.Value;
                        if (originalPrice != null)
                        {
                            price = originalPrice.Value;
                        }
    

    How would I get the correct discounted price? I would assume that would just happen automatically

  • Anders Burla Johansen 2560 posts 8256 karma points
    Oct 26, 2016 @ 09:38
    Anders Burla Johansen
    0

    Normally the confirmation email does like here - line 193 - 217

    https://github.com/TeaCommerce/Starter-kit-for-Umbraco/blob/master/Source/Website/MacroScripts/tea-commerce/email-template-confirmation.cshtml.default

    So your code is custom right? You won't want to use the original prices in any way like that :)

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 26, 2016 @ 09:39
    Tim Geyssens
    0

    Cool thanks for the tip Anders :)

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 26, 2016 @ 09:41
    Tim Geyssens
    0

    Also have an idea on the cart on login/out issue? Thanks much appreciated :)

  • Anders Burla Johansen 2560 posts 8256 karma points
    Oct 26, 2016 @ 09:46
    Anders Burla Johansen
    0

    Most simple way (if you have few currencies) is to make a new currency e.g "USD - B2B". Then just switch to that currency in the right cases. Only thing you need is to server secure the change of currency. For that you use the NotificationCenter and the CurrencyChanging event and check if the user is logged in and allowed to change to the "USD - B2B" currency. Makes sense? :)

    https://documentation.teacommerce.net/net-api/notification-center/

    Kind regards

    Anders

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 26, 2016 @ 09:48
    Tim Geyssens
    0

    Only have a single currency so that is definitely an option, will check the docs, thanks again :)

  • Anders Burla Johansen 2560 posts 8256 karma points
    Oct 26, 2016 @ 09:49
    Anders Burla Johansen
    0

    Then that is the most simple way to do it :)

    Your welcome. Looking forward to see the site you are doing.

  • Tim Geyssens 6419 posts 15052 karma points MVP 2x c-trib
    Oct 26, 2016 @ 09:51
    Tim Geyssens
    0

    Well it is updating an existing instance so you probably already now about it but having fun with TeaCommerce so far, great job!

  • Anders Burla Johansen 2560 posts 8256 karma points
    Oct 26, 2016 @ 10:00
    Anders Burla Johansen
    0

    Ahh okay :)

    Great to hear that you have fun. Any feedback is more than welcome. Just email me or write the good things on twitter :p

Please Sign in or register to post replies

Write your reply to:

Draft