在后台创建一个order_form静态块
Block Title :Order Form
Identifier :order_form
Status :Enabled
Content :自定义内容
magento中调用静态块的几种方法
2015/5/27 下午9:33
shi yong
magento在首页显示最新产品
2015/5/27 下午9:57
shi yong
打开Magento后台管理面板
Go to CMS > Pages > Home page
切换到 content 栏
插入下面代码:
{{block type="catalog/product_new" column_count="6" products_count="12" name="home.catalog.product.new"alias="product_homepage"template="catalog/product/list.phtml"}}
释义:
column_count="6"
– 显示产品列的数量
products_count="12"
– 显示产品的数量
magento中如何获取/判断用户登录状态
2015/8/13 下午9:49
shi yong
大部分magento开发人员直接用
Mage::getSingleton('customer/session')->isLoggedIn()
来判断用户是否登录
比如一般magento开发人员会这样用
继续阅读magento在布局文件xml中如何添加/删除js和css
2015/8/14 下午9:03
shi yong
在magento中我们在head.phtml中调用css和js的代码是
<?php echo $this->getCssJsHtml() ?>
那么按照magento的规则,我们需要在layout中去加载css和js
在magento如何通过xml加载外部js呢?
通畅我们会引用外部的css和js,比如google的字体,jquery库以及其他的库
继续阅读magento获取Base Url , Skin Url , Media Url , Js Url , Store Url 和 Current Url
2015/8/15 下午8:53
shi yong
magento如何在phtml文件中获取url?
1. 获取 Base Url :
Mage::getBaseUrl();
2. 获取 Skin Url :
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
(a) Unsecure Skin Url :
继续阅读magento中避免jQuery与其它库冲突
2015/9/11 下午1:54
Luckcy
大家都知道,在magento中用的js库是prototype,而现在我们想用jQuery,那么这就涉及到兼容性问题了,因为prototype控制着magento默认的所有js效果,我们不可能去花费大量时间去把prototype替换成jQuery,这样代价太大了,下面就在magento中jQuery兼容prototype解决方法做下深入讲解
继续阅读