Jump to content

Hiding order status from order dropdown.


Recommended Posts

Hello.

 

I understand that from security reasons I am not allowed to delete a order status.

 

But I want to hide iti from being set as a status by a employer which has access to the orders sections.

 

I want to not have to choose from something that's not used.

 

Any ideas ?

 

Using prestashop 1.6.1.3

 

Regards.

Link to comment
Share on other sites

Do you want to add specific ones?
Once you know the id, you can hide them here
 

{foreach from=$states item=state}
<option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
{/foreach}

Just don't return the option if the id equals the one you want to hide

The file is 
 
admin folder \themes\default\template\controllers\orders\helpers\view view.tpl
  • Like 1
Link to comment
Share on other sites

  • 7 months later...

{if $state['id_order_state'] == 10} {continue} {else}

 

... code...

 

{/if}

Thanks for your answer. I will post here the explicit and full code for other people that will need to hide the Order status from the select option list in edit Order page.

 

Step 1. Go to Orders --> Statuses (in the left side menu of the administraton pannel) to find out the ID of the statuses you wish to hide

 

Step 2. Go to Admin Folder/themes/default/template/controllers/orders/helpers/view view.tpl

 

Step 3. Add the following code instead of the existing one:

         

CHANGE THIS:

{foreach from=$states item=state}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
{/foreach}
 
TO THIS:

{foreach from=$states item=state}
                                        {if $state['id_order_state'] == 11 || $state['id_order_state'] == 1 || $state['id_order_state'] == 10 || $state['id_order_state'] == 14 || $state['id_order_state'] == 12 || $state['id_order_state'] == 13 || $state['id_order_state'] == 8} <!--for multiple values-->
                                              {else}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
                                        {/if}
{/foreach}

 

Note: The values entered there are for my own use. You will change those values with yours. If you only need to hide one Status, let the if clause like this: {if $state['id_order_state'] == 11} 

 

I'm using this with succes in Prestashop 1.6.1.0 with no reported issues. Thanks again for the answer that helped me solve this issue NemoPS Hope this detailed answer is not a problem, but I think the newbies will use this with more ease.

 

Thanks.

Edited by rempaddesign (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
On 1/19/2017 at 8:56 PM, lordshop said:

I am working on prestashop 1.6.11.

I went to table "ps_order_state" and I have update the "deleted" from 0 to 1 for the ID status I don't want to show up on Order update.

 

post-333998-0-67243900-1484866562_thumb.jpg

 

For me just work when delete all line of the status, via sql.

 

Thank you

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

  • 11 months later...
Op 28/11/2016 om 1:10 PM, rempaddesign zei:

Thanks for your answer. I will post here the explicit and full code for other people that will need to hide the Order status from the select option list in edit Order page.

 

Step 1. Go to Orders --> Statuses (in the left side menu of the administraton pannel) to find out the ID of the statuses you wish to hide

 

Step 2. Go to Admin Folder/themes/default/template/controllers/orders/helpers/view view.tpl

 

Step 3. Add the following code instead of the existing one:

         

CHANGE THIS:

{foreach from=$states item=state}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
{/foreach}
 
TO THIS:

 

{foreach from=$states item=state}
                                        {if $state['id_order_state'] == 11 || $state['id_order_state'] == 1 || $state['id_order_state'] == 10 || $state['id_order_state'] == 14 || $state['id_order_state'] == 12 || $state['id_order_state'] == 13 || $state['id_order_state'] == 8} <!--for multiple values-->
                                              {else}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
                                        {/if}
{/foreach}

 

Note: The values entered there are for my own use. You will change those values with yours. If you only need to hide one Status, let the if clause like this: {if $state['id_order_state'] == 11} 

 

I'm using this with succes in Prestashop 1.6.1.0 with no reported issues. Thanks again for the answer that helped me solve this issue NemoPS Hope this detailed answer is not a problem, but I think the newbies will use this with more ease.

 

Thanks.

It works also in 1.7.5 🙂

And where do I have to make those changes to hide the order status from order dropdown in the general orders page and for bulk actions on the same page?

 

 

Schermafbeelding 2019-02-14 om 22.31.39.png

Schermafbeelding 2019-02-14 om 22.32.02.png

Link to comment
Share on other sites

18 hours ago, Yves said:

It works also in 1.7.5 🙂

And where do I have to make those changes to hide the order status from order dropdown in the general orders page and for bulk actions on the same page?

 

 

Schermafbeelding 2019-02-14 om 22.31.39.png

Schermafbeelding 2019-02-14 om 22.32.02.png

Hi. Sorry for the late answer. You can find infos about Activate or Deactivate the order status and changes to those here: https://zemez.io/prestashop/support/how-to/prestashop-1-7-manage-order-statuses/

Hope it helps.
Cheers.

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...
On 11/28/2016 at 12:10 PM, rempaddesign said:

Thanks for your answer. I will post here the explicit and full code for other people that will need to hide the Order status from the select option list in edit Order page.

 

Step 1. Go to Orders --> Statuses (in the left side menu of the administraton pannel) to find out the ID of the statuses you wish to hide

 

Step 2. Go to Admin Folder/themes/default/template/controllers/orders/helpers/view view.tpl

 

Step 3. Add the following code instead of the existing one:

         

CHANGE THIS:

{foreach from=$states item=state}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
{/foreach}
 
TO THIS:

 

{foreach from=$states item=state}
                                        {if $state['id_order_state'] == 11 || $state['id_order_state'] == 1 || $state['id_order_state'] == 10 || $state['id_order_state'] == 14 || $state['id_order_state'] == 12 || $state['id_order_state'] == 13 || $state['id_order_state'] == 8} <!--for multiple values-->
                                              {else}
                                        <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|escape}</option>
                                        {/if}
{/foreach}

 

Note: The values entered there are for my own use. You will change those values with yours. If you only need to hide one Status, let the if clause like this: {if $state['id_order_state'] == 11} 

 

I'm using this with succes in Prestashop 1.6.1.0 with no reported issues. Thanks again for the answer that helped me solve this issue NemoPS Hope this detailed answer is not a problem, but I think the newbies will use this with more ease.

 

Thanks.

Thanks! but I've implemented this on Ps 1.7 and can't see the change, is there any cache I need to clear somehow?

Also where to do this exact same thing also inside an order? for when you want to change an order status within an order details page?

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

1 hour ago, DARKF3D3 said:

To clear cache you can remove or rename folder into this path: /var/cache

Ook now I see, thich change has affected orders.tpl but not in the orders-list page, so only when you open an order and whant to change the status (which was my second question! so this is partially solved for me already)

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

hello , I would like to know if it is possible to make sure that when the order status changes to "payment accepted" the "canceled" item is not visible. ex:

{if $state['id_order_state'] == 2} code that causes the "canceled" status to no longer be selected in the drop-down menu   {/if} 

please help me!

<select id="id_order_state" class="chosen form-control" name="id_order_state"    	  >
                    	
                    	 
                    	                       {foreach from=$states item=state}
                    	                       	
                      <option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} {  selected="selected"{/if}   
                     
                      {if $state['id_order_state'] == 2}  HERE {/if} 
                      
                      
                      
                      >{$state['name']|escape}</option>
       
                       
                    {/foreach}

 

Link to comment
Share on other sites

Hi,

I have an issue (Presta 1.7.5) where my fulfilment partner cannot push the order status changes to my shop (shipped,delivered etc).

I created an excel which constructs SQL to update the order status (and tracking numbers, but that's another story):

image.png.269a8978cc330ec6897677a7ba07a2b2.png

I then run these SQL queries every now and then to bring the statuses up to date.

I just noticed something weird, the statuses show as updated in the Orders view.

For example the order with id 984 shows correctly Shipped in the orders view:
image.thumb.png.bfdc76fcdf405ad40239a9cd2fce0806.png

But in the Order page, the status is still Payment Accepted AND the status Shipped is grayed out. And if I choose it and try to update the status to Shipped here, I get an error "The new order status is invalid". I guess part of the backoffice is correctly figuring out the status is already shipped, but why is the status not updating here...?

image.png.5d8393d0ab98d1bc594bb6fd37299848.png

 

 

image.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...