![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Magento
Jue_2014
PHP,Magento,Linux,Apache,Mysql
展开
-
Magento session的使用方法
To set a Magento session variable:$myValue = 'Hello World';Mage::getSingleton('core/session')->setMyValue($myValue);To Retrieve:$myValue = '';$myValue=Mage::get转载 2015-01-29 15:03:59 · 585 阅读 · 0 评论 -
Magento订单取消的时候还原优惠券的使用次数(Single Coupon marked as used when payment pending)
方法不难:利用magento的观察者事件,监听“sales_order_payment_cancel”,还原优惠券的使用次数即可。一、创建一个module二、config.xml文件如下: 0.1.0 Magete翻译 2015-06-22 18:08:37 · 1226 阅读 · 0 评论 -
Magento Registry (Mage::register)使用方法
想必很多PHP开发者都会想到使用session,cookie存储需要的数据,除此之外magento还提供registry存储所需的数据,非常方便和使用。所用的存储技术,没深入研究。原创 2015-01-22 17:24:48 · 1655 阅读 · 0 评论 -
Magento后台Grid表使用了Group By导致统计出错的解决办法
Wrong Count in Admin Grid When Using Group By : MagentoIf you have noticed or not, in edition 1.5 of Magento when you use GROUP BY clause in any Grid.php file in admin, the count always display翻译 2015-02-13 11:07:40 · 613 阅读 · 0 评论 -
Magento Rewrite Url的方法
在magento下rewrite url的方法有3种,在.htaccess文件下写相关的正则表达式、配置文件config.xml、还有一种是存储到url_rewrite model中。至于使用哪种,看个人需求。 如果只是固定的url地址的修改,可以直接在magento后台添加,具体操作可以参考网站:http://www.magentocommerce.com/knowledge-base/e原创 2015-01-22 17:53:26 · 1658 阅读 · 0 评论 -
Magento安装插件失败出现503错误的解决方法
今天用Magento安装一个插件失败了,再刷新前台,后台都打不开,网站标题显示503错误,只有magento connect页面能打开,错误提示如下:Service Temporarily UnavailableThe server is temporarily unable to service your request due to maintenance downtime or转载 2015-02-10 14:12:51 · 1182 阅读 · 0 评论 -
Magento如何调用图片
1.模板文件(.phtml) getSkinUrl('images/图片名') ?>2.布局文件(.xml) name="right"> method="setImgSrc">images/图片名 method="setImgAlt" translate="alt" module="catalog">K转载 2015-02-10 14:34:28 · 1082 阅读 · 0 评论 -
Magento Block获取各种URL的方法
Mage::getBaseUrl('media') //可获得 media 带 http 的url 地址。//同理也可以获得skin 和js 目录的地址:Mage::getBaseUrl('skin');Mage::getBaseUrl('js');//而获取带http 的网站根地址为:Mage::getBaseUrl('web');//在cms中调用的URL的转载 2015-02-10 14:33:13 · 1422 阅读 · 0 评论 -
Magento获取当前店铺信息(首页,类别,地址等)
1.获取当前店铺基本信息//获取店铺对象Mage::app()->getStore();//获取当前店铺IDMage::app()->getStore()->getStoreId();//获取当前店铺Code,该Code在创建店铺时填写Mage::app()->getStore()->getCode();//获取当前店铺所属的Website IDMage转载 2015-02-10 14:32:17 · 1496 阅读 · 0 评论 -
Magento创建CMS Page显示当前允许发货的国家名称,按字母排版.phtml文件
1、后台添加CMS Page URL:shipping-countries。 编辑layout文件: 2、创建countries.phtml文件<?php $_countries = $this->getCountryCollection()->toOptionArray(false); //获得当前运行发货原创 2015-02-10 14:17:42 · 580 阅读 · 0 评论 -
Magento获得用户所有的订单、喜欢的产品
$orders = Mage::getResourceModel('sales/order_collection') ->addFieldToSelect('*') ->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())原创 2015-02-10 14:23:51 · 1020 阅读 · 0 评论 -
Magento添加Facebook/Pinterest open graph meta,Google商店Feed
1、修改magento head.phtml模板文件:getName()); ?>" />helper('catalog/image')->init($product, 'image')->resize(486,253);?>" />getProductUrl(); ?>" />getShortDescription())); ?>" />getFi原创 2014-12-19 16:47:58 · 1001 阅读 · 0 评论 -
Magento顶、底部链接的修改
一、Magento顶部链接的修改:在页面Account增加一个top.link,只需在layout的xml文件reference top.lik My Homepage My Homepage转载 2015-01-26 16:02:33 · 1489 阅读 · 0 评论 -
10个最坏Magento的用法(10 worst Magento practices)
10个magento不好的用法。为了提高网站性能,开发者应该注意的地方。转载 2015-10-20 09:26:10 · 570 阅读 · 0 评论