Copied to clipboard

Flag this post as spam?

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


  • Sob 11 posts 41 karma points
    May 29, 2012 @ 09:52
    Sob
    0

    Tea commerce session not available

    Hi Everyone,

    I want to implement a discount coupon in teacommerce. For that i've  created a node and in the cart 03 xslt the user can add promotion code. This code is passes to appcode class where it tests whether node available if available i created funtion

    function

    TeaCommerce.Data.Order order = TeaCommerce.Razor.TeaCommerce.GetOrder();

    foreach (TeaCommerce.Data.OrderLine ol in order.OrderLines)
               {
                   ol.UnitPrice -= decimal.Parse(am);
               }

    but got an error whic shows in alert as follows.

     

     

    any help .....

     

  • Rune Grønkjær 1371 posts 3102 karma points
    May 29, 2012 @ 09:55
    Rune Grønkjær
    0

    Hi Sob,

    Are you by any chance using the cookies Tea Commerce option? The one under general options.

    /Rune

  • Sob 11 posts 41 karma points
    May 29, 2012 @ 11:05
    Sob
    0

    No am not using the cookies

  • Rune Grønkjær 1371 posts 3102 karma points
    May 29, 2012 @ 11:53
    Rune Grønkjær
    0

    Ok. What version of Tea Commerce are you running?

    You can see that on the package in the developer section.

    /Rune

  • Sob 11 posts 41 karma points
    May 29, 2012 @ 12:00
    Sob
    0

    version is 1.4.1.1    
  • Sob 11 posts 41 karma points
    May 29, 2012 @ 12:29
    Sob
    0

    Oh i updated to latest version..Now that error is not coming. But i cannot change total prize  says it is read only. How can i change that.

  • Rune Grønkjær 1371 posts 3102 karma points
    May 29, 2012 @ 12:34
    Rune Grønkjær
    0

    Fantastic. Bug fixes FTW.

    You must change the Unit Price on the orderline. Then the total price will be calculated automatically.

    /Rune

  • Sob 11 posts 41 karma points
    May 29, 2012 @ 14:03
    Sob
    0

    Hey Rune,

    I used the following code

    ol.UnitPrice -= decimal.Parse(am);

    order.save();

     But the change is not hapening in the cart. when i quick watched the unit prize  the following message is  seen.  "The name 'UnitPrice' does not exist in the current context" .    What is the reason?                  

  • Rune Grønkjær 1371 posts 3102 karma points
    May 29, 2012 @ 14:15
    Rune Grønkjær
    0

    I'm not quite sure about that context thing. What is your context?

    Actually I'm currently working on something similar for at project. I have hooked into the OrderLineChanged event at my code looks a bit like this:

    orderLine.UnitPrice = price;
    order.Save();

    That's working for me.

    /Rune

     

  • Anders Burla 2560 posts 8256 karma points
    May 31, 2012 @ 13:40
    Anders Burla
    0

    Got this working?

    Kind regards
    Anders

  • Sob 11 posts 41 karma points
    Jun 01, 2012 @ 13:09
    Sob
    0

     

    Sorry  for the delay .Not yet found a solution. wrote a class extending ITeaCommerceExtension and tried to override the events and not hapening.  Dont  know  what  went wrong.

  • Anders Burla 2560 posts 8256 karma points
    Jun 03, 2012 @ 13:07
Please Sign in or register to post replies

Write your reply to:

Draft