[Solved] How to reset or delete all orders and customers? - Installing PrestaShop for the first time - PrestaShop

Jump to content

Photo

[Solved] How to reset or delete all orders and customers?

#1

Posted 16 December 2008 - 10:39 AM

mcfreedom

    PrestaShop Newbie

  • Members
  • Pip
  • 3 Active Posts
I want to reset or delet all test orders and customers. So I want to clean all data, to start new year with clean database

#2

Posted 16 December 2008 - 10:46 AM

Bruno Leveque

    PrestaShop Founder

  • PrestaShop Team
  • 1234 Active Posts
Hi,

You can delete customers via your admin panel, you can also truncate MySQL tables:

TRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;

Bruno Leveque
Founder


#3

Posted 16 December 2008 - 10:50 AM

mcfreedom

    PrestaShop Newbie

  • Members
  • Pip
  • 3 Active Posts
but orders? I want to reset, but not reinstall

#4

Posted 16 December 2008 - 11:01 AM

Bruno Leveque

    PrestaShop Founder

  • PrestaShop Team
  • 1234 Active Posts
Orders will be reseted too with the code above

Bruno Leveque
Founder


#5

Posted 21 December 2008 - 01:11 AM

TRUTHSEEKER

    PrestaShop Apprentice

  • Members
  • PipPip
  • 25 Active Posts
hi where do i put this code in phpmyadmin or in mysql command line???
Jessica Pleasure
Here you will find a huge range of Adult Sex Toys in various shapes and sizes and for various different sexual appetites We're Sure you'll find something to tease or please here.

#6

Posted 21 December 2008 - 12:12 PM

TropischBruin

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2199 Active Posts

Hi,

You can delete customers via your admin panel, you can also truncate MySQL tables:

TRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;



Will the ordernumber ect. start with 000001 again because I think this is what most of us want after testing ;-)
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#7

Posted 21 December 2008 - 11:26 PM

cspringer

    PrestaShop Newbie

  • Members
  • Pip
  • 16 Active Posts
Yeah, me too! The whole reset and deletion seems to be pretty necessary for those of us who like to keep things clean at any given time!

#8

Posted 22 December 2008 - 07:15 AM

TropischBruin

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2199 Active Posts
Found it!

After running the above code you should go to Orders > Invoices to set invoice number and prefix.
The same goes for the Packingslip.

Al I need to find out is how te reset the Creditslips.
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#9

Posted 22 December 2008 - 12:27 PM

TRUTHSEEKER

    PrestaShop Apprentice

  • Members
  • PipPip
  • 25 Active Posts
where do i put the code in as i asked in previous post please!!!!!!!!!!!!!!!!
Jessica Pleasure
Here you will find a huge range of Adult Sex Toys in various shapes and sizes and for various different sexual appetites We're Sure you'll find something to tease or please here.

#10

Posted 22 December 2008 - 03:30 PM

BOIK

    PrestaShop Newbie

  • Members
  • Pip
  • 18 Active Posts
@TRUTHSEEKER

When your in phpMyAdmin, on the left side choose the database you want to truncate. Now you get a diferent window an you have tabs on the top of the page... Click on the SQL tab (second from the left?) and paste the code there and click run or execute (bottom right corner).

Hope this helps.

#11

Posted 23 December 2008 - 07:03 PM

TRUTHSEEKER

    PrestaShop Apprentice

  • Members
  • PipPip
  • 25 Active Posts
many thanks boik worked perfectly
Jessica Pleasure
Here you will find a huge range of Adult Sex Toys in various shapes and sizes and for various different sexual appetites We're Sure you'll find something to tease or please here.

#12

Posted 09 March 2009 - 05:42 PM

Bleep

    PrestaShop Enthusiast

  • Members
  • PipPip
  • 151 Active Posts
Is it possible to just delete the sample order? I already have about 10 orders, and don't want to reset as I will loose this information. I need to just remove the sample order so that the stats in my store gives the correct information. Please help! Thank you!
I saw a psychologist when I was younger and she accused me of being a drinker. "How outrageous!" I proclaimed. "I'm not a drinker, I'm a drunk, there's a big difference." Dismayed with my lack of maturity and seriousness and unwilling to accept defeat, she quoted the following: "50% of all automobile accidents are caused by drunk drivers." Unimpressed with this statistic, I flatly retorted, "Apparently, the sober ones aren’t doing that well either.” End of therapy.

#13

Posted 09 March 2009 - 06:16 PM

TropischBruin

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2199 Active Posts

Is it possible to just delete the sample order? I already have about 10 orders, and don't want to reset as I will loose this information. I need to just remove the sample order so that the stats in my store gives the correct information. Please help! Thank you!



If you would have used the search you would have know you need to do that directly in your database via phpMyAdmin.
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#14

Posted 15 March 2009 - 02:21 AM

Bleep

    PrestaShop Enthusiast

  • Members
  • PipPip
  • 151 Active Posts
Thanks for your help, don't know what I would have done without it!

Is it possible to just delete the sample order? I already have about 10 orders, and don't want to reset as I will loose this information. I need to just remove the sample order so that the stats in my store gives the correct information. Please help! Thank you!



If you would have used the search you would have know you need to do that directly in your database via phpMyAdmin.


I saw a psychologist when I was younger and she accused me of being a drinker. "How outrageous!" I proclaimed. "I'm not a drinker, I'm a drunk, there's a big difference." Dismayed with my lack of maturity and seriousness and unwilling to accept defeat, she quoted the following: "50% of all automobile accidents are caused by drunk drivers." Unimpressed with this statistic, I flatly retorted, "Apparently, the sober ones aren’t doing that well either.” End of therapy.

#15

Posted 17 March 2009 - 05:54 PM

Scubasjl

    PrestaShop Newbie

  • Members
  • Pip
  • 21 Active Posts
Is their a way to do it from the back office/admin due to some of my clients don't know how to use phpmyadmin or willing to learn.

#16

Posted 10 August 2009 - 10:15 PM

john.e.perkin

    PrestaShop Newbie

  • Members
  • Pip
  • 6 Active Posts
Got it, here's how you do it, you need this code... ...you need to be logged in too.

yourshop.fr/your-admin-folder/index.php?tab=AdminOrders&id_order=1&deleteorder;&token;=

Now, go on to the orders page and open the sample order, the link will be something like

http://bluecowcables...12339x567c0e9kq

after putting your site address and admin folder into my link, you need to cut and paste the security token from your order onto your link and then cut and paste the whole thing into your browser.

You should have this...

yourshop.fr/your-admin-folder/index.php?tab=AdminOrders&id_order=1&deleteorder&token;=f62930bu9214d96112339x567c0e9kq

You can change the "&id;_order=" value to the number of the order you wish to delete.


I hope this helps,
John Perkin
www.bluecowcables.com

#17

Posted 05 September 2009 - 11:59 AM

Sekuta

    PrestaShop Newbie

  • Members
  • Pip
  • 5 Active Posts

Got it, here's how you do it, you need this code... ...you need to be logged in too.

yourshop.fr/your-admin-folder/index.php?tab=AdminOrders&id_order=1&deleteorder;&token;=

Now, go on to the orders page and open the sample order, the link will be something like

http://bluecowcables...12339x567c0e9kq

after putting your site address and admin folder into my link, you need to cut and paste the security token from your order onto your link and then cut and paste the whole thing into your browser.

You should have this...

yourshop.fr/your-admin-folder/index.php?tab=AdminOrders&id_order=1&deleteorder;&token;=f62930bu9214d96112339x567c0e9kq

You can change the "&id;_order=" value to the number of the order you wish to delete.


I hope this helps,
John Perkin
www.bluecowcables.com



or just replace vieworder by deleteorder ;)
it works!

#18

Posted 28 December 2009 - 04:29 PM

kesit

    PrestaShop Newbie

  • Members
  • Pip
  • 9 Active Posts

Hi,

You can delete customers via your admin panel, you can also truncate MySQL tables:

TRUNCATE TABLE `ps_customer`;TRUNCATE TABLE `ps_address`;TRUNCATE TABLE `ps_orders`;TRUNCATE TABLE `ps_order_detail`;TRUNCATE TABLE `ps_order_discount`;TRUNCATE TABLE `ps_order_history`;TRUNCATE TABLE `ps_message`;TRUNCATE TABLE `ps_cart`;TRUNCATE TABLE `ps_cart_product`;TRUNCATE TABLE `ps_cart_discount`;



After I run this SQL command, all my data is succesfully deleted. But somehow, I can't create any customer again.

Anybody can help?

the message is:
There is 1 error :

1. an error occurred while creating your account


ps: I still run for my test site, so the customer was created by myself.

#19

Posted 30 December 2009 - 12:27 AM

KyferEz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 32 Active Posts
kesit: It's likely the script had an error, Try running it again and this time note if it has an error. If so, post that back here.


Sekuta was correct, it's far easier to change vieworder to deleteorder. I didn't understand him at first, so I'll make it real simple to help others out there:
1) Go to the Orders Tab
2) Click on an order
3) In your browser's address bar, you now have an address like this: http://www.yoursite....7a1fe919ec65bc5
4) See vieworder in that address I showed you? Simply find that in your address bar and change vieworder to deleteorder and then press enter. Order is now gone!

Note: This forum adds semicolons (;) to the path I pasted here. Don't let that mess you up. There should be no ; in the address bar path.

#20

Posted 30 December 2009 - 03:37 AM

kesit

    PrestaShop Newbie

  • Members
  • Pip
  • 9 Active Posts
@kyferez: may i know which script do you suggest to run again? is it the sql or creating account module?

if it's creating account modul, i already tried to run it again and again...but nothing change, still "an error occurred while creating your account" message

if it's the sql command, nothing faulty message:
TRUNCATE TABLE `ps_customer`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_address`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_orders`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_order_detail`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_order_discount`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_order_history`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_message`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_cart`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_cart_product`;# MySQL returned an empty result set (i.e. zero rows).

TRUNCATE TABLE `ps_cart_discount`;# MySQL returned an empty result set (i.e. zero rows).


If it help with a clue, when i try to register...this will be happened:
- ps_customer will successfully create data
- ps_cart will create data, but with wrong id_customer and/or id_guest


hope it'll help you to help me.....

thanks for reply

and sorry for thread starter since i just seem to hack your topic....


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more