Copied to clipboard

Flag this post as spam?

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


  • Thomsen 85 posts 283 karma points
    May 26, 2016 @ 21:26
    Thomsen
    0

    10 % discount on member logged in

    Hi

    I am trying to implement this snippet from your documentation where all products autoamtically is discounted by 10 % when the member is logged in:

    https://documentation.teacommerce.net/net-api/product-information-extractor/customizing-umbraco/

    Where do I place this code for this to run? I have tried putting it inside my global.asax and I have tried putting it in a new class file. But there is a lot of red line errors where references cannot be found. enter image description here

    Best regards

  • Anders Burla Johansen 2560 posts 8256 karma points
    May 27, 2016 @ 06:16
    Anders Burla Johansen
    0

    Hi Thomas

    What version of Tea Commerce do you run? Maybe you can just do it with a marketing rule and award instead of an information extractor. The difference is that the extractor is the one used to get info from Umbraco and because of that, the UI would be updated with the new price, where marketing rules and awards is something that runs everytime the order is changed and finds out which order lines should have which discount.

    Kind regards

    Anders

  • Thomsen 85 posts 283 karma points
    May 27, 2016 @ 21:00
    Thomsen
    0

    Hi Anders

    Thanks for your answer. I think I am running the newest version, installed 2 months ago.

    If I can set up a marketing rule which enables 10 % discount of members with a specific property set to true, it would do the trick. As I read your answer the 10 % will be applied at checkout - not on each product you browse, that's the difference between the extractor and the marketing rule?

    Best regards.

  • Anders Burla Johansen 2560 posts 8256 karma points
    May 30, 2016 @ 06:42
    Anders Burla Johansen
    0

    Correct :)

    But if you do the extractor then the order line will only have the discounted price. Then you would have to have an event when a member logs out and fix the prices at this time. So easier to have marketing rules/awards - but its only showed in check out flow.

  • Thomsen 85 posts 283 karma points
    Jun 01, 2016 @ 21:53
    Thomsen
    0

    Hi Anders

    Thanks for the reply. Maybe I have missed it searching, but It's a bit hard to find documentation or forum posts on how to set up the marketing rules like this. In this case I guess I am going to use a property rule on the left side, and a percentage award on the right, but I am not shure?

    Could you give a little advise on the settings - where to apply the rule and where to check if a member is logged in?

    Best regards.

    enter image description here

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 03, 2016 @ 06:14
    Anders Burla Johansen
    0

    You would need a rule on the right where you check either an order property or check that the user is logged in using the member API - just remember that the calculator recalculates the order everytime it is saved. And then the award on the right.

    Kind regards

    Anders

  • Thomsen 85 posts 283 karma points
    Jun 06, 2016 @ 22:31
    Thomsen
    0

    Hi Anders

    Thank you - maybe you could help me a little out with the understanding of the rules setup:

    If I choose to check on an order property – where do I add a new property alias to an order so I can set that to "true" if a member is logged in, when the order is created?

    If you have any code snippet, link to documentation or similar topic I would appreciate very much.

    Best regards.

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 07, 2016 @ 14:57
    Anders Burla Johansen
    100

    You will need to add the property where you have the login/logout functionality. In .NET there is no event to register to know when a person logged in/out. There you would do something like this

    //Login code here....
    Order order = TC.GetCurrentOrder( storeId, false );
    if( order != null ) {
      order.Properties.AddOrUpdate("loggedIn","true");
      order.Save();
    }
    

    You would also need to hook into the order created event of Tea Commerce and check if a member is logged in and add the property at that point.

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

    Then in logout you check if there is an order and remove the property if its there or just overwrite it to empty.

    Hope it makes sense :)

  • Thomsen 85 posts 283 karma points
    Jun 12, 2016 @ 00:41
    Thomsen
    0

    Hi Anders

    Makes perfect sense - thank you, that was exactly the guidance I needed. I will dig into it and try to solve it this way :-)

    Thx.

Please Sign in or register to post replies

Write your reply to:

Draft