随笔分类 -  magento

摘要:在知道缓存机制前,首先需要知道,Magento的路由机制,这边就不做赘述了,百度一大堆。 下面一个简单的缓存生效流程: A:首先在页面开始时,Magento在app\code\core\Mage\Core\Model\App.php的run函数里 之后经由路由匹配分发,进入控制器,在控制器里,会加载 阅读全文
posted @ 2017-01-23 16:25 舟了个舟 阅读(1051) 评论(0) 推荐(0)
摘要:两个好用的插件: http://connect20.magentocommerce.com/community/MagnetoDebughttp://connect20.magentocommerce.com/community/dckap_speedanalyser当然也可以将 index.php 阅读全文
posted @ 2016-08-01 15:58 舟了个舟 阅读(196) 评论(0) 推荐(0)
摘要:背景是往一个第三方的搜索插件里面加入filter功能。 首先是路径,插件自己定义了一个router,类似于cms。那首先说说router好了,从入口一路追查的话,会发现最后进入的是Mage_Core_Controller_Varien_Front类下面的dispatch()函数。 前面的代码是把ur 阅读全文
posted @ 2016-07-26 10:07 舟了个舟 阅读(415) 评论(0) 推荐(0)
摘要:基础概念: http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/ 调试方案函数: 在 layout里面传参数 action 的一些method:http://www.demacmedia.com/ 阅读全文
posted @ 2016-07-15 16:16 舟了个舟 阅读(331) 评论(0) 推荐(0)
摘要:因为国外盗刷严重,于是得开启验证。 首先可以去 https://developer.cardinalcommerce.com/try-it-now.shtml。这上面有测试账号,截图如下: 这上面的信息填到 system/configuration/paymentServices/ 里面 接着去pa 阅读全文
posted @ 2016-07-13 08:54 舟了个舟 阅读(350) 评论(0) 推荐(0)
摘要:Magento Local module file is relative to app/code/local/ Magento Community module file is relative to app/code/community/ Magento Core team module fil 阅读全文
posted @ 2016-06-20 16:47 舟了个舟 阅读(178) 评论(0) 推荐(0)
摘要:流程图:最后 文字介绍:http://www.ecomdev.org/2012/08/28/magento-checkout-functionality-concept.html 阅读全文
posted @ 2015-10-21 13:47 舟了个舟 阅读(211) 评论(0) 推荐(0)
摘要:在模板页面不显示getMessage的解决方案是,在对应的控制器里加上如下代码:$this->_initLayoutMessages('customer/session'); 如果加入后出现如下图的bug则再加入如下代码$this->_initLayoutMessages('catalog/sess... 阅读全文
posted @ 2014-08-12 13:25 舟了个舟 阅读(254) 评论(0) 推荐(0)
摘要:首先建立如下的目录结构在channel.xml中如此写上 local http://localhost/channel/ local 在packages.xml中如此写 Jago_Deal 插件名 1.0.0 版本号 ... 阅读全文
posted @ 2014-08-05 16:46 舟了个舟 阅读(222) 评论(0) 推荐(0)
摘要:$product_id = Mage::registry('current_product')->getId(); 阅读全文
posted @ 2014-07-29 10:28 舟了个舟 阅读(285) 评论(0) 推荐(0)
摘要:查询:$model = Mage::getModel('mynews/mynews'); $collection = $model->getCollection(); $collection->addAttributeToSelect(array('name', 'image', 'url_key'... 阅读全文
posted @ 2014-07-25 15:58 舟了个舟 阅读(443) 评论(0) 推荐(0)
摘要:首先是配置文件config.xml里的配置 /*事件名字*/ /*模块名字*/ deal/observer_cart /*文件地址deal/Model/Observer/Cart.p... 阅读全文
posted @ 2014-07-07 17:10 舟了个舟 阅读(347) 评论(0) 推荐(0)
摘要:class Jago_Deal_IndexController extends Mage_Core_Controller_Front_Action{ public function ajaxAction() { $block = $this->getLayout()->cr... 阅读全文
posted @ 2014-05-29 10:34 舟了个舟 阅读(398) 评论(0) 推荐(0)
摘要:参考自http://fragmentedthought.com/fragments/programatically-creating-sales-rule-coupon-code上面的代码只能生成Coupon Code,却不能使用,需加入$coupon->setType(Mage_SalesRule... 阅读全文
posted @ 2014-05-28 14:09 舟了个舟 阅读(374) 评论(0) 推荐(0)
摘要:在用以下代码时,跳转后的url里面会是空的,即没有admin这个值$this->getUrl('admin/catalog_product/edit', array('id' => $customerId));解决方案,将admin改成adminhtmlreturn $this->getUrl('a... 阅读全文
posted @ 2014-05-28 10:24 舟了个舟 阅读(257) 评论(0) 推荐(0)
摘要:在使用grid时自己新建了几个属性,然后其中有一个是下拉单,即deal_status protected function _prepareCollection() { $collection = Mage::getModel('catalog/product')->getCol... 阅读全文
posted @ 2014-05-28 10:20 舟了个舟 阅读(292) 评论(0) 推荐(0)
摘要:在自定义的模块中若想要使用翻译,需在config.xml中加入如下配置 //后台 test.csv ... 阅读全文
posted @ 2014-05-27 09:56 舟了个舟 阅读(532) 评论(0) 推荐(0)
摘要:目的是做一个grid,参考博客http://www.sunzhenghua.com/magento-admin-module-development-part1-grid-forms-tabs-controllers,由于少了很多基础的配置,我便补充了一下一。开发的目录结构如下:Jago->Empl... 阅读全文
posted @ 2014-05-22 17:12 舟了个舟 阅读(869) 评论(0) 推荐(1)
摘要:问题出现于使用Grid时,解决方案。在使用的Model处添加public function _construct() { parent::_construct(); $this->_init('employee/employee'); }其中init内的数值由下面的... 阅读全文
posted @ 2014-05-22 13:41 舟了个舟 阅读(507) 评论(0) 推荐(0)