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.
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?
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.
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.
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];
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.
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.
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.
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.
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
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
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 useGetCurrentOrder
instead which will returnnull
if one doesn't currently exists.Ok, so I think this SQL statement should remove all your order entries
To be fair, given it's just empty cards, you could probably only need to do
There shouldn't really be any other data on the other tables, but I guess it's worth being thurough.
Matt
Hi,
I am getting error after deleting alle orders using the following query:
Umbraco 10.3.1 and latest vendr:
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
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
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
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:
Thanks
/Ali
You'll probably need to look at using Angular interceptors / decorators to tweak the behaviour.
is working on a reply...