Google+

Pages

Saturday, March 31, 2012

Template path hints in admin panel

Yes, just like front-end, we can also see template path hints for Admin Panel in Magento:

Just use this query:

INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'dev/debug/template_hints', 1), ('default', 0, 'dev/debug/template_hints_blocks', 1);

 Now, to remove these template paths from Admin Panel, just fire these two queries:


delete from core_config_data where scope='default' and scope_id=0 and path='dev/debug/template_hints_blocks' and value=1

and

delete from core_config_data where scope='default' and scope_id=0 and path='dev/debug/template_hints' and value=1

Sunday, March 11, 2012

Edit links on Customer Account page in Magento

When a user log in to a Magento Store, he/ she is taken to the User Account page. It looks like this:






There are various items on the left menu usually. Depending on your website's type and your requirement, not all the items presents in the menu are useful.

By default, there are following items on the left menu of Account page:


  1. Account Dashboard
  2. Account Information
  3. Address Book
  4. My Orders
  5. Billing Agreements
  6. Recurring Profiles
  7. My Product Reviews
  8. My Tags
  9. My Wishlist
  10. My Downloadable Products
  11. Newsletter Subscriptions
  12. My Applications
You can edit these links or remove them from left menu by modifying some layout files.

Note:  Magento layout edits are saved in the CMS cache, remember to refresh the Magento cache after every edit or disable it temporarily.

To remove:
i.        Account Dashboard
ii.       Account Information
iii.      Address Book

Go to/app/design/frontend/*/*/layout/customer.xml

To remove the item Account Dashboard you have to comment out this line of code

<action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>



To remove the item Account Information you have to comment out this line of code

<action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>

To remove the item Address Book you have to comment out this line of code

<action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>

  
To remove:
iv.     My Orders

Go to /app/design/frontend/*/*/layout/sales.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>


To remove:
v.       Billing Agreements

Go to /app/design/frontend/*/*/layout/sales/billing_agreement.xml

and find and comment out the following code:
 
<action method="addLink" translate="label"><name>billing_agreements</name><path>sales/billing_agreement/</path><label>Billing Agreements</label></action>

To remove:
vi.      Recurring Profiles

Go to  /app/design/frontend/*/*/layout/sales/recurring_profile.xml

and find and comment out the following code:

<action method="addLink" translate="label"><name>recurring_profiles</name><path>sales/recurring_profile/</path><label>Recurring Profiles</label></action>


To remove:
vii.      My Product Reviews

Go to /app/design/frontend/*/*/layout/review.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="review"><name>reviews</name><path>review/customer</path><label>My Product Reviews</label></action>


To remove:

viii.     My Tags

Go to /app/design/frontend/*/*/layout/tag.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="tag"><name>tags</name><path>tag/customer/</path><label>My Tags</label></action>


To remove:
ix.       My Wishlist

Go to /app/design/frontend/*/*/layout/wishlist.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="wishlist" ifconfig="wishlist/general/active"><name>wishlist</name><path>wishlist/</path><label>My Wishlist</label></action>


To remove:
x.       My Downloadable Products

Go to /app/design/frontend/*/*/layout/downloadable.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>


To remove:
xi.     Newsletter Subscriptions

Go to /app/design/frontend/*/*/layout/newsletter.xml

and find and comment out the following code:

<action method="addLink" translate="label" module="newsletter"><name>newsletter</name><path>newsletter/manage/</path><label>Newsletter Subscriptions</label></action>


and finally
To remove:
xii.     My Applications

Go to /app/design/frontend/*/*/layout/outh.xml

and find and comment out the following code:
<customer_account>
   <reference name="customer_account_navigation">
      <action method="addLink" translate="label" module="oauth">
          <name>OAuth Customer Tokens</name>
          <path>oauth/customer_token</path>
          <label>My Applications</label>
      </action>
   </reference>
</customer_account>




Useful Tip: If some functions aren’t used at all in your website, more than hiding only a menu item, it’s better to directly disable this function. As example if you’re sure that the function Tag will not be used, you could disalbe it going on System -> Configuration -> Advanced and disabling the Mage_Tag module.


  
  
 

Tuesday, March 6, 2012

Magento Error: “Could not determine temp directory, please specify a cache_dir manually” after Magento is installed"

When we install Magento, some times we may have the error “Could not determine temp directory, please specify a cache_dir manually”, when clicking on some pages in both backend and frontend.

Usually it will happen in shared web hosting, but also some times on individual server, if the permission of tmp folder is set wrong.




Many people suggest to modify the file:
/lib/Zend/Cache/Backend/File.php” to fix this problem. However, it may be a trap when you upgrade your Magento, as this file resides as core file of Magento. I recommend to use Magento’s override feature.

Firstly, copy “/lib/Zend/Cache/Backend/File.php” to “/app/code/local/Zend/Cache/Backend/File.php”.


Then on line 91 or near this line, you will find:
'cache_dir' => null,
Change to:
'cache_dir' => "var/tmp/",

You can change the cache folder wherever you want.
Now create a directory named tmp(or whatever name you have given above) under var folder and change the permission to 777 if necessary.


Now, your Magento should be run smoothly.