uddhava Posted June 6, 2010 Share Posted June 6, 2010 I have been breaking my head over this "reasoning" but i couldnt.Why is the Deleting of orders by default Disabled???Has it something to do with the stats?Has it something to do with protecting?Why oh why ?If you want to enable the deletion of orders in the BO then you have to edit /admin/tabs/AdminOrders.php.Rocky has commented about it in this thread already, but here it is again:The first way you could do it is to open tabs/AdminOrders.php in your renamed admin directory, then find this line (it should be line 23): $this->colorOnBackground = true; Then copy the below line on a new line after it: $this->delete = true; You can then go to the Order tab as usual and a delete button should appear for each order. Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 I think this was done for accounting reasons. You should keep a record of every order that has ever been made for tax purposes. Link to comment Share on other sites More sharing options...
Sultan Posted June 7, 2010 Share Posted June 7, 2010 I think this was done for accounting reasons. You should keep a record of every order that has ever been made for tax purposes. Yes you are right rocky,However, new stores always need to make some tests for order to make sure everything is working as it should. Even old stores or stores that are in the business for a while, sometimes they need to test new payment methods, changes, or whatever... so they have to create fake orders!It is just good that we can delete orders by editing some line of the codes. However, it is much better if we can have an option where we can define cretin numbers of orders as test orders so the system will not count them for accounting purposes.Personally, I don't like to have the option to delete orders from the BO. Simply because the high risk of deleting a real order by mistake! So, I prefer to have the option to set an order as a test or real order in the BO.Even if we set a real order as a test order we will be able to set it back as real order in one click. But once it's deleted... there is no way to get it back... unless restoring it from a DB backup file! Link to comment Share on other sites More sharing options...
uddhava Posted June 7, 2010 Author Share Posted June 7, 2010 I understand the reasoning to keep records for tax purposes. Here in holland you are required to keep records for 7 years. But sometimes orders need to be deleted just to make the bookkeeping correct.And test orders also need to be deleted otherwise is messus up the records AND the statistics.I think the main reason to not enable deleting the orders is the statistics.I know that you can delete an order by accident, especially because the button is so close to the view button.But you have to actually click twice to delete an order. That does not happen accidentally.If that is what you worry about, then the same goes for deleting a product, or worse, deleting a category..... It is my suggestion that we get an option in the preferences > Products to enable/disable it. Link to comment Share on other sites More sharing options...
Sultan Posted June 8, 2010 Share Posted June 8, 2010 ...It is my suggestion that we get an option in the preferences > Products to enable/disable it.... I agree, we need this tooThanks Link to comment Share on other sites More sharing options...
Drorli Posted July 7, 2010 Share Posted July 7, 2010 And how can i do that, edit the php file, on PrestBox shop? Link to comment Share on other sites More sharing options...
uddhava Posted July 7, 2010 Author Share Posted July 7, 2010 The first way you could do it is to open tabs/AdminOrders.php in your renamed admin directory, then find this line (it should be line 23): $this->colorOnBackground = true; Then copy the below line on a new line after it: $this->delete = true; You can then go to the Order tab as usual and a delete button should appear for each order.(Thanks to Rocky) Link to comment Share on other sites More sharing options...
rocky Posted July 7, 2010 Share Posted July 7, 2010 PrestaBox users don't have access to the code, so they can't do that. I think there is a module that lets you run SQL queries from the Back Office. You could try installing that using the "Add new module" option on the Modules tab. Link to comment Share on other sites More sharing options...
siviwe Posted July 8, 2010 Share Posted July 8, 2010 how can i include the same delete button in the front end instead of putting in the back only? Link to comment Share on other sites More sharing options...
snco Posted July 10, 2010 Share Posted July 10, 2010 Hello uddhava,Believe me or not, You just save my miserable not finished shop.It is hard to explain, but your post title, triggered my attention to check your post, to make this modification in order to delete some test orders, which gave another idea, to cancel broken order, which brokes all my Order history, and finally after that everything is again normal, visible and accessible and Deleted So, I thank you for your wonderful modification and your energy which came to me after I was almost decided to gave up.(bow)Regards,Alex Link to comment Share on other sites More sharing options...
snco Posted July 10, 2010 Share Posted July 10, 2010 As we speak for deleting orders, Is it possible to delete carts, which actually are not converted to orders ?ThanksAlex Link to comment Share on other sites More sharing options...
Pixel Posted July 24, 2010 Share Posted July 24, 2010 Bear in mind this extra line of code doesn't remove the details of the order from ALL of the order-related tables - such as order_history, order_detail etc.It only removes (it seems) the data from the orders table, so if you use it, you'll then have a lot of orphaned data in the other tables that won't be linked to an order_id. Link to comment Share on other sites More sharing options...
darren62 Posted August 19, 2010 Share Posted August 19, 2010 There simply has to be an option to delete orders and clear the dB of the orders and any unwanted carts as well.To just leave all of these in the dB is crazy in IMO. We all clean our PC's of any unwanted folders, files or cookies etc. and the otion to delete unwanted carts, orders, customers, in fact anything you want from your dB should be there.Sorry but anyone using PS as an accounts package to keep records of orders must be mad. I use an accounts package for my accounts and PS for selling on the Internet. I don't go sailing in my car so why should I use PS for accounting?Does anyone know of a mod that actually allows you to delete information from dB's becasue PS is the first cart I have used that doesn't give you the option to delete information from your dB.For busy shops and even quiet shops, over time you will have one massive dB if it can't be purged. Link to comment Share on other sites More sharing options...
rocky Posted August 20, 2010 Share Posted August 20, 2010 It looks like this may be improved in PrestaShop v1.4: We need improve our historization system on many points. This improvement is going to make a change in behaviour, we can’t fix these problems on 1.3 version. We are going to work for improve this, on 1.4 version.[/code] Link to comment Share on other sites More sharing options...
ENK Posted December 7, 2010 Share Posted December 7, 2010 Rocky,Where is the add new module option for Prestabox users? I don't see it anywhere on the modules page.Thanks in advance! Link to comment Share on other sites More sharing options...
rocky Posted December 8, 2010 Share Posted December 8, 2010 There is none. PrestaBox users must download modules through the "PrestaShop Add-ons" website. Link to comment Share on other sites More sharing options...
Recommended Posts