PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 6/20/2020 7:53 AM by  3ART Technologies
Coupon code not implement on cart items
 2 Replies
 0 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages





Basic Member






--
6/20/2020 7:03 AM
    Hi,
    From the backend C#, I want to implement the coupon code at "CART Page". "The Add a Promotional Code:" is not adding in the order service.

    The below code returning me True, but when I see the list of coupon code under my cart list it will exist empty.

    var HccApp = HccAppHelper.InitHccApp();
    var cart = HccApp.OrderServices.CurrentShoppingCart();
    bool returnValue = cart.AddCouponCode(coponCode);

    Can anyone tell me why it is behaving like that? or there is some other class to add the coupon code in the cart item

    [img=https://i.ibb.co/v3n9wS4/checking.png]nothing[/img]


    Regards





    Basic Member






    --
    6/20/2020 7:45 AM
    The function adding the item into the list but not value is not saving into the database, did I need to update the cart if yes please inform me what is the function for it





    Basic Member






    --
    6/20/2020 7:53 AM
    Found the solution

    var HccApp = HccAppHelper.InitHccApp();
    var cart = HccApp.OrderServices.CurrentShoppingCart();


    cart.AddCouponCode(coponCode);
    // Important to update your cart
    HccApp.OrderServices.Orders.Update(cart, true);

    bool returnValue = cart.AddCouponCode(coponCode);
    return returnValue;

    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: