1

I am using Mangeto 1.9. I want to display in this menu: URL of the page:

www.yourmagento.com/index.php/admin/sales_order/index -

This is the orders view page, where you can see all your orders.

enter image description here

In this menu I want to display all custom created Order Statuses. Here is a screenshot from my Order Statuses page:

enter image description here

I found that all statuses are displayed in the Order View page under the History tab . Take a look: enter image description here

I found the file which is answering for the mass "Actions" menu and adding options in there.

Its' located here:

/public_html/beta/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php 

That's the code for 3 options in select menu:

    $this->getMassactionBlock()->addItem('pdfshipments_order', array(
         'label'=> Mage::helper('sales')->__('Print Packingslips'),
         'url'  => $this->getUrl('*/sales_order/pdfshipments'),
    ));

    $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
         'label'=> Mage::helper('sales')->__('Print Credit Memos'),
         'url'  => $this->getUrl('*/sales_order/pdfcreditmemos'),
    ));

    $this->getMassactionBlock()->addItem('pdfdocs_order', array(
         'label'=> Mage::helper('sales')->__('Print All'),
         'url'  => $this->getUrl('*/sales_order/pdfdocs'),
    ));

I am showing you the code for only 3 of them, I think there is no need to show all and make this post more largest then needed. From this code I understand that I have to write code for every custom order state.

My first question is: Is it possible to display all newly created order statuses automatically in this menu like it's happen in the menu of Order View page in the history tab.

I found the code which is answering for the options in the order view page in the history tab and there it is:

/public_html/beta/app/design/adminhtml/default/default/template/sales/order/view/history.phtml

and here is the code in this file which is calling the options:

        <select name="history[status]" class="select" id="history_status">
        <?php foreach (Mage::getSingleton('sales/order_config')->getStatuses() as $_code=>$_label): ?>
            <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
        <?php endforeach; ?>
        </select>

With this code all custom created Order statuses are displayed automatically in this page.

My second question is how I can make the same thing but for the mass Action select menu in the Orders / Sales page ? Is it possible ?

Thanks in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.