Recent Post

All Pages

Like Us On Facebook

About

Gallery

Thứ Tư, 27 tháng 8, 2014

Category - Anchor Categories trong Magento

In addition to the standard layered navigation, anchor categories appear in an additional section that lets you filter the list by attribute value. The attribute section of layered navigation appears if the category is set to “Is Anchor.” Each attribute can be configured to display the results, which is the number of matching records found.
Setting up anchored layered navigation is a two-step process. First, you need to set up the filterable attributes. Then, make the category an anchor. http://go.magento.com/support/kb/entry/name/anchor-categories/

Step 1: Set the Attribute Properties

  1. From the Admin menu, select Catalog > Attributes > Manage Attributes.
  2. Click to open the attribute in Edit mode, and do the following:
    1. Scroll down to the Frontend Properties section, and set Use In Layered Navigation to one of the following:
      • Filterable (with results)
      • Filterable (no results)
    2. Set Use In Search Results Layered Navigation to “Yes.”

Step 2: Make the Category an Anchor

  1. From the Admin panel, select Catalog > Manage Categories.
  2. In the Categories panel on the left, click to open the category. Then, do the following:
    1. On the Display Settings tab, set Is Anchor to “Yes.”
    2. Click the Save Category button.
  3. To test the setting, go to your store and select the category from the top navigation. The layered navigation with filters will appear in the left sidebar of the page.
Read more ...

Thứ Hai, 25 tháng 8, 2014

Category - Khác biệt giữa Root Category và Subcategory trong Magento

Root Category được áp dụng vào một Store View cụ thể trong Magento. Còn Subcategory là các category con trong một Root Category. Nếu trong cửa hàng của bạn có bao nhiêu Store View thì bạn nên tạo ra bấy nhiêu Root Category tương ứng.

Quy trình tạo một Root Category và áp dụng nó vào một Store View trong Magento:

Bước 1: Tạo một Root Category mới
  1. Bên trong Admin panel, chọn Catalog > Manage Categories.
  2. Ở phía trên, bên trái của trang Manage Categories, click vào nút Add Root Category.
  3. Trong ô Name, nhập tên cho Root Category mới.
  4. Thiết lập Active là Yes.
  5. Vào Tab Display Settings, và thiết lập Is Anchor là Yes.
  6. Click nút Save Category.
Bước 2: Tạo các subcategories là con của Root Category mới
  1. Cũng ngay trong trang Manage Categories, trong cây thư mục category bên tay trái, Click để tô chọn Root Category vừa tạo trong bước 1.
  2. Click nút Add Subcategory.
  3. Đạt tên cho subcategory, thiết lập Is Active là Yes.
  4. Click nút Save Category.
Bước 3: Áp dụng Root Category vào một Store View cụ thể.
  1. Bên trong Admin panel, chọn System > Manage Stores.
  2. Trong trang Manage Stores, chọn vào một trong các Main Store để chỉnh sửa Store
  3. Đổi thiết lập Root Category Root Category mới tạo.
  4. Click nút Save Store.

Read more ...

Code - Những hàm thường dùng trong Magento

Get the path of your magento page.
1
echo $this->getUrl('mypage');
Get the path of the image in your skin folder.
1
echo $this->getSkinUrl('images/yourimage.gif');
Get the product link.
1
echo $this->getProductData()->getProductUrl();
Get the product name.
1
echo $this->htmlEscape($this->getProductData()->getName());
Call a static block in .phtml file.
1
echo $this->getLayout()->createBlock('cms/block')->setBlockId('YOURBLOCKID')->toHtml();
Get Image url of current category.
1
echo $this->getCurrentCategory()->getImageUrl();
Check whether the current category is Top category.
1
echo $this->IsTopCategory();
Get description of current category.
1
echo $this->getCurrentCategory()->getDescription();
Display products list page (list.phtml).
1
echo $this->getProductListHtml();
Display CMS block page.
1
echo $this->getCmsBlockHtml();

Get current store id.
1
echo $storeId = Mage::app()->getStore()->getId();
Get current store name.
1
echo $storeName = Mage::app()->getStore()->getName();
Get current store code.
1
echo $storeCode = Mage::app()->getStore()->getCode();
Get website name.
1
echo $websiteName = Mage::app()->getWebsite()->getName();
Get session id.
1
echo $sessionId = Mage::getModel('core/session')->getSessionId();
Get customer id.
1
echo $customerId = Mage::getModel('customer/session')->getCustomerId();
Get guest id.


1
echo $vistitorId = Mage::getModel('core/session')->getVisitorId();
Read more ...

Hosting - Chuyển website Magento sang hosting server, Domain, Database mới

Move or migrate magento to new server, domain, database, host, anything by following the steps below.
To configure your Magento with a new domain, you will need to do following steps:
- Copy whole Magento project from current server and paste it to the new server.
You can do server-to-server transfer. First, tar.gz your magento project
tar -cvf magento.tar.gz magento
Then copy it to your new server from old server
scp magento.tar.gz root@your.ip.address.here:/var/www/.
- Backup the database (Admin -> System -> Tools -> Backup)
You can also take backup through phpMyAdmin, or by mysql.
mysqldump -u user -p database > /path/to/keep/db.sql
- Logout from your old server. Login to new server.
Extract the file magento.tar.gz that you sent from old server
tar -zxvf magento.tar.gz

- Delete all directory or files that are there in cache folder
rm -rf var/cache/*
- Edit local.xml that is in magento/app/etc/local.xml and change mysql username, password, database as per new server credentials
- Import the backed up database. Before that create empty database to dump tables in it.
mysql -u root -p 'password';
create database dbname;
exit;
mysql -u root -p -d dbname < /path/to/your/db.sql
- Edit the database to change it to your new domain name. Search in core_config_data table for old domain.
select * from core_config_data where path like '%secure/base_url';
and update it with your new domain
update core_config_data set value='http://mysite.com/' where path like '%secure/base_url';

Read more ...

Chủ Nhật, 24 tháng 8, 2014

Debug - Thủ thuật sửa lỗi code trong Magento

Lấy ra các phương thức - methods của một đối tượng - object

Đầu tiên dùng hàm  get_class lấy tên của một lớp đối tượng object class, gán vào biến class_name như sau
<?php $class_name = get_class($object); ?>
Sau đó dùng hàm get_class_methods để lấy ra tất cả các phương thức có thể có của  của chính đối tượng - object đó bằng vòng lặp foreach.
<?php
$class_name = get_class($object);
$methods = get_class_methods($class_name);
foreach($methods as $method)
{
var_dump($method);
}
?>
Read more ...

Layout - Các thẻ method thường dùng trong file layout .xml của Magento

1. Action bên trong thẻ <reference> ( tham chiếu đến 1 block đã có)
<reference name="block_name">
             <action method="unsetChild"><name>description</name></action>
</reference>

2. Action bên trong thẻ <block> ( tạo block mới )
<block type="" name="" as="" template="">
<action method="addToParentGroup"><group>detailed_info</group></action> 
<action method="setTitle" translate="value"><value>Specs</value></action> 
</block>
Read more ...

Thứ Bảy, 23 tháng 8, 2014

Template - Cấu trúc file, thư mục trong một gói template Magento


Read more ...

Template - Quy ước không thể quên khi thiết kế template cho Magento

Tận dụng ưu điểm Cơ chế fallback trong template của Magento.
Khi cần thiết kế một Template trong Magento, BẠN CẦN GHI NHỚ CÁC QUY ƯỚC sau đây:
  • Tạo themplate tùy chỉnh của riêng bạn cần đóng gói nó lại trong Design-Package ( Gói thiết kế ) trong cấu trúc thư mục /your_design_package/default/
  • Đặt gói thiết kế trên vào Magento theo cấu trúc đường dẫn như sau /app/design/frontend/your_design_package/default  /skin/frontend/your_design_package/default và bắt đầu xây dựng template của riêng bạn.
  • Không nên copy tất cả các file trong base/default vào các thư mục ( tất nhiên là với vị trí tương ứng ) bên trong your_design_package/default. Chỉ copy những file mà bạn cần thay đổi nội dung mà thôi, vì sau này khi đọc lại mã code, bạn dễ dàng nhận biết những file bạn đã tác động.
Read more ...

Block - Những thuộc tính có thể có của một Block Magento

Khai báo 1 Block trong file layout .xml của Magento:

<block type="..." name="..." as="..." template="...">
         <action> </action>
</block>
  • type: loại Block, có thể là Block trong Magento, hay block trong một module nhất định
  • name: Tên tham chiếu đến Block, tên này phải duy nhất trên toàn website, các block khác referrent ( Tham chiếu ) đến nó thông qua tên.
  • as: Tên mật danh của Block hay Block con của nó, tên này được dùng để gọi Block bằng phương thức getChildHTML(ten_mat_danh) trong file Template tương ứng với Block.
  • template: file có phần mở rộng .phtml, quy định nội dung bên trong của block, trong template có thể gọi đến một Block khác ( Block con hay bất kỳ Block nào đã được khai báo với Magento)
  • before (and) after: đây là hai cách giúp sắp xếp vị trí của một Block nội dung trong một Block cấu trúc gồm nhiều Block nội dung. Sắp xếp Block lên vị trí cao nhất hay thấp nhất trong một Block cấu trúc.
  • action – <action> : dùng để tác động lên các thay đổi trong một trang, một Block, và nhiều chức năng khác nữa.

Read more ...

Layout - Các page layout handle thường dùng trong file layout.xml

Tất cả các trang
<default>
</default>

Tất cả các trang là CMS-Page
<cms_page>
</cms_page>

Trang chủ là CMS-page
<cms_index_index>
</cms_index_index>

Các trang có 3 cột left - content - right<page_three_columns>
</page_three_columns>

Trang duyệt qua một category
<catalog_category_default>
</catalog_category_default>

Trang User login:
<customer_logged_in>
</customer_logged_in>
Read more ...

Template - Cơ chế fallback trong template của Magento


Tóm gọn lại là: 
- Magento sẽ tìm một file trong gói template theo trình tự phân cấp, cho đến khi nào có thì thôi, nếu cuối cùng mà Magento không thấy thì sẽ báo lỗi.
- Tiện ích của viêc này là, trong quá trình thiết kế template cho Magento, bạn chỉ copy những file cần thay đổi từ gói template chuẩn, sẵn có trong Magento vào vị trí thư mục tương ứng trong gói template của bạn, sau đó chỉnh sửa, câp nhật những thay đổi.

Vậy khi cần thiết kế một Template trong Magento, BẠN CẦN GHI NHỚ CÁC QUY ƯỚC sau đây:

  • Tạo themplate tùy chỉnh của riêng bạn cần đóng gói nó lại trong Design-Package ( Gói thiết kế ) trong cấu trúc thư mục /your_design_package/default/
  • Đặt gói thiết kế trên vào Magento theo cấu trúc đường dẫn như sau /app/design/frontend/your_design_package/default  /skin/frontend/your_design_package/default và bắt đầu xây dựng template của riêng bạn.
  • Không nên copy tất cả các file trong base/default vào các thư mục ( tất nhiên là với vị trí tương ứng ) bên trong your_design_package/default. Chỉ copy những file mà bạn cần thay đổi nội dung mà thôi, vì sau này khi đọc lại mã code, bạn dễ dàng nhận biết những file bạn đã tác động.

Read more ...

Model - Chi tiết cách lọc dữ liệu addAttributeToFilter trong Magento Model


Read more ...

Model - Tổng quan về Model class trong Mgento

Tất cả model kế thừa Varien-Object từ Zend Framework
$model -> getData() ; // array
$model ->getWhat => $setWhat
$model->setMethod1->setMethod2

Lấy Data từ Model:

- Tổng quát:
$collections = Mage::getModel('catalog/product') // khởi tạo model Mage_Catalog_Model_Product
->getCollection() // lấy tất cả dữ liệu trong model
->addAttributeToSelect(array('name', 'price')) // lọc dữ liệu theo thuộc tính Attribute (cột)
->addAttributeToFilter('price', array('eq' => 10.00)) // lọc dữ liệu theo giá trị thuộc tính (row)
->load(); // nạp data cần lấy



Giai thích: The below code, in this case is a product collection, we call addAttributeToSelect() to select only “name” and “price” attributes for all products. Then we call addAttributeToFilter() to filter so only products with the price of 10.00 will be selected from the database. Again, even though catalog/product is using EAV model, it’s ok to use addFieldToFilter() if you want to.
Đọc thêm => các cách Filter dữ liệu addAttributeToFilter

- Ví dụ cụ thể 1:
$collections = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect(array('name', 'price'))
->addAttributeToFilter(
array(
'attribute' => 'name',
'eq' => 'Somename',
),
array(
'attribute' => 'price',
'eq' => 10.00,
),
));
->load();
Read more ...

Widgets - Tổng quan Widget trong Magento

Magento Widgets are Magento extensions with a predefined set of configuration options. Through them the store administrators can enrich the front-end blocks functionality. They provide great control and flexibility in creating informational and marketing content through the Magento administrator panel. Once installed, the widgets options can be tuned by the Magento store administrators.

The Magento widgets can be used after Magento version 1.4 and they can be installed in the same way as the other Magento extensions.

Some of the possible implementations of the Magento widgets are:
Dynamic product data;
Dynamic lists with the recently viewed items;
Promotional images placed on different Magento front-end locations;
Interactive navigation elements and action blocks;
Dynamic flash elements that can be easily configured and embedded in content pages;
And many more

In this tutorial we will show you how to install a widget and insert it into a CMS page. First you need to find a widget you want and get its extension key from the Magento Connect site. Once you find a widget suitable for your Magento version, click on Install Now, choose the Magento Connect version (select Magento Connect 2.0 if you are running Magento 1.5 or newer), check and agree the license agreement and click the Get Extension Key button. Select and copy it.



Widget Type: 
CMS Page Link
CMS Static Block
Catalog Category Link
Catalog New Products List
Catalog Product Link
Order and Returns
Recently Compared Products
Recently Viewed Products

Design Package/Theme:
Tất cả template cho các store view

Frontend Properties cho Widget:

Các loại layout Update cho Widget:














Read more ...

Widget - Cách cài đặt một Widget mở rộng vào Magento

Widget - Cách cài đặt một Widget mở rộng vào Magento.
Read more ...

Widget - Cách tạo mới một Widget trong Magrento

Widget - Cách tạo mới một Widget trong Magrento
Read more ...

Widget - Widget trong Magento là gì ?

Giới thiệu về widget
Magento Widgets are Magento extensions with a predefined set of configuration options. Through them the store administrators can enrich the front-end blocks functionality. They provide great control and flexibility in creating informational and marketing content through the Magento administrator panel. Once installed, the widgets options can be tuned by the Magento store administrators.

The Magento widgets can be used after Magento version 1.4 and they can be installed in the same way as the other Magento extensions.
Read more ...

HTML - Mã HTML là gì

HTML ( Viết tắt cho HyperText Markup Language, hay là "Ngôn ngữ Đánh dấu Siêu văn bản") là một ngôn ngữ đánh dấu được thiết kế ra để tạo nên các trang web với các mẩu thông tin được trình bày trên World Wide Web. HTML được định nghĩa như là một ứng dụng đơn giản của SGML và được sử dụng trong các tổ chức cần đến các yêu cầu xuất bản phức tạp. HTML đã trở thành một chuẩn Internet do tổ chức World Wide Web Consortium (W3C) duy trì.
Một file HTML phải có phần mở rộng là .htm hoặc .html
Một file HTML có thể được tạo bởi một trình soạn thảo đơn giản như notepad chẳng hạn.
Cấu trúc cơ bản của một file HTML:
<html>
<head>
<title>Thủ thuật Magento</title>
</head>
<body>
<h1>Thủ thuật thiết kế website bán hàng dùng Magento</h1>
<p>
- Nhận thiết kế website bán hàng chuyên nghiệp dùng Magento. <br>
- Tư vấn SEO và SEO trọn gói website Magento. <br>
- Nhận quản trị website bán hàng trọn gói, ký hợp đồng năm. <br>
- <b>Email:</b> quocduy240@gmail.com. Mobile:(+84)127.867.2707. Skype: quocduy240.<br>
- Địa chỉ: 97A, đường 19, Xã Bình Hưng, Huyện Bình Chánh, TP.HCM, Việt Nam.<br>
<a href="http://thuthuatmagento.blogspot.com/">Liên kết đến website</a>
 </p>
</body>
</html>
Trong văn bản html thẻ <a> đánh dấu một liên kết đến một tài liệu nào đó, thẻ <p> đánh dấu một đoạn văn, thẻ <h1> đánh dấu một dạng đề mục. Copy đoạn code trên vào file notepad.txt, đổi tên thành example.html. Sau đó mở file bằng trình duyệt Web bất kỳ như Firefox, Chrome.. Kết quả là:

- Một tài liệu html tương đương với một trang web. Một tài liệu html diễn tả một trang web.
- Các thẻ html còn được gọi là các phần tử html ( hay các element ).
- Nếu bạn muốn hiểu biết một chút về lập trình web, học html sẽ là bước đầu tiên và không thể bỏ qua.
Read more ...

CMS Page - Cập nhật nội dung cho một CMS page trong Magento

Sau khi tạo một CMS Pages mới trong Magento. Hoặc cần chỉnh sửa các trang CMS Page đã tạo trước đó. Bạn thực hiện như sau:
- Vào Backend Magento => CMS => Pages => Chọn trang cần chỉnh sửa trong cửa sổ
- Trong menu Page Information bên trái truy cập Content. Một cửa sổ chỉnh sửa nội dung cho page hiện ra như sau:
Các nội dung có thể chèn vào một trang CMS page từ các nút trong hình trên:
Show/Hide Editor: Chuyển đổi chế độ Edit HTML ( dùng mã HTML ) hay WYSWYG ( Thấy gì có nấy )
Insert Widget...: Chèn một widget đã tạo trong CMS => Widgets vào CMS Page
Insert Image: Chèn một hình vào trong CMS Page.
Insert Variable: chèn một biến (  thường là những thông tin hay sử dung nhất trong website ) vào CMS Page.

1. Hình ảnh:
- Lưu trữ trên hosting server (Storage) tại thư mục: /web-root/media/wysiwyg/
- Click Create Folder nêu muốn tạo thư mục trên hosting server cho dễ quản lý
- Browse Files sẽ chuyển sang cửa sổ chọn hình ảnh để upload ngay trên máy tính của bạn. Sau khi chọn xong click nút Upload Files để bắt đầu tiến trình upload file lên server.
- Sau khi upload ảnh xong, Click chọn ảnh => Enter

2. Widgets:
Chèn những widgets đã tạo trước đó trong CMS => Widgets.

Tham khảo thêm:
- Widgets trong Magento là gì
- Cách tạo Widgets trong Magento
- Cách cài đặt một Widget mở rộng vào Magento.

3. Chèn biến Variable:
Biến ở đây thường là những thông tin liên quan đến website Magento được sử dụng nhiều lần trên nhiều trang CMS Pages khác nhau. ích lợi từ việc sử dụng biến là khi những thông tin trên website thay đổi thì các trang CMS Pages sử dụng biến cũng được cập nhật thông tin theo. Bạn khôn tốn thời gian chỉnh sửa lại từng trang một. Sau đây là danh sách các biến thương dùng khi click nút Insert variable.

Read more ...

Breadcrumbs - Thêm thanh Breadcrumbs vào một CMS Pages bất kỳ trong Magento

Breadcrumbs là block chứa một đường dẫn trong trang web từ trangchu/.../trang-hien-tai. Giúp người dùng trở lại các trang trước đó dễ dàng hơn.
Cách thực hiện:
Bước 1: Đăng nhập vào phần quản trị Backend của Magento. Chọn vào CMS => Pages, mở trang mà bạn muốn thêm breadcrumbs vào.
Bước 2: Chọn vào phần Layout Update XML thêm đoạn xml sau vào và sửa breadcrumbs theo đường dẫn của bạn:
<reference name="root"> 
              <action method="unsetChild"><alias>breadcrumbs</alias></action> 
              <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"> 
                    <action method="addCrumb"> <crumbName>Home</crumbName> <crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo> </action> 
                    <action method="addCrumb"> <crumbName>About us</crumbName> <crumbInfo><label>About us</label><title>About us</title></crumbInfo> </action> 
             </block> 
</reference>

Read more ...

Thứ Sáu, 22 tháng 8, 2014

Layout - Default handle của tất cả các module trong Magento

Thư mục: /app/design/frontend/base/default/layout/
page.xml
    <default translate="label" module="page">
        <label>All Pages</label>
        <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">

            <block type="page/html_head" name="head" as="head">
                <action method="addJs"><script>prototype/prototype.js</script></action>
                <action method="addJs"><script>lib/ccard.js</script></action>
                <action method="addJs"><script>prototype/validation.js</script></action>
                <action method="addJs"><script>scriptaculous/builder.js</script></action>
                <action method="addJs"><script>scriptaculous/effects.js</script></action>
                <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
                <action method="addJs"><script>scriptaculous/controls.js</script></action>
                <action method="addJs"><script>scriptaculous/slider.js</script></action>
                <action method="addJs"><script>varien/js.js</script></action>
                <action method="addJs"><script>varien/form.js</script></action>
                <action method="addJs"><script>varien/menu.js</script></action>
                <action method="addJs"><script>mage/translate.js</script></action>
                <action method="addJs"><script>mage/cookies.js</script></action>

                <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>

                <action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
                <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
                <action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
                <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>

                <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
                <action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>
            </block>

            <block type="core/text_list" name="after_body_start" as="after_body_start" translate="label">
                <label>Page Top</label>
            </block>

            <block type="page/html_notices" name="global_notices" as="global_notices" template="page/html/notices.phtml" />

            <block type="page/html_header" name="header" as="header">
                <block type="page/template_links" name="top.links" as="topLinks"/>
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                </block>
                <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                    <label>Page Header</label>
                    <action method="setElementClass"><value>top-container</value></action>
                </block>
            </block>

            <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>

            <block type="core/text_list" name="left" as="left" translate="label">
                <label>Left Column</label>
            </block>

            <block type="core/messages" name="global_messages" as="global_messages"/>
            <block type="core/messages" name="messages" as="messages"/>

            <block type="core/text_list" name="content" as="content" translate="label">
                <label>Main Content Area</label>
            </block>

            <block type="core/text_list" name="right" as="right" translate="label">
                <label>Right Column</label>
            </block>

            <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
                    <label>Page Footer</label>
                    <action method="setElementClass"><value>bottom-container</value></action>
                </block>
                <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
                <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
            </block>

            <block type="core/text_list" name="before_body_end" as="before_body_end" translate="label">
                <label>Page Bottom</label>
            </block>
        </block>

        <block type="core/profiler" output="toHtml" name="core_profiler"/>

    </default>

core.xml
<default>
<block name="formkey" type="core/template" template="core/formkey.phtml" />
</default>


cms.xml
  <default>
        <reference name="footer">
            <block type="cms/block" name="cms_footer_links" before="footer_links">
                <!--
                    The content of this block is taken from the database by its block_id.
                    You can manage it in admin CMS -> Static Blocks
                -->
                <action method="setBlockId"><block_id>footer_links</block_id></action>
            </block>
        </reference>
    </default>

catalog.xml
<default>
        <!-- Mage_Catalog -->
        <reference name="left">
            <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
                <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
                <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>
                <action method="setLinkUrl"><url>checkout/cart</url></action>
            </block>
        </reference>
        <reference name="right">
            <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
            <block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml">
                <action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>
                <action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>
            </block>
        </reference>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
        </reference>
        <block type="catalog/product_price_template" name="catalog_product_price_template" />
    </default>

catalogsearch.xml
<default>
        <reference name="header">
            <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
        </reference>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
                <label>Search Terms</label>
                <url helper="catalogsearch/getSearchTermUrl" />
                <title>Search Terms</title>
            </action>
            <action method="addLink" translate="label title" module="catalogsearch">
                <label>Advanced Search</label>
                <url helper="catalogsearch/getAdvancedSearchUrl" />
                <title>Advanced Search</title>
            </action>
        </reference>

    </default>

customer.xml
  <default>
        <!-- Mage_Customer -->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
        </reference>

    </default>

checkout.xml
 <default>

        <!-- Mage_Checkout -->
        <reference name="top.links">
            <block type="checkout/links" name="checkout_cart_link">
                <action method="addCartLink"></action>
                <action method="addCheckoutLink"></action>
            </block>
        </reference>
        <reference name="right">
            <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
                <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
                <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
                <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
                    <label>Shopping Cart Sidebar Extra Actions</label>
                </block>
            </block>
        </reference>

    </default>

contacts.xml
 <default>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled"><label>Contact Us</label><url>contacts</url><title>Contact Us</title><prepare>true</prepare></action>
        </reference>
    </default>

newsletter.xml    <default>

        <!-- Mage_Newsletter -->
        <reference name="left">
            <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/>
        </reference>


    </default>

rss.xml
    <default>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="rss" ifconfig="rss/config/active"><label>RSS</label><url>rss</url><title>RSS</title><prepare>true</prepare><urlParams/><position/><li/><a>class="link-rss"</a></action>
        </reference>
        <block type="rss/list" name="head_rss" ifconfig="rss/config/active" />

    </default>

wishlist.xml
    <default>
        <reference name="top.links">
            <block type="wishlist/links" name="wishlist_link" />
            <action method="addLinkBlock"><blockName>wishlist_link</blockName></action>
        </reference>

        <!-- Mage_Wishlist -->
        <reference name="right">
            <block type="wishlist/customer_sidebar" name="wishlist_sidebar" as="wishlist" after="cart_sidebar" template="wishlist/sidebar.phtml" />
        </reference>

    </default>

tag.xml
    <default>
        <!-- Mage_Tag -->
        <reference name="left">
            <block type="tag/popular" name="tags_popular" template="tag/popular.phtml"/>
        </reference>


    </default>

reports.xml
    <default>
        <!-- Mage_Reports -->
        <reference name="right">
            <block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
            <block type="reports/product_compared" before="right.permanent.callout" name="right.reports.product.compared" template="reports/product_compared.phtml" />
        </reference>

    </default>


poll.xml
    <default>

        <!-- Mage_Poll -->
        <reference name="right">
            <block type="poll/activePoll" name="right.poll">
                <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
                <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
            </block>
        </reference>


    </default>

directory.xml    <default>
        <reference name="head">
            <block type="core/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
        </reference>
    </default>

googleanalytics.xml    <default>
        <!-- Mage_GoogleAnalytics -->
        <reference name="after_body_start">
            <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
        </reference>

    </default>
còn tiếp ...
Read more ...

Biểu mẫu liên hệ

Tên

Email *

Thông báo *