Jump to content

Help: Looking to delete all orders and start again


Recommended Posts

or, and I don't recommend this after you have established your shop.

 

in your admin folder/AdminOrders.php

class AdminOrders extends AdminTab
{
public function __construct()
{
 global $cookie;
  $this->table = 'order';
  $this->className = 'Order';
  $this->view = true;
 $this->colorOnBackground = true;
 $this->delete = true;

 

add the last line '$this->delete = true;'

 

then go to your orders, and you will see the trashcan

  • Like 1
Link to comment
Share on other sites

or, and I don't recommend this after you have established your shop.

 

in your admin folder/AdminOrders.php

class AdminOrders extends AdminTab
{
public function __construct()
{
 global $cookie;
  $this->table = 'order';
  $this->className = 'Order';
  $this->view = true;
 $this->colorOnBackground = true;
 $this->delete = true;

 

add the last line '$this->delete = true;'

 

then go to your orders, and you will see the trashcan

 

 

Thanks for the replies,

 

Regarding this, the website isnt really established as I've only been trading through ebay and had a couple of sales through the website with some test orders there.

So I'm looking to delete the orders so the website can start from fresh.

Link to comment
Share on other sites

or, and I don't recommend this after you have established your shop.

 

in your admin folder/AdminOrders.php

class AdminOrders extends AdminTab
{
public function __construct()
{
 global $cookie;
  $this->table = 'order';
  $this->className = 'Order';
  $this->view = true;
 $this->colorOnBackground = true;
 $this->delete = true;

 

add the last line '$this->delete = true;'

 

then go to your orders, and you will see the trashcan

 

 

Thanks but where do i find the admin orders?

 

Thanks,

Link to comment
Share on other sites

If you have a bunch of orders to delete I recommend running a query on your database to delete the orders (as tomer suggested) but if you only have a couple of orders and don't really understand how to run queries on databases then I suggest you use elpatron's method. To be a little more specific the file you will be looking for is found in youradminfolder/tabs/AdminOrders.php.

 

I would suggest that you remove the line of code after deleting the orders.

 

Marty Shue

Link to comment
Share on other sites

I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong?

 

I run the follow:

 

TRUNCATE TABLE `ps_customer`;

TRUNCATE TABLE `ps_customer_group`

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`;

Link to comment
Share on other sites

  • 4 months later...

I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong?

 

I run the follow:

 

TRUNCATE TABLE `ps_customer`;

TRUNCATE TABLE `ps_customer_group`

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`;

 

Missing semi-colon at end of the second line most probably.

 

fyi You might also want to check your table prefix. In the older versions of PrestaShop, tables began with "ps_" as shown above. In later versions I believe they have changed to "pr_" so just check it and change the above query accordingly.

Edited by TWDesign (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 5 weeks later...
  • 5 weeks later...

hi all, ive had a few orders but since re-stocking, i'm looking to delete the orders that are currently in the database.

 

How could I do this please?

 

Thanks,

 

Option 2: For the sake of PHP

Go to AdminOrders.php class in admin\tabs\AdminOrders.php

At line 25 look for

 

 

global $cookie, $currentIndex;

And add this at line 32

 

 

$this->delete = true;

Link to comment
Share on other sites

  • 1 month later...

Option 2: For the sake of PHP

Go to AdminOrders.php class in admin\tabs\AdminOrders.php

At line 25 look for

 

 

global $cookie, $currentIndex;

And add this at line 32

 

 

$this->delete = true;

 

I can't find AdminOrders.php on my ftp, maybe it's because of the version of PS? Mine is 1.5.1.

 

Does anyone know if it is anywhere else?

 

Thanks

Link to comment
Share on other sites

  • 1 month later...

http://prestashop.ca...abula-rasa.html

 

When can we expect a PS 1.5 release of this module?

 

Thanks

 

I wish I had an answer for that. Right now with our current project load it has been slow going on upgrading the existing modules. We have a few very exciting modules under development that will be released soon on our module store. 1.5.x compatible modules will also be posted on our website.

 

Marty Shue

Link to comment
Share on other sites

  • 2 months later...

I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong?

 

I run the follow:

 

TRUNCATE TABLE `ps_customer`;

TRUNCATE TABLE `ps_customer_group`

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`;

 

Deleting test-orders is really really really annoying in Prestashop!

I've be looking for a 'clean' solution for what feels like a week now but without success.

 

I'd like to have a clean database and no corrupt data so I don't want the solution with editing the Admin-Controller or use the URL-One-Liner.

 

I thought it would be a good idea to use some of the modules arround but sorry, I've tried three and they were all crap. None of theme deleted all tables, every single module missed the one or the other table.

 

Finally I have decided to write a module for myself or to write a small sql-function.

 

I just like to know if I have missed any table for this issue. Is there any full list of all tables that are storing order-data for Presta-Shop 1.5.3?

 

If I am right this should be following tables:

 

ps_orders
ps_order_carrier
ps_order_cart_rule
ps_order_detail
ps_order_detail_tax
ps_order_history
ps_order_invoice
ps_order_invoice_payment
ps_order_invoice_tax
ps_order_message
ps_order_message_lang
ps_order_payment
ps_order_return
ps_order_return_detail
ps_order_slip
ps_order_slip_detail

 

I'm not sure about these ones:

ps_order_return_state
ps_order_return_state_lang
ps_order_state
ps_order_state_lang

 

 

Any help and/or comments are greatly welcome

Edited by Rahvin (see edit history)
Link to comment
Share on other sites

  • 4 months later...

ps_order_return_state
ps_order_return_state_lang
ps_order_state
ps_order_state_lang

 

these tables refer to the order state,

if you haven't added information with your own tests,

by default non demo-order information is contained.

Link to comment
Share on other sites

×
×
  • Create New...