Copied to clipboard

Flag this post as spam?

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


  • Tolu Jemilua 39 posts 166 karma points
    Sep 06, 2017 @ 11:59
    Tolu Jemilua
    0

    Offer Coupon Error

    Hi, I'm trying to redeem a coupon created in the back office for the basket. The coupon is

    enter image description here

    but when I then do

      if (!string.IsNullOrEmpty(offerCode))
            {
                var result = this.Basket.GetCheckoutManager().Offer.RedeemCouponOffer(offerCode);
            }
    

    I get

    enter image description here

    Anyone know any reason why this is?, I've tried everything I could think of

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Sep 06, 2017 @ 12:33
    Simon Dingley
    0

    First of all, inspect the object when it breaks on the error and find out exactly what is null. Also, double check the offer code.

    Simon

  • Tolu Jemilua 39 posts 166 karma points
    Sep 06, 2017 @ 13:37
    Tolu Jemilua
    0

    Hi Simon, I did check the error. It seems like the error is happening inside the "RedeemCouponOffer" Method which I cannot access

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Sep 07, 2017 @ 08:45
    Simon Dingley
    0

    That's the beauty of open source - you do have access to it ;)

    https://github.com/Merchello/Merchello/blob/v2.5.0/src/Merchello.Web/CheckoutManagers/BasketCheckoutOfferManager.cs#L56

    Not sure if the offer codes are case sensitive so check that also but I am pretty sure they are not and if the code is not recognised it shouldn't throw a null exception.

    Perhaps clone the source code and step through the process to get more detail?

    Simon

Please Sign in or register to post replies

Write your reply to:

Draft