magento 安装管理插件的路径

05/19/2011 留下评论

system->magento connect

分类:未分类

如何为外贸Magento产品网站制作Google sitemap?

05/17/2011 留下评论

 

sitemap利用搜索引擎的收录,可以加快排名的进展,这个做外贸SEO的人都知道,我们在做外贸英文SEO的时候,可以通过为产品网站生成Google sitemap加快网站在谷歌上的排名表现,下面来说一下如何配置外贸Magento产品网站的google sitemap:

第一步,创建sitemap文件。
首先,先检查你的sitepmap是否已经存在,
假设你的域名为www.a.com

http://www.a.com/sitemap.xml

 

1.用ftp登陆到服务器
2.创建sitemap文件夹
3.修改文件夹属性为777
然后登陆magento管理后台,Catalog -> Google Sitemap
点击 “Add Sitemap” 按钮,填写文件名和路径然后刷新缓存。这样你的sitemap.xml文件就创建成功了。
第二步:配置sitemap
来到后台System -> Configuration -> Catalog->Google Sitemap 进行配置sitemap,之后点击generate就可以生成sitemap.xml.
第三步:建立sitemap cron job
必须建立一个cron job ,magento google sitemap 才能自动更新,你可以阅读官方文档“如何创建一个cron job”.利用cpanel的cron job功能可以完成该设置。

set cron job

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job

分类:未分类

让magento显示价格区间

05/17/2011 留下评论

编辑分类的Display Settings下的Is Anchor属性,都改为Yes,所有子分类也做同样设置

修改价格区间,文件:

app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php

 

分类:未分类

在magento中如何输出Magento skin目录,phtml,cms?(Magento Img 标签使用)

04/29/2011 留下评论

Phtml中:

<img src=”/getSkinUrl(‘images/myImage.png’) ?>”/>

CMS中:
<img src=”/{{skin url=’images/media/myImage.jpg’}}” />

分类:未分类

magento installation steps

04/28/2011 留下评论

SUPPORT FOR THIS TEMPLATE WILL BE PROVIDED AT

http://www.templatemela.com/forums/free-magento-template-magfree002-f34/

INSTALLATION STEPS

STEP 1:

Extract the zip file using Winzip or Winrar on windows.

STEP 2:

Copy the directories from “Magento Files” (provided in to ZIP file) to your magento root. Copy those directories at your magento root respectively,

e.g Your copy path will be

“app/design/frontend/default/MAGFREE002”

“skin/frontend/default/MAGFREE002”

STEP 3:

Now we have to set our Template from Admin panel

There are two methods to set Template Design from Admin panel

Method 1:

Under Admin Panel -> System -> Configuration -> Design -> Themes

Put “MAGFREE002” into Templates, Skin (Images / CSS), Layout and Default

Method 2:

Under Admin Panel -> System -> Design -> Click on “Add Design Change” button.

From Custom Design Drop down Select “MAGFREE002” and click on Save

STEP 4:

You have to set Homepage Layout from Admin panel

Go to Admin panel -> CMS -> Pages -> home (select home as URL Key)

Under Design -> Page Layout, Select “2columns Left Bar” from Layout Drop Down

Under Content -> Content box, Hide Editor and in HTML write below code:

<div class=”mainbanner”><img src=”{{skin url=’images/mainbanner.jpg’}}” alt=”” /></div>

<div class=”category-title”>

<h1>Featured Products</h1>

</div>

<p>{{block type=”catalog/product_list” category_id=”3″ template=”catalog/product/list_home.phtml”}}</p>

Here category_id will be any category you want to display on home page.

And Click on “SAVE PAGE”

That’s it. You have DONE

IMPORTANT NOTE:

Remember to clear cache From

Admin Panel -> System -> Cache Management

For more information visit:

http://www.magesupport.com/how-to-install-magento-themes

SUPPORT FOR THIS TEMPLATE WILL BE PROVIDED AT

http://www.templatemela.com/forums/free-magento-template-magfree002-f34/

分类:未分类

修改magento的底部链接

04/27/2011 留下评论

修改magento的底部链接,包括 About Us, Customer Service ,Site Map ,Search Terms, Advanced Search, Contact Us ,RSS ,copyright notic 等等。

1.关于我们和客户服务(About Us | Customer Service)
这两个链接主要由 cms.xml 文件进行调用。

修改这两个链接的URL你可以去magento管理后台CMS=> Static Blocks =>Footer Links

<li><a href=”{{store direct_url=”about-us”}}”>About Us</a></li>
<li><a href=”{{store direct_url=”customer-service”}}”>Customer Service</a></li>

修改其内容你需打开magento后台CMS => Pages ,然后找到 About Us 和Customer Service 的CMS页,打开进行编辑。

2. 网站地图(Site Map)
magento 的sitemap是由catalog.xml 文件进行调用的。

<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>

3. 搜索条目和高级搜索(Search Terms | Advanced Search)
这两个是由catalogsearch.xml 文件控制的

<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>

4. 联系我们(Contact Us)
magento 的contact us 可修改contacts.xml 文件

<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>

5. RSS
找到 rss.xml文件

<reference name=”footer_links”>
<action method=”addLink” translate=”label title” module=”rss” ifconfig=”rss/config/active”><label>RSS</label><url>rss</url><title>RSS testing</title><prepare>true</prepare><urlParams/><position/><li/>
<a>class=”link-feed”</a>
</action>
</reference>
6.修改magento底部默认的 message
Report All Bugs (ver. 1.2.1.2) © 2008 Magento Demo Store. All Rights Reserved
找到/app/design/frontend/default/default/template/page/html/footer.phtml  文件进行编辑。
7.修改copyright notice
也是修改footer.phtml文件 /app/design/frontend/default/default/template/page/html/footer.phtml
分类:未分类

在Magento产品分类页面创建推荐产品(Featured Products)

04/26/2011 留下评论

在进行Magento的相关操作的时候,你可能都想在产品分类页面添加上这一类产品的 ),这类产品一般是销售比较好的,或者是你的利润比较大的产品,那我们应该怎么样添加上这类产品呢?下面是描述如何显示一组( Product)。 产品需要在后台为产品增加一个属性。 当管理员在属性上选择Yes时,该产品就以Block的形式显示在产品列表页。

步骤 1) 创建一个””属性

进入后台Catalog > Attributes > Manage Attributes > Add New Attribute. 添加一个新的属性
Attribute Properties

  • Attribute Identifier:
  • Scope: Store View
  • Catalog Input Type for Store Owner: Yes/No
  • Unique Value (not shared with other ): No
  • Values Required: No
  • Input Validation for Store Owner: None
  • Apply To: All Product Types

Front End Properties

  • Use in quick search: No
  • Use in advanced search: Yes
  • Comparable on Front-end: No
  • Use In Layered Navigation (Can be used only with catalog input type ‘Dropdown’): No
  • Visible on Catalog Pages on Front-end: Yes

Manage Label/Options

然后保存,然后去Catalog → Attributes → Manage Attributes Sets,把该属性加入到默认属性集。

步骤2). 加一个Block配置到catalog.xml

打开 app/design/frontend/default/default/layout/catalog.xml. 我们在默认Category Layout标签的product list block上方加一个新的Block. 差不多在该文件的73行
Layerout代码

  1. <catalog_category_default>
  2. <block type=”catalog/product_” name=”product_” as=”product_” template=”catalog/product/.phtml”></block>
  3. …..
  4. </catalog_category_default>

步骤 3) 创建一个新的Block类从数据库取出所有产品
PHP代码

  1. <?php
  2. class MyCompany_Catalog_Block_Product_ extends Mage_Catalog_Block_Product_Abstract
  3. {
  4. public function get(){
  5. $ids = $this->_getIds();
  6. $collection = Mage::getModel(‘catalog/product’)->getCollection();
  7. $collection->getSelect()->where(“e.entity_id in (?)”, $ids);
  8. $collection->addAttributeToSelect(‘name’);
  9. $productList = $collection->load();
  10. return $productList;
  11. }
  12. public function _getIds(){
  13. // instantiate database connection object
  14. $categoryId = $this->getRequest()->getParam(‘id’, false);
  15. $resource = Mage::getSingleton(‘core/resource’);
  16. $read = $resource->getConnection(‘catalog_read’);
  17. $categoryProductTable = $resource->getTableName(‘catalog/category_product’);
  18. //$productEntityIntTable = $resource->getTableName(‘catalog/product_entity_int’); // doesn’t work :(
  19. $productEntityIntTable = (string)Mage::getConfig()->getTablePrefix() . ‘catalog_product_entity_int’;
  20. $eavAttributeTable = $resource->getTableName(‘eav/attribute’);
  21. // Query database for product
  22. $select = $read->select()
  23. ->from(array(‘cp’=>$categoryProductTable))
  24. ->join(array(‘pei’=>$productEntityIntTable), ‘pei.entity_id=cp.product_id’, array())
  25. ->joinNatural(array(‘ea’=>$eavAttributeTable))
  26. ->where(‘cp.category_id=?’, $categoryId)
  27. ->where(‘pei.value=1′)
  28. ->where(‘ea.attribute_code=””‘);
  29. $rows = $read->fetchAll($select);
  30. $ids = array();
  31. foreach($rows AS $row) {
  32. $ids[] = $row[‘product_id’];
  33. }
  34. $ret = implode(“,”, $ids);
  35. return $ids;
  36. }
  37. }
  38. ?>

步骤4): 扩展Mage_Catalog_Block_Category_View

创建一个文件叫app/code/local/MyCompany/Catalog/Block/Category/View.php.

PHP代码

  1. <?php
  2. class MyCompany_Catalog_Block_Category_View extends Mage_Catalog_Block_Category_View
  3. {
  4. public function getHtml()
  5. {
  6. return $this->getBlockHtml(‘product_’);
  7. }
  8. }
  9. ?>

步骤5): 修改模板文件
1). 编辑 app/design/frontend/default/default/template/catalog/category/view.phtml ,在
Template代码

  1. <?php echo $this->getProductListHtml()?>

的上面一行加入:

Template代码

  1. <div style=”border: 1px green solid”><h4> </h4> <?php echo $this->getHtml()?> </div>

2). 创建app/design/frontend/default/default/template/catalog/product/.phtml
Template代码

  1. <?php $_=$this->get() ?>
  2. <ul>
  3. <?php foreach($_ AS $_product) { ?>
  4. <li><a href=”<?php echo $_product->getProductUrl() ?>”><?php echo $this->htmlEscape($_product->getName()) ?></a></li>
  5. <?php  }
  6. ?>
  7. </ul>

步骤 6) 加一个新的块到app/etc/local.xml,最好的做法是建立一个新的文件app/etc/modules/MyCompany_Catalog.xml(文件名不必一定是MyCompany_Catalog),内容如下:
Layerout代码

  1. <?xml version=”1.0″?>
  2. <config>
  3. <global>
  4. <blocks>
  5. <catalog>
  6. <rewrite>
  7. <product_>MyCompany_Catalog_Block_Product_</product_>
  8. </rewrite>
  9. <rewrite>
  10. <category_view>MyCompany_Catalog_Block_Category_View</category_view>
  11. </rewrite>
  12. </catalog>
  13. </blocks>
  14. </global>
  15. </config>

分析:
步骤2). 加一个Block配置到catalog.xml
步骤5): 修改模板文件的小步骤1), 编辑 app/design/frontend/default/default/template/catalog/category/view.phtml

该例证明:有些扩展涉及到对原系统的更改。

当运行某产品分类网页时,显示app/design/frontend/default/default/template/catalog/category/view.phtml ,接下来调用序列为:
a. <div style=”border: 1px green solid”><h4> </h4> <?php echo $this->getHtml()?> </div>
b. MyCompany_Catalog_Block_Category_View->getHtml() {
$this->getBlockHtml(‘product_’);
}
c. 在Catalog.xml中找到product_块的定义,调用对应的phtml文件: app/design/frontend/default/default/template/catalog/product/.phtml
d. .phtml文件中<?php $_=$this->get() ?> 调用对应Block的关键方法get().显示到网页上

分类:未分类

在Magento侧栏添加一个你想要显示的区块。

04/26/2011 留下评论

Hi,大家好!不需要太多的时间,你就会学会如何在Magento侧栏一个你想要

下面我们开始教程:

1、进入你的网站后台

2、然后进入CMS–>Static Block

3、点击新建一个静态;

4、填写下面内容:
块标题: content_right
标识符: content_right
状态:启用
内容:这里您可以图片和文字。支持HTML代码。

5、点击保存.

6、FTP到你的空间,下载并打开app/design/default/your_theme/template/callouts/right_col.html

7、以下内容:
<div class= “box”>
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘content_right’)->toHtml(); ?>
</div>
===========================================================
或者采用第二种方法:

在后台首页CMS的Layout Update XML里如下代码:

<reference name=”right”>
<block type=”cms/block”  name=”right.permanent.callout”>
<action method = “setBlockId”><block_id>content_right</block_id></action>
</block>
</reference>

8、上传覆盖以前的内容,这样你的static block就开始工作了。

不需要购买昂贵的插件或主题,你就可以达到你想要的效果了!

分类:未分类

Magento去掉左栏和右栏的广告图片

04/26/2011 留下评论

转载地址:http://www.magentofront-end.com/magentomuban/tag/%E5%B7%A6%E6%A0%8F%E5%B9%BF%E5%91%8A%E5%88%A0%E9%99%A4

Magento去掉左栏和右栏的广告图片,这个问题有很多人在问,所以分享下方法。
去掉这两个广告图片,需要我们对Magento结构的了解,左栏和右栏的内容都是在catalog.xml里控制的。在52行,去掉这个block

“core/template” name=”left.permanent.callout” template=”callouts/left_col.phtml”>

“setImgSrc”>images/media/col_left_callout.jpg

“setImgAlt” translate=”alt” module=”catalog”>Our customer service is available 24/7. Call us at (555) 555-0123.

“setLinkUrl”>checkout/cart

在60行去掉这个block

“core/template” name=”right.permanent.callout” template=”callouts/right_col.phtml”>
“setImgSrc”>images/media/col_right_callout.jpg
“setImgAlt” translate=”alt” module=”catalog”>Keep your eyes open for our special Back to School items and save A LOT!

Magento的模块的调动删除,都是可以在xml中实现的。

转载地址:http://www.magentofront-end.com/magentomuban/tag/%E5%B7%A6%E6%A0%8F%E5%B9%BF%E5%91%8A%E5%88%A0%E9%99%A4

Magento去掉左栏和右栏的广告图片,这个问题有很多人在问,所以分享下方法。
去掉这两个广告图片,需要我们对Magento结构的了解,左栏和右栏的内容都是在catalog.xml里控制的。在52行,去掉这个block

"core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
    "setImgSrc">images/media/col_left_callout.jpg
    "setImgAlt" translate="alt" module="catalog">Our customer service is available 24/7. Call us at (555) 555-0123.
    "setLinkUrl">checkout/cart
在60行去掉这个block
"core/template" name="right.permanent.callout" template="callouts/right_col.phtml">
    "setImgSrc">images/media/col_right_callout.jpg
    "setImgAlt" translate="alt" module="catalog">Keep your eyes open for our special Back to School items and save A LOT!

Magento的模块的调动删除,都是可以在xml中实现的。

分类:未分类

Magento block相关参数 block

04/26/2011 留下评论
<reference name=”left”>
<block type=”core/template” before=”-” name=”catalog.compare.sidebar” template =”catalog/product/compare/sidebar.phtml” />
</reference >
简单解释下相关的参数:
before=”-”  作为第一个block,当有多个block指定该参数值时,后出现的优先;
after=”-”   作为最后一个block;
before=”block_name” 显示在block_name前面;
after=”block_name”显示在block_name后面。

<reference name=”left”><block type=”core/template” before=”-” name=”catalog.compare.sidebar” template =”catalog/product/compare/sidebar.phtml” /></reference >简单解释下相关的参数:
before=”-”  作为第一个block,当有多个block指定该参数值时,后出现的优先;after=”-”   作为最后一个block;before=”block_name” 显示在block_name前面;after=”block_name”显示在block_name后面。

分类:未分类