Posts tagged ‘magento’

magento: add register link at top links

I want to change default “Log In” to ” Log In or Register”,  so how to add register link at top links for magento site?

It’s easy.

At app/design/frontend/default/your-template/layout, find customer.xml, and, find this:

<reference name=”top.links”>
<action method=”addLink” translate=”label title” module=”customer”><label>Log In</label><url helper=”customer/getLoginUrl”/><title>Log In </title><prepare/><urlParams/><position>100</position></action>
</reference>

and just replace the code to:

<reference name=”top.links”>
<action method=”addLink” translate=”label title” module=”customer”><label>Log In or Register</label><url helper=”customer/getLoginUrl”/><title>Log In or Register</title><prepare/><urlParams/><position>100</position></action>
</reference>

That’s OK.

how to add google analytics to magento site

Google analytics is the most useful tool for wesite webmaster to analytics the site. It is easy to add google analytics to magento site. Please just at the adminend, at System>Configuration>Sales>google API>google analytics>, enable it, and just write your account number.

Note: account number is not your google account, such as “yourgoogleaccount@gmail.com”, it is such as “UA-19999034-1″.

Good luck.

Magento: how to add a Static Block to a page

Static Block of Magento is a very useful tool for us to add some static content. Copy the line of code below where you want the static block to appear and change the ‘identifier’ to the identifier of the static block you created.

getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?>

Fox example, you just add a static block named “header_content”, and named the identifier “header_content”, then you will add it at the top menu of every page of your website, so, do it like this:

1, look the header.phtml at app/design/frontend/default/your-template/template/page/html

2, add the code:
getLayout()->createBlock('cms/block')->setBlockId('header_content')->toHtml() ?>
to header.phtml.

3, upload the header.phtml to your server, that’s all.