Copied to clipboard

Flag this post as spam?

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


  • ianhoughton 281 posts 605 karma points c-trib
    Apr 15, 2016 @ 09:40
    ianhoughton
    0

    Thousands of empty cart records in backend

    We have an Umbraco 6.1.6 site running TeaCommerce 2.2 and if we filter Orders / New > Order Stage = Cart in the backend we're seeing a new line entry every 5-10 minutes.

    Is someone trying to hack our system, or is there a problem with our setup?

  • Anders Burla 2560 posts 8256 karma points
    Apr 15, 2016 @ 09:44
    Anders Burla
    0

    You properly miss the autoCreate: false parameter in GetCurrentOrder when you print out the mini cart or something like that.

    https://documentation.teacommerce.net/razor-api/order/getcurrentorder/

    Kind regards

    Anders

  • ianhoughton 281 posts 605 karma points c-trib
    Apr 15, 2016 @ 09:49
    ianhoughton
    0

    We have this code in mini-cart.cshtml

        if (TC.GetCurrentOrder(storeId, false) != null)
      {
        Order order = TC.GetCurrentOrder( storeId );
        totalPrice = order.SubtotalPrice.ToString();
        totalQuantity = order.OrderLines.Sum( o => o.Quantity );
      }
    

    should we change this line to:

    Order order = TC.GetCurrentOrder( storeId, false );
    
  • Anders Burla 2560 posts 8256 karma points
    Apr 15, 2016 @ 10:20
    Anders Burla
    0

    I would have:

    Order currentOrder = TC.GetCurrentOrder(storeId, false);
    if(currentOrder != null){
    
    }
    

    Just to optimize. BUT there must be somewhere else that you are missing the false statement where a lot of people are visiting your webshop.

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Apr 24, 2016 @ 21:08
    Paul Wright (suedeapple)
    0

    I remember this being a bug in one of the TC versions, that was fixed in a patch release.

    Double check what version of teacommerce you are using, and get patched up.

Please Sign in or register to post replies

Write your reply to:

Draft