Copied to clipboard

Flag this post as spam?

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


  • Paul Crowdy 40 posts 111 karma points
    Nov 10, 2021 @ 08:32
    Paul Crowdy
    0

    Deleting Orders

    Hi Matt,

    I have a site that has been live for a while with Vendr running on it (1.8.2, on Umbraco 8.14.0), but without any ecom functionality being used.

    I am now in a position where we are going to buy a licence and turn on all of the ecom functionality.

    There are currently 7 test orders visible within the Vendr admin. When I try to delete any of them the process is timing out.

    The vendrOrder table currently has 13,760,716 rows in it, which is what I assume is causing the issue.

    Do you have any suggestions?

    Thanks,

    Paul.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 10, 2021 @ 08:42
    Matt Brailsford
    0

    Hi Paul,

    Wow! That doesn't sound right.

    Whilst you haven't been accepting orders, have you been allowing people to make carts? If not, it sounds like there may be something wrong in your implementation potentially creating carts when one isn't needed. Generally speaking, you only really want to create a cart the first time someone adds an item to the cart.

    For you to have that many lines in the order table would suggest something is making a lot of carts.

    Let me find a SQL script that should be able to clear everything out, but in the meantime you might want to review your code to see why it's created that many orders.

    Matt

  • Paul Crowdy 40 posts 111 karma points
    Nov 10, 2021 @ 08:46
    Paul Crowdy
    0

    Hi Matt,

    The "Add To Cart" functionality hasn't been live, but.... There is a "0 items in basket" message in the header, that is using "GetOrCreateCurrentOrder(storeId)", which I guess means that every user (and bot) will be creating an order. What would be a better method of doing this?

    Paul

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 10, 2021 @ 08:52
    Matt Brailsford
    0

    Hi Paul,

    You should really only be calling GetOrCreateCurrentOrder when you know you need to ensure an order exists, such as when you are adding items to a cart. For all other purposes where you are just displaying a current order, you should use GetCurrentOrder instead which will return null if one doesn't currently exists.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 10, 2021 @ 09:03
    Matt Brailsford
    0

    Ok, so I think this SQL statement should remove all your order entries

    DELETE FROM [vendrFrozenPrice];
    DELETE FROM [vendrOrderPriceAdjustment];
    DELETE FROM [vendrOrderAmountAdjustment];
    DELETE FROM [vendrOrderAppliedDiscountCode];
    DELETE FROM [vendrOrderAppliedGiftCard];
    DELETE FROM [vendrOrderLineAttribute];
    DELETE FROM [vendrOrderLineProperty];
    DELETE FROM [vendrOrderProperty];
    DELETE FROM [vendrOrderLine];
    DELETE FROM [vendrOrder];
    

    To be fair, given it's just empty cards, you could probably only need to do

    DELETE FROM [vendrOrder];
    

    There shouldn't really be any other data on the other tables, but I guess it's worth being thurough.

    Matt

  • Ali 32 posts 125 karma points
    Dec 07, 2022 @ 13:45
    Ali
    0

    Hi,

    I am getting error after deleting alle orders using the following query:

    DELETE FROM [vendrFrozenPrice];
    DELETE FROM [vendrOrderPriceAdjustment];
    DELETE FROM [vendrOrderAmountAdjustment];
    DELETE FROM [vendrOrderAppliedDiscountCode];
    DELETE FROM [vendrOrderAppliedGiftCard];
    DELETE FROM [vendrOrderLineAttribute];
    DELETE FROM [vendrOrderLineProperty];
    DELETE FROM [vendrOrderProperty];
    DELETE FROM [vendrOrderLine];
    DELETE FROM [vendrOrder];
    

    enter image description here

    Umbraco 10.3.1 and latest vendr:

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jan 03, 2023 @ 10:35
    Matt Brailsford
    0

    Hi Ali,

    This sounds like it's not actually to do with your orders being deleted. It looks like it's coming from loading your order editor config files. Have you modified these in any way as it looks like they may be invalid / corrupt JSON.

    You may want to double check your config files and make sure they are valid JSON.

    Hope this helps

    Matt

  • Ali 32 posts 125 karma points
    Jan 04, 2023 @ 10:21
    Ali
    0

    Hi Matt, You rock!

    Yes, I have added custom config files in App_Plugins\Vendr\ backoffice\config that caused the issue.

    I am wondering what is the correct way of customizing backoffice js/views in AppPlugins\Vendr? And I also have noticed that on project rebuild some custom files added in AppPlugins get removed.

    Best regards Ali

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jan 04, 2023 @ 10:39
    Matt Brailsford
    0

    Hi Ali,

    If you are writing your own custom JS you should be putting that in your own AppPlugins folder with your own package manifest to load it. Vendr auto copies over it's assets files every time you build so if you are storing them in the Vendr AppPlugins folder they will get replaced.

    Matt

  • Ali 32 posts 125 karma points
    Jan 11, 2023 @ 09:02
    Ali
    0

    Hi,

    I would like to customize some html/js files in Vendr in App_Plugins. How can I make my custom files in own folder, override html/js in Vendr folder?

    My changes below get replaced when rebuilding: enter image description here

    Thanks

    /Ali

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jan 11, 2023 @ 09:16
    Matt Brailsford
    0

    You'll probably need to look at using Angular interceptors / decorators to tweak the behaviour.

Please Sign in or register to post replies

Write your reply to:

Draft