Magento - Sales > Order 'Processing' status - magento

Good morning,
We are currently using Magento and trying to list 'Processing' orders as default. We have located the status dropdown column but can't figure out how to set 'Processing' as default.
We would love some help on this,
Thank you.
$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
'width' => '70px',
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));

A little help from Amit Bera we managed to figure this out.
Open - app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
Find - parent::__construct(); and add underneath $this->setDefaultFilter(array('status'=>'processing'));
Worked like a charm.

Related

Magento backend listview pricerules

I have 300+ shopping cart price rules. I need to solve a problem that has to do with continue following rules . I would like in the overview in the backend add the column " stop rules Further processing". Where/how should I do that?
You need to rewrite the method
Mage_Adminhtml_Block_Promo_Quote_Grid::_prepareColumns()
In your new method you need to add something like this:
$this->addColumn('stop_rules_processing', array(
'header' => Mage::helper('salesrule')->__('Stop Rule'),
'align' => 'left',
'width' => '150px',
'index' => 'stop_rules_processing',
));
Don't forget, that magento strongly do not recommend to edit core files.

How to customize the database value in magento customer grid

I created new magento grid for customer module for special purpose.
In that there have a column usertype it have value as 0,1,2.
It will displayed in customer grid page as 0,1,2.
But i need to display if value is,
0 -> Inactive
1 -> Activated
2 -> Baned
How can i dothis?
This is my code grid.php in _prepareColumns() :
$this->addColumn('usertype', array(
'header' => Mage::helper('customer')->__('Usertype'),
'width' => '150',
'index' => 'usertype'
));
If this is possible in magento.
if your greed implements Mage_Adminhtml_Block_Widget_Grid I suggest you to modify
you addColumn call to
$this->addColumn('usertype',
array(
'header'=> Mage::helper('customer')->__('Usertype'),
'width' => '150px',
'index' => 'usertype',
'type' => 'options',
'options' => $values
));
Where $values should be formatted as
array( 'value_id' => 'value_label')
Now you have dropdown created with values.
Then update _prepareCollection() function and add attribute values to customer grid collection
$collection->joinAttribute('usertype', 'customer/usertype', 'entity_id', null, 'left');
I got the solution from this
By using rendere will help to load vlaues to each row.

Change Customer to Company on Magento Administrator Dashboard

On the Magento administrator Dashboard I'm looking to update the 'Last 5 Orders' block so that instead of displaying the customer name, it shows the company billing name instead.
My understanding is that this can't be done using the standard reports collection, I've seen examples for doing this on the main sales grid screen, but not on the dashboard. To add further complexity this is for the latest version of Magento 1.6.1.0 and it appears the method of doing this may have changed somewhere around 1.4.
The file I believe needs editing is:
app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php
Hopefully this is one of those 'easy when you know how' solutions that lots of people can benefit from.
Here is the code
PS : I haven't got time to test this code block.
The code block available in the :
app\code\core\Mage\Adminhtml\Block\Dashboard\Tab\Customers\Most.php
protected function _prepareColumns()
{
$this->addColumn('name', array(
'header' => $this->__('Customer Name'),
'sortable' => false,
'index' => 'name'
));
$this->addColumn('orders_count', array(
'header' => $this->__('Number of Orders'),
'sortable' => false,
'index' => 'orders_count',
'type' => 'number'
));
and here is the sample link that you can override the magento admin sales grid
Override Admin Sales Order Search Grid

Magento admin grid sending data from Action to Controller

I'm trying to write a custom action to run off of an admin grid that I have built. Is it possible to send a value from a column in the grid to the controller via either get or post?
I've tried googling, but I cannot find a proper explanation for this anywhere. A link to an explanation of the column settings ('getter', 'type' etc.) would also be useful if this is available.
Add this code to your Grid.php:
$this->addColumn('action',
array(
'header' => Mage::helper('yourmodulename')->__('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('yourmodulename')->__('Edit'),
'url' => array('base'=> '*/*/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
That will build an "Edit" URL with the Id of the selected row as part of the URL. It will look something like <frontname>/<controllername>/edit/id/<value> where value is returned by the getter getId().
The getter field will execute any of the standard Magento magic getters, ie any attribute is gettable. So you could have getName or getProductUrl or getIsLeftHanded if you wanted and your controller can parse the attribute.
The controller can then retrieve that passed value using Mage::app()->getRequest()->getParam('attributename');
In terms of documentation/tutorials, have a read of this article on the website of #AlanStorm as it might help.
HTH,
JD

In Magento how to show custom attribute in product grid ..?

Thanks in advance
i have made one attribute with option of yes/no i want to show this in product grid at admin side i made the column in the grid and put the following code
<?php
$this->addColumn('approvedcustomer',
array(
'header'=> Mage::helper('catalog')->__('UrgeStatus'),
'index' => 'approvedcustomer',
));
?>
here approvedcustomer is attribute and it contains option yes/no
but in grid it shows 0 and 1 how can i show Approved and Unapproved insted of 0 and 1..
sorry for my english,
thanks once again.
Jeet.
You should assign "options" type for your column.
$this->addColumn('approvedcustomer',
array(
'header'=> Mage::helper('catalog')->__('UrgeStatus'),
'index' => 'approvedcustomer',
'type' => 'options',
'options' => array(
0 => 'No',
1 => 'Yes',
)
));

Resources