Archive for the ‘magento’ Category.
June 1, 2010, 1:56 am
The easiest thing to do to change the default sort order, so that the newest products show first, simply change line 98 in Toolbar.php
/**
* Default direction
*
* @var string
*/
protected $_direction = 'desc';
\app\code\core\Mage\Catalog\Block\Product\List\Toolbar.php
May 11, 2010, 6:43 am
Add the below code to cms page:
{{block type=”catalog/product_list” category_id=”43″ template=”catalog/product/list.phtml”}}
May 8, 2010, 6:02 am
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.
May 8, 2010, 4:42 am
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.
May 8, 2010, 4:30 am
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.