Showing posts with label Magento. Show all posts
Showing posts with label Magento. Show all posts

Monday, June 10, 2013

How to Set Permission on Custom module in magento? Solved

I have got the solution, I think It will help you.
Here it is:
Lets say my module name is fabric

Change your /app/code/local/<Namespace>/<Module>/etc/config.xml

        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <Store_Fabric>
                            <title>Swatches</title>
                            <sort_order>10</sort_order>
                        </Store_Fabric>
                    </children>
                </admin>
            </resources>
        </acl>


To :
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                       <fabric translate="title" module="fabric">
                            <title>Swatches</title>
                            <sort_order>10</sort_order>
                            <children>
                                <items module="fabric">
                                   <title>Manage Swatches</title>
                                    <sort_order>0</sort_order>
                                       <action>fabric/adminhtml_fabric</action>
                                </items>
                            </children>
                        </fabric>
                    </children>
                </admin>
            </resources>
        </acl>


Thanks
Vipin Choudhary

Wednesday, December 5, 2012

How to get Logged in User Data in Magento

Here is the information for magento logged in users data.
Just paste this code to your magento template files or php files too.

echo Mage::helper('customer')->getCustomer()->getId();
print_r(Mage::helper('customer')->getCustomer()->getData());
echo Mage::getSingleton('customer/session')->getCustomer()->getId();