- 博客(12)
- 收藏
- 关注
原创 magento 设置全局变量或函数 (Session, Registry 和 Function)
1. Magento: Get and set variables in session To set a Magento session variable:$myValue = 'Hello World';Mage::getSingleton('core/session')->setMyValue($myValue); To Retrieve:$myValu...
2012-09-26 05:28:47 223
原创 Magento : 移除/移动 newsletter move / add Newsletter subscribe
Add Newsletter subscriber form in footer 1. Go to app/design/frontend/default/your_theme/layout/ open newsletter.xml you will see code block like this :...<default> <!-- Ma...
2012-09-26 03:20:20 213
原创 Magento 获取当前店铺信息(首页,类别,地址等)
众所周知,Magento的多店铺功能非常强大,通过多店铺功能,我们可以在一个Magento应用当中创建在外观上看来完全不相关联的多个店铺,并且可以绑定不同的域名。在Magento的开发当中,经常需要获取当前所在店铺的一些相关信息,例如店铺id,店铺名称及当前店铺所属Website的ID值。通过Magento的Mage类,我们可以获取到关于店铺的所有信息。//获取店铺对象 Mage::app...
2012-09-24 10:21:36 356
原创 magento 创建block create structural blocks
Step 1: Name the structural blockOpen the file layout/page.xml in your active theme folder. Inside you will find lines like:<block type="core/text_list" name="left" as="left"/><block ty...
2012-09-24 05:52:19 144
原创 Magento产品页面包屑导航(Breadcrumb)修正 Showing Breadcrumbs Anywhere in Magento
Breadcrumbs are very useful for user navigation. Breadcrumbs for product page, category page, etc. are created by default Magento code. The following code will show breadcrumbs created by Magent...
2012-09-19 22:37:29 597
原创 Magento条件筛选 addAttributeToFilter Conditionals In Magento
addAttributeToFilter is a function that can be called on a product collection in Magento. In short, it adds a condition to the WHERE part of the MySQL query used to extract a product collection from t...
2012-09-19 11:48:10 172
原创 magento 通过属性加载产品或类别 Load A Category or Product by an Attribute
New developers often ask me how to load a product by a particular attribute. This is quite easy to accomplish in Magento and can be done using Magento collections. Load a Product by SKU Unlike...
2012-09-19 11:37:27 129
原创 magento 获取类别和子类别 Display Categories and SubCategories in Magento
当前类别id和title$layer = Mage::getSingleton('catalog/layer');$_category = $layer->getCurrentCategory();$currentCategoryId= $_category->getId(); Mage::registry('current_category')->getNa...
2012-09-19 11:31:47 152
原创 magento 调用 newsletter模板 call newsletter/subscribe.phtml anywhere
system -> configuration -> advancedfrom there enable newsletter module. and then you can use the above code to call it anywhere. <?php echo $this->getLayout()->createBlock('ne...
2012-09-19 03:54:25 149
原创 Magento中调用JS文件的几种方法
一、全局调用方法:通过该方法每个页面都会引用这个JS文件,除非是类似jQuery这样的系统文件,不然不推荐这种方法。文件路径:/app/design/frontend/default/Your_Template/layout/page.xml你会看到很多类似于addJS这样的XML代码,这是magento的优势之一,通过XML来配置文件很方便灵活。如下:<acti...
2012-09-18 05:27:35 402
原创 Magento去除前台URL中显示的index.php
Magento安装完毕之后,我们会发现无论是在产品还是分类的URL地址之前,都有一个非常恶心的index.php。这种URL格式自己看着不爽,搜索引擎看着也不爽。如何把index.php从前台的URL地址中移除呢?好消息是,Magento自带的有该功能,只需要通过后台修改系统参数即可。首先在后台中进入如下节点。System->Configuration->General...
2012-09-12 22:42:23 322
原创 facebook 类 (文章信息,)
1. PHP Consumer -a small library for accessing of Open Graph Protocol data in PHP OpenGraph.php<?php/*Copyright 2010 Scott MacVicarLicensed under the Apache License, Version 2.0 ...
2012-09-11 03:31:56 195
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人