
MAGENTO
文章平均质量分 73
TerryWater
不知道自己什么时候会死,不知道什么是神仙,不知道什么是佛,只知道自己现在活着,那么,就做活着的事情,做人的事情,快乐和痛苦都是做人的享受!
很不喜欢人间那深深的夜晚,令人心乱的孤寂!那么,在夜晚和孤寂的时候我就写博客!!
展开
-
在产品详细页面的产看上一个,下一个产品的代码!
$_helper = $this->helper('catalog/output'); $_product = $this->getProduct(); $prev_url = $next_url = $url = $_product->getProductUrl(); if ($this->helper('catalog/data')->getCategory()) { $category = $this->helper('catalog/data')->getCa原创 2010-12-16 23:40:00 · 830 阅读 · 0 评论 -
在phtml和block中获取各种URL地址
在Magento的二次开发中,我们经常要用magento中的函数去获取各种URL。为了Magento程序升级的方便而又不需要去大动干戈重建模块的时候,我们可以直接在magento block中编写php代码。下面是一些常用的获取URL的函数:在Magento block中获取各种URL的代码获取media目录带http的url 地址:Mage::getBaseUrl('media')同理可以获得skin 和js 目录的地址:Mage::getBaseUrl('skin'),Mage::getBaseUrl(原创 2010-12-17 00:20:00 · 1165 阅读 · 0 评论 -
wordpress和magento整合
1.magento 1.4.1.1 wordpress2安装插件名称: Fishpig's Wordpress IntegrationExtension Key:magento-community/Fishpig_Wordpress_Integration网址: http://www.magentocommerce.com/magento-connect/fishpig/extension/3958/fishpig_wordpress_integration介绍:原创 2010-12-17 00:39:00 · 1361 阅读 · 0 评论 -
多网店下修改价格倍数
1.新建一个page2{{block type="catalog/product_list" name="fdfsfd" template="ter/ter.phtml"}}3新建ter/ter.phtml文件里面包含如下代码:getStoreId();Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);//$collection = Mage::getResourceModel(原创 2010-12-19 00:32:00 · 846 阅读 · 1 评论 -
MSN QQ在线聊天代码
QQ的在线交谈代码:在线qq交流MSN从7。5开始加入了命令行控制,你可以在网页中加入“与我交谈”这样的按钮了,访问者点击就可以直接用他的MSN与你对话,代码是建立对话:msnim:chat?contact=[邮件地址]添加好友:msnim:add?contact=[邮件地址]语音聊天:msnim:voice?contact=[邮件地址]视频聊天:msnim:video?contact=[邮件地址]用的时候把[邮件地址]写成你的MSN账号,不要方括号,原创 2010-12-20 01:54:00 · 984 阅读 · 0 评论 -
我的Mangento博客
我的博客开场白!原创 2010-12-16 23:28:00 · 834 阅读 · 0 评论 -
GB2312和utf8编码转换
经常的写中文出现乱码,用编码器翻译在粘上去,有的还翻译不过去。还是用翻译函数吧:gb2312转换成utf-8$utf=iconv('GB2312', 'UTF-8', $_REQUEST['keyword']);将字符串utf-8码转换为gb2312码$str = iconv("UTF-8","GB2312//TRANSLIT",$str);PHP编码转换函数iconv() 函数 Definition and Usage 定义和用法 iconv()函数的作用是:转换字符串的编码。Description原创 2010-12-17 00:47:00 · 1323 阅读 · 0 评论 -
magento核心类Varien_Object
<br />magento所有的数据模型都继承自类“Varien_Object”。这个类属于Magento的系统类库.<br /> <br />1<br />lib/Varien/Object.php<br />Magento模型的数据保存在“_data”属性中,这个属性是“protected”修饰的。父类“Varian_Object”定义了一些函数用来取出这些数据。我们上面的例子用了“getData”,这个方法返回一个数组,数组的元素是“key/value”对。【注:其实就是数据表中一行的数 据,“key原创 2010-12-19 00:55:00 · 872 阅读 · 0 评论 -
产品列表页面函数的整理!
type="catalog/product_list"catalog/product/list.phtml//得到当前分类下的产品集合$_productCollection=$this->getLoadedProductCollection();//得到帮助类 $_helper = $this->helper('catalog/output');//得到分页导航栏目$this->getToolbarHtml()//得到详细页面地址。$_produc原创 2010-12-20 01:47:00 · 661 阅读 · 0 评论 -
Mangento init process
Magento init process bare essentialsPosted by branko in Magento | Comments OffThisarticle is meant to be a start up point for “newbies” getting ready todigg seriously into the Magetno. When I say newbie’s, I meant nodisrespect, I only ment new to Ma原创 2010-12-16 23:30:00 · 830 阅读 · 0 评论 -
URL重写--我认为的
1.url生成器网址:(不会写正则表达式,可以通过下面的工具生成!)http://seohelper.cn/tools/urlrewrite根据写入的URL生成2种不同的URL规则(就是正则表达式)2.URL重写---名词解释: url是由服务器拦截,然后解析出来,默认的规则是ddd.php?id=1&page=2,通过?,&来识别。 可以通过web根目录下的.htaccess文件对其进行重写:原理就是你通过一个URL格式访问时,通过重写规则,翻译成ddd.php?id=1&page=2这种格式 重写机制充原创 2010-12-17 00:16:00 · 750 阅读 · 0 评论 -
Magento在代码中调用静态块
<br /><br />Magento在代码中调用静态块(Static Block)<br />文章分类:PHP编程<br />假设有在Magento后台建立一个Static Block名字为'footer_links',在phtml(其他php文件中方法一样)中调用方式如下:<br />Php代码 // Block是与店铺相关的,所以要设置setStoreId. $block = Mage::getModel('cms/block') ->setStoreId(M原创 2010-12-20 01:58:00 · 535 阅读 · 0 评论 -
MWD News and Testimonials with Images Extension该插件的安装!
在水水博客里看到这个插件:挺好!安装了一下,正好把公司的article问题解决了!!插件名称: MWD News and Testimonials with Images ExtensionExtension Key:magento-community/MWD_News_and_Testimonials_with_Images_Extension网址: http://www.magentocommerce.com/extension/specs/3708/mwd_news_and_tes原创 2010-12-18 01:02:00 · 979 阅读 · 0 评论 -
杂
<br />1.QQ生成。<br />http://wp.qq.com/index.html<br />2.支付宝<br />接口地址:www.alipay.com/cooperate/gateway.do<br />3.傻逼都可以做wordpress的网址教程:http://fairyfish.net/2007/06/04/so-you-want-to-create-wordpress-themes-huh/<br />4.magento比较好的博客:http://www.wemvc.com/1187.h原创 2010-12-19 00:49:00 · 871 阅读 · 0 评论 -
magento核心类Varien_Object
<br />magento所有的数据模型都继承自类“Varien_Object”。这个类属于Magento的系统类库.<br /> <br />1<br />lib/Varien/Object.php<br />Magento模型的数据保存在“_data”属性中,这个属性是“protected”修饰的。父类“Varian_Object”定义了一些函数用来取出这些数据。我们上面的例子用了“getData”,这个方法返回一个数组,数组的元素是“key/value”对。【注:其实就是数据表中一行的数 据,“key原创 2010-12-19 00:55:00 · 922 阅读 · 0 评论 -
来一篇英文转载文章---magento----widgets
<br /><br />如何新建一个自己的widgets:http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-magento-widget-part-1<br /> <br /> <br />Magentowidgets<br />What is a Magento widget?<br />MagentoWidgets are Magento extensions with a predefined set原创 2010-12-22 00:10:00 · 742 阅读 · 0 评论 -
个人对magento整体的理解
<br />magneto,设计的,仿佛带有灵性,很有感知力的开源系统,从底层设计,到高层功能,都堪称优秀!<br /> <br />magento系统-----世界<br />magento模块-----个人<br /> <br />magento强大的可扩展性,稳定性,可配置型,可重写性,带有人性的气息。<br /> <br />通过magento的门户类mage::可以访问任何模块(当然有权限约束),相当于人人之间的交流。<br /> <br />通过重写机制重写已经存在的模块,相当于改造人。<br原创 2010-12-23 00:20:00 · 729 阅读 · 0 评论 -
在magento中如何调用static block
<br />问题:在magento中如何调用static block?(系统面板内CMS---->static block) <br /><br />解答:若想在站点页面的某个地方放点静态的内容,比如广告,或者是促销信息之类的,这样的东西完全没有<br /><br />必要新建一个block。完全可以使用cms内的static block。创建完后,记住static block的id并在网站中调用<br /><br />.<br />调用static block<br />三个地方三种方转载 2010-12-23 00:22:00 · 720 阅读 · 0 评论 -
Magento事件一览表
<br />magento -- Magento事件一览表 Magento Module Event Name ParametersMage Admin admin_session_user_login_success array('user'=>$user)Mage Admin admin_session_user_login_failed array('user_name'=>$username, 'exception' => $e)Mage Admin admin_u转载 2010-12-23 00:23:00 · 828 阅读 · 0 评论 -
magent controller
<br /><br />Magento isbased on MVC model. This model helps for definingmodels, view (layout + templates) and controllers.Despite big amount of modules available by default in Magento and on Magento Connect, you may want to create your own module and转载 2010-12-23 00:38:00 · 635 阅读 · 0 评论 -
magento 模块重写机制
<br /><br />由magento重写功能所想到的:<br /> <br />1.在etc/config.xml中<br /> 第一层为<config><br /> 第二层为<module>,<global>,<admin>,<adminhtml>,<frontend>,<default>等。<br /> <br />2.重写内容<br /> <br /> <br />1>block--在config.xml文件中block重写的配置<br /> <br /><global><br /><blocks原创 2010-12-22 00:07:00 · 702 阅读 · 0 评论 -
输出出错信息!!
1errors/Change local.xml.sample to local.xml2then Open magento/lib/Zend/Cache/Backend/File.php Quote:protected $_options = array('cache_dir' => 'null', and Change it to: Quote:protected $_options = array('cache_dir' => 'tmp/',转载 2010-12-26 01:34:00 · 489 阅读 · 0 评论 -
magento——后台导入产品数据注意的问题
<br /><br />导入数据:<br /> <br /> <br />1:导入数据必须语言一直:最好都是英文。<br />2:sku的值不能重复,<br />3:导入前图片放在media /import目录下,路径对应好,开头/。<br />4:自定义属性设置好。<br />5:吧compiler关闭。必须关闭,不的话自定义属性不能导入。缓存关闭。<br />6:产品放入的design:目录要改。<br />7:FTP属性要改动,我也不知道有没有影响。<br />8:基本上就这些,需要的资料看其他文本。原创 2010-12-26 01:39:00 · 920 阅读 · 0 评论 -
低版本magento的一个session的bug
<br />低版本magento的一个session的bug<br /><br /><br />今天公司的低版本magento1.3.2.4,出现了一个问题,火狐可以进入购物车页面,但是IE,谷歌,苹果浏览器都不能进入,谷歌搜索了下,下面是具体:<br /><br />Magento ver. 1.3.2.4,这个版本的magento,用谷歌,IE,进入购物车页面的时候,会转到enable-cookies这个页面。说浏览器不支持session,按照它的方式设置浏览器,还是不行,上谷歌搜索,最后找到了原创 2010-12-27 00:25:00 · 749 阅读 · 0 评论 -
magento -- magento connect中我常用的key和magento网站收集
<br />magento -- magento connect中我常用的key和magento网站收集 <br /><br />magento开发过程中常用备用的magento connect key,包含语言包,模板,SEO工具等<br /><br />语言包:<br /><br />French:magento-community/Locale_Mage_community_fr_FR<br />German:magento-community/Locale_Mage_communit转载 2010-12-27 00:28:00 · 932 阅读 · 0 评论 -
MAGENTO数据转移/换服务器/换域名
<br />MAGENTO数据转移/换服务器/换域名<br />1.进入原来的phymyadmin,选择magento的那个数据库,在右边的标签上点击导出。<br />2.全选所有的表,结构那儿都勾上:添加 DROP TABLE,如果不存在就增加,添加 AUTO_INCREMENT 值,请在表名及字段名使用引号;数据那儿选择完整插入;勾上另存为文件,点击执行,保存当前数据库 。<br />3.打开保存的数据库导出的文件<br />在头上添加<br />SET @OLD_CHARACTER_SET_CLIEN原创 2010-12-24 17:45:00 · 896 阅读 · 0 评论 -
js首页图片切换
<br /><style type="text/css"> <br />.js_picshow { z-index:444; position:relative; background-color:#e4f2fa; width: 100%; height: 250px}<br />.js_picshow_main { position: relative; width: 690px; height: 250px}<br />.js_picshow_main .imgbig { filter: progid:转载 2010-12-26 01:36:00 · 639 阅读 · 0 评论 -
magento--12--24--2010
<br />今天周五了,明天休息,算是周末,看看这周学到什么了。<br />magento库文件lib下面的varien的库文件---作为应用其他第三方库文件的入口文件。<br />magento的门户文件Mage.php,通过一些例子,慢慢推敲。<br />magento功能和文件结构的组成,<br />magento event的格式书写,定义方式,在程序中一些没有直线推导性的东西要去找event,_prepare();<br />昨天晚上加今天上午才把后台控件grid的使用走下来,还得搞清楚细节,推敲原创 2010-12-24 17:40:00 · 471 阅读 · 0 评论 -
获取数据!!
<br />1<br />Magnto获取当前店铺和店铺配置的方法<br />开发中常常用到获取当前店铺的ID或者获取当前店铺的配置。其实非常的简单,看代码:<br />1、获取店铺<br />$store = Mage::app()->getStore();<br />你可以print一下$store,它是Mage_Core_Model_Store对象,获取数据可以通过下面代码获取<br />$store = Mage::app()->getStore()->getData();<br />2、获取当前店原创 2010-12-24 17:50:00 · 587 阅读 · 0 评论 -
自定义Magento系统配置
<br /><br />Magento拥有十分强大的后台管理系统。作为一名开发人员,这套后台管理系统可以让你的用户简单直接的配置Magento系统或者你创建的模块。和Magento的其他功能一样,你第一次使用这套管理系统的时候可能觉得很麻烦,但是一旦你上手了,你会发现它强大的功能是那么吸引人。那么让我们开始吧。我们这一章的例子依然是基于Helloworld模块。<br /> <br />添加系统配置文件<br />首先我们要为模块添加一个系统配置文件。这个文件和“config.xml”是不搭界的<br />转载 2010-12-26 01:31:00 · 663 阅读 · 0 评论 -
How to Get All Product Images in products list page?
<br /><br /> <br /> <br /><!-- Bring in gallery Images --><br /> <?php $_gallery = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages(); ?><br /> <?php $imgcount = Mage::getModel('ca转载 2010-12-28 20:41:00 · 659 阅读 · 0 评论 -
css中hover的妙用!!
<br /><br />css<br />中有个属性为hover、当鼠标放上的时候,将其激活,可以实现类似于js的一些,譬如菜单等功能:<br /> <br />22.html文件:<br /> <br /><link rel="stylesheet" type="text/css" href="11.css" media="all" /><br /> <br /> <br /><div id="dd"> <span>dddddddddddddd</span><br><a href="">terry</a>原创 2010-12-30 00:18:00 · 1886 阅读 · 0 评论 -
Magento中如何调用SQL语句------magento----摘来的其他不错的!
<br /> <br />1.Magento运行出现错误的解决方法 <br /> <br />Magento根目录下的lib/Varien/Simplexml中的config.php文件,在顶段加上error_reportting(0);来屏蔽php的错误或异常捕捉就行了,不过,只是在Warning提示时才好用,如果时Error的话建议另辟蹊径<br /> <br /> <br />2.How to get currency symbol? <br /> <br />Here’s another way t翻译 2010-12-29 00:58:00 · 668 阅读 · 0 评论 -
java语言讲解singleton的编程思想---深入浅出单实例Singleton设计模式
深入浅出单实例Singleton设计模式前序单实例Singleton设计模式可能是被讨论和使用的最广泛的一个设计模式了,这可能也是面试中问得最多的一个设计模式了。这个设计模式主要目的是想在整个系统中只能出现一个类的实例。这样做当然是有必然的,比如你的软件的全局配置信息,或者是一个Factory,或是一个主控类,等等。你希望这个类在整个系统中只能出现一个实例。当然,作为一个技术负责人的你,你当然有权利通过使用非技术的手段来达到你的目的。比如:你在团队内部明文规定,“XX类只能有一个全局实例,如果某人使用两次以转载 2011-01-01 01:58:00 · 946 阅读 · 0 评论 -
深入理解Magento – 第四章 – 模型和ORM基础.doc
深入理解Magento – 第四章 – 模型和ORM基础对于任何一个MVC架构,模型(Model)层的实现都是占据了很大一部分。对于Magento来说,模型占据了一个更加重要的位置,因为它常常包含了一部分商业逻辑代码(可以说它对,也可以说它错)。这些代码在其他的MVC框架中往往出现在控制器或者帮助函数中。传统的PHP MVC架构中的模型本来MVC的定义就不是很清晰,不同的人有不同的看法,而对于模型的定义争议就更多了。在MVC模式被广泛采用之前,PHP程序员往往通过SQL语句直接操作数据库。也有些转载 2011-01-09 23:32:00 · 732 阅读 · 0 评论 -
magento -- 用Magento的方式读写XML
magento -- 用Magento的方式读写XML <br />Iwill be using Varien_Simplexml_Element class to read write xml nodes.The path to this class file is lib/Varien/Simplexml/Element.php<br /><br />Hereis a sample XML file which I am going to read through Magen转载 2011-01-11 21:36:00 · 891 阅读 · 0 评论 -
深入理解Magento – 第五章 – Magento资源配置.doc
<br /><br />深入理解Magento – 第五章 – Magento资源配置<br />对于任何一个更新频繁的项目来说,保持开发环境和生产环境的数据库同步是件很头疼的事情。Magento提供了一套系统,用版本化的资源迁移脚本来解决这个问题。<br />上一章,我们为 Helloworld Blogpost 创建了一个模型。我们直接通过SQL语句“CREATE TABLE”来创建数据表。在这一章,我们将为Helloworld模块创建一个资源配置(Setup Resource)用于创建数据表。我们也会转载 2011-01-09 23:33:00 · 653 阅读 · 0 评论 -
Magento Development Environment
<br />Magento Development Environment<br />Learning Magento can range from frustrating to infuriating for the first time user. Here’s a few tips to ease the burden of assimilating an entirely new system.Turn on Logging<br />While the Magento Community Edit原创 2011-01-15 23:16:00 · 567 阅读 · 0 评论 -
magento -- 客户无法使用contact us 发邮件
<br />magento -- 客户无法使用contact us 发邮件 - Unable to submit your request. Please, try again later <br /><br />magento的contact us是一个非常重要的一个功能,当在线客服不在时,客户可以通过contact us发送邮件来联系我们。问题是,总是会出来这样或者那样的问题导致magento下面的这个功能无法使用。<br /><br />我这边要说明的是一种非常特殊的情况引起的这个问题。但是我转载 2011-01-14 13:50:00 · 1145 阅读 · 0 评论 -
开启Log记录
<br />只要后台开启Log记录,Log就默认写到var/log/exception.log和system.log文件 <br />1. 后台开启Log。 <br /><br />2. 代码中使用Mage::log()。 <br />例: <br />Php代码 Mage::log('Anything you want to log here');原创 2011-01-15 21:32:00 · 619 阅读 · 0 评论