Add “View” Product Page Link in Backend at Catalog => Manage Products List

Magento Go: Open Your Online Store for Free!

The current version of Magento is not editor-friendly in many regards and one of them is that the products list at Catalog => Manage Products doesn’t have any “View” link at the end of each product row for the catalog editor (human) to easily click on to open up the frontend product page to see what the users are actually seeing.

Rather, it has only the “Edit” link to open up the editor to edit the product. If one has to view a frontend product page from the backend, he or she’d have to copy the SKU and then search it in frontend to arrive at the product page which is very unhandy and annoying. Sometimes the results don’t even turn out any entries at all.

WordPress and lots of other famous CMS have this feature and I’m totally at a loss why Magento doesn’t have this ready for the convenience of the backend editors.

So how to add a “View” product link beside the “Edit” link for each product record?

At the end of article, you will have something similar to this:

Add view product links to the end of each product row in Magento

That is, “View” product links on each product row that you can click to open up the frontend product page. Screenshot taken from my wedding dresses store.

To do this, find this file:

/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php

And copy it to:

/app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php

Open and edit the copied file /app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php, find a block like this:

$this->addColumn('action',
            array(
                'header'    => Mage::helper('catalog')->__('Action'),
                'width'     => '50px',
                'type'      => 'action',
                'getter'     => 'getId',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('catalog')->__('Edit'),
                        'url'     => array(
                            'base'=>'*/*/edit',
                            'params'=>array('store'=>$this->getRequest()->getParam('store'))
                        ),
                        'field'   => 'id'
                    )
                ),
                'filter'    => false,
                'sortable'  => false,
                'index'     => 'stores',
        ));

Which is the code for the “action” column of the products list. In the same manner, add an extra column named “view” by adding the code below immediately after “action“:

$this->addColumn('view',
            array(
                'header'    => Mage::helper('catalog')->__('View'),
                'width'     => '40px',
                'type'      => 'action',
                'getter'     => 'getId',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('catalog')->__('View'),
                        'url'     => array(
                            'base'=>'catalog/product/view',
                            'params'=>array('store'=>$this->getRequest()->getParam('store'))
                        ),
                        'field'   => 'id'
                    )
                ),
                'filter'    => false,
                'sortable'  => false,
                'index'     => 'stores',
        ));

That’s it. Now refresh your Manage Products page and you should see a “View” link at the end of each product row. Clicking them would lead you to the frontend page of that particular product. I’m not sure how to force it to open in new window or new tab but I guess you can always do this yourself by holding Ctrl key in Firefox and Chrome.

Bolded part is the key difference of the “view” block from the “action” block.

Premium Magento Theme: Avalanche Grab the latest premium Magento theme: Avalanche to kick-start your store! Get to know it and you will definitely look no further. Use coupon code:

MAGENTOGOREVIEW
Click To Open/Copy
To get 15% exclusive discount for MagentoGoReview.com readers.

Magento Go Shopping Cart
Use these 3 promo codes to get lifetime discount off Magento Go!


One thought on “Add “View” Product Page Link in Backend at Catalog => Manage Products List

  1. What would i change the base url to be if i wanted to link the user to another controller?

    I built a custom grid and now i’m trying to link back an action to the orders view, but it always seems to remove the “admin” part from the url.