Copied to clipboard

Flag this post as spam?

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


  • kristian schneider 190 posts 351 karma points
    Mar 19, 2014 @ 18:17
    kristian schneider
    0

    TC.GetCurrentOrder(storeId, false) always returns an object

    Hi there. 

    We are running TC version 2.2.3 and there is a problem with  TC.GetCurrentOrder(storeId, false) always returns an object instead of null when the basket is empty.

    I understand there was a bug with this in 2.2.0, so we have ensured all our dll files are up to date.

    Basically we clear the session cookie and the first time we hit the method we dont get null but an order object.

    Any suggestions?

     

  • Anders Burla 2560 posts 8256 karma points
    Mar 20, 2014 @ 07:58
    Anders Burla
    0

    Hi Kristian

    I have just walked through the code and tested it and it works in 2.2.1+. So could you check that you have got the right files at your environment and it has been installed correctly?

    Kind regards
    Anders

  • kristian schneider 190 posts 351 karma points
    Mar 20, 2014 @ 12:51
    kristian schneider
    0

    Hej Anders.

    I tried to reinstall the package and also verify the dll files. I took the 2.2.3 zip from the project page.

    Still no luck though. 

    I tried to boil it down to nothing but the basics:

    @using TeaCommerce.Umbraco.Web
    @{
        Layout = null;
    
        long storeId = 1;
        var order = TC.GetCurrentOrder(storeId, false);                     
    
    }
    <html>
        <body>
        @order
        </body>
        </html>

    Clear the Session cookie and it still returns an order.

    How can I help debug this?

    Best regards

    Kristian

  • Anders Burla 2560 posts 8256 karma points
    Mar 21, 2014 @ 08:49
    Anders Burla
    0

    I have this simple test and everything works.

    @using TeaCommerce.Umbraco.Web
    @using TeaCommerce.Api.Models
    @inherits umbraco.MacroEngines.DynamicNodeContext

    @{
    Order order = TC.GetCurrentOrder(1, false);
    }

    @if(order == null){
    <h1>Order is null</h1>
    }

    So it must be some dll files or something that is not updated or something like that.

    Kind regards
    Anders

  • kristian schneider 190 posts 351 karma points
    Mar 21, 2014 @ 09:57
    kristian schneider
    0

    Hi Anders.

     

    Could I persuade you to do a MD5 hash of the teacommerce dll files? with something like http://www.slavasoft.com/hashcalc/ That way we can be 100% sure the files are similar.

    What ways can the Order be created?

    With that knowledge I can try and investigate if the order is set from somewhere strange.

    Best regards

    Kristian

  • Anders Burla 2560 posts 8256 karma points
    Mar 25, 2014 @ 08:59
    Anders Burla
    0

    The order is created if you use TC.GetCurrentOrder but don't specify false as the parameter. Or if you add or update an order line or anything the involves the order.

    Try and total vanilla Umbraco install with TC 2.2.3 and try the code I used. That should work.

    Kind regards
    Anders

  • kristian schneider 190 posts 351 karma points
    Mar 25, 2014 @ 14:48
    kristian schneider
    0

    It turnes out that it was a .dll file. For some reason the TeaCommerce.Umbraco.Web.dll did not get overwritten when installing the package again. 

Please Sign in or register to post replies

Write your reply to:

Draft