Hello, Guest |
| Register
Remember me Forgot password ?
Site Map Site Map Contact us Contact us
PrestaShop
  537 users online
Forum  >  English Forum  >  General discussion  >  Thread

 
Post Reply
New Topic
[Solved] Deleting test orders

offline
Posted: 16 November 2008 03:39 PM   [ Ignore ]
Apprentice
RankRank
Avatar

Messages :

  • total: 35
  • last 7 days: 0
Joined: 2008-10-25

Hi,

I set up prestashop and modified according to the needs of our business. However, during modification i made too many test orders (more than 100). Thus, i want to delete orders without any trace or causing misbehavior in scripts. Database index number can be at its last value there is no problem with index. Could you offer me a way ?

Regards,
Ali

 
offline
Posted: 21 November 2008 10:23 PM   [ Ignore ]   [ # 1 ]
Apprentice
RankRank
Avatar

Messages :

  • total: 35
  • last 7 days: 0
Joined: 2008-10-25

I have been looking for an answer from an expert

 
prestateam offline
Posted: 21 November 2008 10:50 PM   [ Ignore ]   [ # 2 ]
PrestaTeam

Avatar


Hi debugginglife!

We already replied thousand of time to that question.
Please do a search inside the forum.

 Signature 

Matthieu BiartCore developer | Développeur coeurPrestaShop
Help PrestaShop, make a donation! • Aidez la communauté, soumettez vos rapports de bug uniquement en anglais

 
offline
Posted: 21 November 2008 11:47 PM   [ Ignore ]   [ # 3 ]
Apprentice
RankRank
Avatar

Messages :

  • total: 35
  • last 7 days: 0
Joined: 2008-10-25

Hi,

As a conclusion from the previous messages, it is obvious that there is no X button for deleting order in back office. However, i am looking for some database editing ( with a tool like phpmyadmin or else), here can be some experts who did such changes before. If i delete both customer and its orders from database, will the script misbehave?

Not being able to delete an order is a good feature to prevent the store form theft or lose of information, but there could be a manual method to remove test orders or bad orders ( like orders from some hacking attempts)

 
offline
Posted: 23 November 2008 11:18 AM   [ Ignore ]   [ # 4 ]
Senior Member
RankRankRank

Messages :

  • total: 429
  • last 7 days: 1
Joined: 2008-07-23

First – all orders need to stored! This is like accounting program, where You need to store all information. When You don’t need this order, then You can cancel that.

But when You still want delete orders – then You can do that at database. Look tables orders and order* tables.

 Signature 

The Box said Windows XP or better!
So I installed Linux

PrestaPortal- Presta themes, modules, tricks etc

 
offline
Posted: 25 November 2008 04:02 PM   [ Ignore ]   [ # 5 ]
Regular
RankRank

Messages :

  • total: 77
  • last 7 days: 0
Joined: 2008-09-13

i want to delete test orders too. .what table in mysql??

 
offline
Posted: 26 November 2008 02:22 PM   [ Ignore ]   [ # 6 ]
Senior Member
RankRankRank

Messages :

  • total: 324
  • last 7 days: 0
Joined: 2008-03-19

delete from ps_cart;
delete from ps_cart_product;
delete from ps_message;
delete from ps_order_detail;
delete from ps_order_history;
delete from ps_orders;

i’m not responsible if it doesn’t work as expected.
you must create a DB backup before executing this sql commands.

but:
worked for me wink

 
offline
Posted: 30 January 2009 01:41 PM   [ Ignore ]   [ # 7 ]
Apprentice
RankRank

Messages :

  • total: 46
  • last 7 days: 0
Joined: 2009-01-24

Matthieu Biart - 21 November 2008 10:50 PM
Hi debugginglife!

We already replied thousand of time to that question.
Please do a search inside the forum.

Sorry for bringing up this old thread – but I just had to comment.

You say “thousand of time”? That’s the overstatement of the decade. I search for “delete order” and got 72 hits – and four of them was directly related to my search.

If only people who know where to find information replyed, the web would be faster. If you don’t have anything useful to say – don’t say it!

The challenge with forums like this is that there are people from all over the world using it. The spoken languages are many, and not all understand or writes english (or french for that matter) that well – me included!

A little help and understanding is all that is needed for people to smile. And this software is all about smiling, because it’s GREAT! smile

 Signature 

Regards
Kyrre

 
offline
Posted: 23 May 2009 08:27 PM   [ Ignore ]   [ # 8 ]
Club Member
RankRankRank

Messages :

  • total: 125
  • last 7 days: 0
Joined: 2009-03-18

u can use this sql querry but before that you must create a backup

TRUNCATE `ps_orders`;
TRUNCATE `ps_order_customization_return`;
TRUNCATE `ps_order_detail`;
TRUNCATE `ps_order_discount`;
TRUNCATE `ps_order_history`;
TRUNCATE `ps_order_message`;
TRUNCATE `ps_order_message_lang`;
TRUNCATE `ps_order_return`;
TRUNCATE `ps_order_return_detail`;
TRUNCATE `ps_order_return_state`;
TRUNCATE `ps_order_return_state_lang`;
TRUNCATE `ps_order_slip`;
TRUNCATE `ps_order_slip_detail`;
TRUNCATE `ps_order_state`;
TRUNCATE `ps_order_state_lang`;

warning this deletes all orders and dont expand which is real order which is for test.

 Signature 

PRESTASHOP Hosting Nerden Alınır ?

prestashop400x80.jpg

ÜCRETSİZ SANAL POS ! Tüm Bankalar..

PRESTASHOP TÜRKİYE Türkçe Destek Sitesi

prestashoptr-logo.png
 
offline
Posted: 06 August 2009 12:01 AM   [ Ignore ]   [ # 9 ]
Regular
RankRank
Avatar

Messages :

  • total: 86
  • last 7 days: 0
Joined: 2009-07-17

Thank you mahmutta, that worked for me!
After going back to do some more test orders I received “invalid order state” in the store front, and no orders show in the BO.

Thats because the SQL query above empties 2 important tables

TRUNCATE `ps_order_state`;
TRUNCATE `ps_order_state_lang`;

I’m still testing this, but I’d also add the below to the query above

TRUNCATE `ps_message`;

And remember if you get a mysql error, check your table prefix!

 Signature 

ShaiPerednik.com

 
offline
Posted: 06 August 2009 01:13 AM   [ Ignore ]   [ # 10 ]
Regular
RankRank
Avatar

Messages :

  • total: 86
  • last 7 days: 0
Joined: 2009-07-17

Sorry for a duplicate post, but heres the SQL query that does work, tested 10 times over

TRUNCATE `ps_orders`;
TRUNCATE `ps_order_customization_return`;
TRUNCATE `ps_order_detail`;
TRUNCATE `ps_order_discount`;
TRUNCATE `ps_order_history`;
TRUNCATE `ps_order_message`;
TRUNCATE `ps_order_message_lang`;
TRUNCATE `ps_order_return`;
TRUNCATE `ps_order_return_detail`;
TRUNCATE `ps_order_return_state`;
TRUNCATE `ps_order_return_state_lang`;
TRUNCATE `ps_order_slip`;
TRUNCATE `ps_order_slip_detail`;
TRUNCATE `ps_message`;
TRUNCATE `ps_cart`;
TRUNCATE `ps_cart_product`;

as mahmutta said, this will delete ALL ORDERS!!!
this will NOT delete customers. but that can be done through the BO.

Also, remeber that some modules use there own tables with order id relations, so be sure to check on those.

 Signature 

ShaiPerednik.com

 
offline
Posted: 07 August 2009 09:48 PM   [ Ignore ]   [ # 11 ]
Regular
RankRank
Avatar

Messages :

  • total: 86
  • last 7 days: 0
Joined: 2009-07-17

I put together a module just for this purpose
http://www.prestashop.com/forums/viewthread/24710/

 Signature 

ShaiPerednik.com

 
offline
Posted: 04 May 2010 10:22 AM   [ Ignore ]   [ # 12 ]
Club Member
RankRankRank

Messages :

  • total: 125
  • last 7 days: 0
Joined: 2009-03-18

OK
1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor.
2-) Find this code about 25th line

$this->colorOnBackground true;

3-) After this add this line
$this->delete true;

Thats all
Now you can delete any of orders at back office regular wink
i recomend add // comment start of the added line after delete

 Signature 

PRESTASHOP Hosting Nerden Alınır ?

prestashop400x80.jpg

ÜCRETSİZ SANAL POS ! Tüm Bankalar..

PRESTASHOP TÜRKİYE Türkçe Destek Sitesi

prestashoptr-logo.png
 
 
 
Fast Reply
New Topic