Copied to clipboard

Flag this post as spam?

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

  • John Bergman 459 posts 1065 karma points
    Dec 08, 2016 @ 00:56
    John Bergman

    Sample Code or "mods"?

    New to Umbraco (and Tea Commerce), I am wondering if there is a place that has sample code or walkthrough on how to implement things like

    Validating a coupon code from an external system and applying the externally defined Discount (either percentage or value)

    Discounting based on Member group (or type)

    Merging stores from multiple vendors into a master store


    I can write the code, the challenge I am having is quite here to start :-)

  • Anders Burla Johansen 2560 posts 8256 karma points
    Dec 08, 2016 @ 14:36
    Anders Burla Johansen

    Hi John

    Welcome to the Umbraco community and Tea Commerce! Happy to have you.

    Having an external discount is not a common case that is documented or written about. What you would do is add the discount code using the AddDiscountCode using the API.

    Then make a custom marketing rule that uses this discount code to check if the rule applies. Then you would need to make a custom award as well that uses the data about discount rate from the external system. You would property make a cache of the data from the external system so it wont slow down the order calculation (which takes care of discount, and is run everytime an order changes something).

    Discount based on member group would need a custom marketing rule again to check the member.

    You can see the rules and awards here.

    Kind regards


Please Sign in or register to post replies

Write your reply to: