Jump to content

How to delete order statuses?


Recommended Posts

Go to Orders > Statuses and the click the X in the Actions column in the "Awaiting cheque payment" row. Be careful which statuses you delete though, since it will cause problems if PrestaShop tries to automatically switch to a status that you have deleted. This shouldn't be a problem if you don't use the cheque module though.

Link to comment
Share on other sites

It looks like your only option is to hide the status on the order page. You can do this by changing lines 469-470 of admin/tabs/AdminOrders.php (in PrestaShop v1.3.1) from:

foreach ($states AS $state)
   echo ''.stripslashes($state['name']).'';



to:

foreach ($states AS $state)
   if ($state['id_order_state'] != 1)
       echo ''.stripslashes($state['name']).'';

Link to comment
Share on other sites

  • 2 weeks later...
foreach ($states AS $state)
   if ($state['id_order_state'] != 1)
   if ($state['id_order_state'] != 10)                
echo '
$currentStateTab['id_order_state']) ? ' selected="selected"' : 

'').'>'.stripslashes($state['name']).'';



will block the cheque and bankwire i believe. the code worked for me. thanks rocky.

Link to comment
Share on other sites

That's great that it was useful for you. The following code would be better though:

foreach ($states AS $state)
   if ($state['id_order_state'] != 1 AND $state['id_order_state'] != 10)
       echo ''.stripslashes($state['name']).'';

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...

Anybody can help how to delete statuses. This code I change and do not work at me. I still can't delete statuses

1. For security reasons, you cannot delete default order statuses. - shown when I want ot delete some. I use only COD and want to delete paypal and chque

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 2 months later...
  • 6 months later...

In PS 1.5 you can hide statuses in the select of the order management page looking in:

 

AdminFolder/themes/default/template/controllers/orders/helpers/view.view.tpl

 

About line 114 you´ll find {if ($state['id_order_state'] .... and exclude the ids you want to hide (or directly type what statuses you want availables) Example:

 

Remove the code

{foreach from=$states item=state}
{if $state['id_order_state'] != $currentState->id}
<option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
{/if}
{/foreach}

 

And add your options manually

<select id="id_order_state" name="id_order_state">

			<option value="1">Sent</option>
			<option value="2">Cancelled</option>
			<option value="3">Preparing</option>
		   .....
</select>

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

  • 10 months later...

In PS 1.5 you can hide statuses in the select of the order management page looking in:

 

AdminFolder/themes/default/template/controllers/orders/helpers/view.view.tpl

 

About line 114 you´ll find {if ($state['id_order_state'] .... and exclude the ids you want to hide (or directly type what statuses you want availables) Example:

 

Remove the code

{foreach from=$states item=state}
{if $state['id_order_state'] != $currentState->id}
<option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
{/if}
{/foreach}
And add your options manually

<select id="id_order_state" name="id_order_state">
						  
				<option value="1">Sent</option>
				<option value="2">Cancelled</option>
				<option value="3">Preparing</option>
			   .....
</select>

That is not a solve, because if you add yor own order state, it will not display too.

Link to comment
Share on other sites

  • 9 months later...

Bom dia.

 

Se você alterar a coluna "unremovable" dentro do banco de dados, trocando o valor "1" para "0", você conseguirá deletar o status dentro do BO.

 

------------------

 

Good day.

If you change the "unremovable" column in the database, changing the value "1" to "0", you will delete the status within the BO.

Link to comment
Share on other sites

It looks like your only option is to hide the status on the order page. You can do this by changing lines 469-470 of admin/tabs/AdminOrders.php (in PrestaShop v1.3.1) from:

 

foreach ($states AS $state)    echo '<option value="'.$state['id_order_state'].'"'.(($state['id_order_state'] == $currentStateTab['id_order_state']) ? ' selected="selected"' : '').'>'.stripslashes($state['name']).'</option>';

to:

 

foreach ($states AS $state)    if ($state['id_order_state'] != 1)        echo '<option value="'.$state['id_order_state'].'"'.(($state['id_order_state'] == $currentStateTab['id_order_state']) ? ' selected="selected"' : '').'>'.stripslashes($state['name']).'</option>';

 

 Thank you very much, it's perfect in ps 1.4.9 :)

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...
  • 3 years later...

ps version: 1.7 (maybe other versions too)

I've found a way that I've not fully tested but which I presume is pretty harmless!

If you have database access, on the:

ed_order_state

table, there is a 'deleted' column - kinda like a 'soft delete' - you can cross reference the id_order_state with the:

ed_order_state_lang

table to see the label of the order status and then enter '1' in the relevant record's 'deleted' column.

It can be easily undone by changing back to a zero.

Screenshot 2019-01-24 at 05.31.51.png

Screenshot 2019-01-24 at 05.31.31.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...