Copied to clipboard

Flag this post as spam?

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


  • Vineeth 71 posts 291 karma points
    Jan 28, 2020 @ 08:15
    Vineeth
    0

    Clear existing Cart numbers and Orders

    How can we clear all the existing cart numbers and orders to initial like CART-1 and ORDER - 1 when we go live ?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 28, 2020 @ 08:56
    Matt Brailsford
    100

    Hi Vineeth,

    You'll need to delete all the orders and then in the database, in the TeaCommerce_Store table you can reset the CurrentCartNumber and CurrentOrderNumbers back to 0

    Hope this helps

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 28, 2020 @ 10:47
    Vineeth
    0

    One doubt not related to this topic. When order is finalized and confirmation mail has been sent. But the orderline still persist in the cart.Not get cleared, Do you know why ? possible reasons for this ?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 28, 2020 @ 11:03
    Matt Brailsford
    0

    Hi,

    Sounds like you have some code that is running that is attempting to modify the order whilst payment processing is in progress. When you modify an order that is mid way through processing, it clones the order as an in progress order can't be modified.

    I'd double check your code and make sure you aren't modifying the order when the payment status is set

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 28, 2020 @ 11:10
    Vineeth
    0

    Yeah got it. But now I need to add an extra property on the current order to skip the calculation written on the custom OrderlineCalculator.I'm using TC.AddOrUpdateOrderProperties to update the extra property. If the extra property persist on the order properties then it will skip the calculation done in the orderlineCalculator.

  • Vineeth 71 posts 291 karma points
    Jan 28, 2020 @ 11:13
    Vineeth
    0

    PFA :

    Here the yellow line of code used to update a new property to order. If I change the place where the order property is updating can solve this issue ie, Clear the cart after order finalize enter image description here

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 28, 2020 @ 11:19
    Matt Brailsford
    1

    Yea, it's using the TC helper that is causing it to clone as it's this that does the check to see if PaymentState != null and if it doesn't, it clones.

    You could get around this by not using the TC helper and instead set the properties on the order directly

    order.properties.AddOrUpdate(...);
    

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 28, 2020 @ 11:44
    Vineeth
    0

    That sounds perfect. Thanks, matt for always the quick response :)

  • Vineeth 71 posts 291 karma points
    Jan 29, 2020 @ 14:37
    Vineeth
    0

    Hi Matt, Regarding reset CurrentOrderNumber and CurrentCartNumber on Teacommerce_Store table. It doesn't get change when we manually update values to 0. When I do a checkout it still continues on the order number and cart number. Do you know why?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 29, 2020 @ 14:40
    Matt Brailsford
    0

    Hi Vineeth

    You'll need to restart your app pool as well as the stores get cached so if the value was cleared in the db but not in the cache, it would probably continue from the previous point.

    Sorry, I should have mentioned this before.

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 29, 2020 @ 15:01
    Vineeth
    0

    Ooops its Umbraco cloud. Only I can do is restart the environment. Is that will help?

    The steps I did :

    1. Clear all orders and carts from teacommerce backend
    2. Updated the Teacommerce table columns CurrentOrderNumber and CurrentCartNumber to 0
    3. Restarted the cloud environment

    Anything i missed ?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 29, 2020 @ 15:08
    Matt Brailsford
    0

    Hmm, sounds correct, although I'm not sure what "Restarted the cloud environment" actually does so I'm not sure if it causes an app pool recycle.

    The way I tend to do it, though it's a little tricky is to use clouds Kudu interface to "touch" the web.config forcing it to perform a recycle.

    See here https://our.umbraco.com/documentation/Umbraco-Cloud/Set-up/Power-tools/ and here https://our.umbraco.com/documentation/Umbraco-Cloud/Set-up/Power-tools/File-structure-on-cloud/ for details on how to access Kudu and the file strucure on Azure. From the files view you can click an edit button next to web.config to edit it, adding a space somewhere should be enough, then re-saving it.

    I can't fully recall if there is a shorter action somewhere to do this as I don't use cloud that often, but I know the above should work.

    Hope it helps

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 29, 2020 @ 15:35
    Vineeth
    0

    Yeah, it worked. Thanks Matt :)

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jan 29, 2020 @ 15:48
    Matt Brailsford
    0

    Awesome 👍

Please Sign in or register to post replies

Write your reply to:

Draft