Skip to content

Instantly share code, notes, and snippets.

@chensoren
Last active August 29, 2015 13:56
Show Gist options
  • Save chensoren/9066260 to your computer and use it in GitHub Desktop.
Save chensoren/9066260 to your computer and use it in GitHub Desktop.
magento 后台管理

magento安装权限问题

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 777 {} \;
chmod o+w var var/.htaccess app/etc
chmod 550 mage
chmod -R o+w media
chmod -R 777 var/

##首页侧栏

####Popular Tags block

    <block  type="tag/popular" name="tags_popular"  template="tag/popular.phtml"/>

####自动approve客户的reviews 更改文件Code > Core > Mage > Review > controllers > ProductController.php 将 ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING) 改为 ->setStatusId(Mage_Review_Model_Review::STATUS_APPROVED)

修复导航条不显示HOME链接

修改文件base/default/layout/page.xml,代码大概在75行 将下面代码注释

<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>

然后加上下面代码

<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>

个性化导航栏

<div class="nav-container">
    <ul id="nav">
        <li class="nav-main"><a class="top-nav-item" href="<?php echo $this->getUrl('') ?>"><span><?php echo $this->__('Home'); ?></span></a></li>
		<div class="navDivide"></div>
        <?php foreach ($this->getStoreCategories() as $_category): ?>
		 <li class="nav-main">
		  <a class="top-nav-item" href="<?php echo $this->getCategoryUrl($_category); ?>"><span><?php echo $_category->getName(); ?></span></a>
		   <?php $_children = $_category->getChildren(); ?>
		   <?php if($_children->count()) : ?>
		   <div class="dropdownCont" style="display: none;">
			  <table class="">
				<tbody><tr>
				<td class="first">
				<ul>
					<?php foreach($_children as $_child) : ?>
						<li><a href="<?php echo $this->getCategoryUrl($_child); ?>" class="">
						<span class="first"><?php echo $_child->getName(); ?></span>
				     <?php endforeach; ?>
				</a></li>
				</ul>
				</td>
				</tr>
				</tbody>
			</table>
		</div>
		   <?php endif; ?>
		 </li>
		 <div class="navDivide"></div>
		 <?php endforeach ?>
    </ul>
</div>

产品详细页位置

app/design/frontend/default/自己的主题/template/catalog/product/view.phtml

更改add to wishlist和add to compare

修改位置为base/default/template/catalog/product/view/addto.phtml

直接在后台系统去掉add to wishlist和add to compare功能 修改配置将Mage_Wishlist功能disable就可以,具体位置在:System->Configuration->Advanced->Advanced下面

在后台去掉产品的short description 将Values Required改为NO, Used in Product Listing改为NO,具体位置在:Catalog->Attributes->Manage Attributes然后搜索description即可

添加sharethis社交分享插件

http://www.sharethis.com/get-sharing-tools

##magento plugins

##模板

##国外关于magento的文章

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment