Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - > I want the product grid in admin to be displayed in frontend

I want the grid in admin to be displayed in frontend. The grid that shows the list of products in admin-> catalog->manage products.

I want to show this on the frontend for each category?

What would be ideal approach to get this done?

like image 246
user204245 Avatar asked Dec 17 '25 04:12

user204245


2 Answers

Extending admin block classes in your module and copy widgets template files from adminhtml allowing adminhtml display in frontend, but you need to load required javascripts and CSS to allow grid works and you'd be pay attention to conflicts. Probably it's more easy to using a thirdy part ajax grid in frontend.

like image 147
emastyle Avatar answered Dec 19 '25 17:12

emastyle


You need to rewrite blocks

Mage_Adminhtml_Block_Catalog_Product_Grid
Mage_Adminhtml_Block_Widget_Container

to your own, because in this classes we have logic for editing, adding products.

also you need to redefine

adminhtml/default/default/template/catalog/product.phtml
adminhtml/default/default/template/widget/grid.phtml

and add templates to the frontend scope with your customizations.

add to the frontend catalog.xml blocks declaration for catalog_category_default node it might be like this:

<catalog_category_default>
    <reference name="content">
        <block name="module_name/catalog_product_grid" template="module_name/catalog_product_grid.phtml" output="toHtml />
    </reference>
</catalog_category_default>
like image 23
Max Pronko Avatar answered Dec 19 '25 16:12

Max Pronko