MAGENTO调用后台定义的静态区块的几种方法

在后台创建一个order_form静态块,内容分别如下:
Block Title: Order Form
Identifier: order_form
Status :Enabled
Content :自定义内容
方法一:如果要在.phtml文件中直接调用这个静态块,那可以采用以下两种方法
1:

<?php
$block = Mage::getModel(‘cms/block’)
->setStoreId(Mage::app()->getStore()->getId())
->load(‘order_form’);
$content = $block->getContent(); // Block的原始内容已经获得

$processor = Mage::getModel(‘core/email_template_filter’);
echo $html = $processor->filter($content);
?>
Mage::getModel(‘core/email_template_filter’)->filter()是必须的,因为Static Block里可能包含Magento的模板语言(如:{{store url=””}}),fiter将翻译成实际的值
Magento中调用静态Block主要有两个地方。
2:这代码太长了呢,那你还可以这么写
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘order_form’)->toHtml() ?>
方法二:如何在CMS页面的Content中调用这个静态块呢?你可以采用以下方法
{{block type=”cms/block”  name=”cms_test_block”  block_id=”order_form” }}
方法三:怎么样在layout中调用静态块呢
首先先设置block相应的xml内容:

  1. <reference name=”footer”>
  2. <block type=”cms/block” name=”order_form” before=”-“>
  3. <action method=”setBlockId”><block_id>order_form</block_id></action>
  4. </block>
  5. </reference>

然后在相应在模板文件.phtml中调用

getChildHtml('order_form');

方法四:内容中调用模板

{{block type=”core/template” template=”path-to-template.phtml”}}

zen-cart安装集成phpbb3的正确步骤和方法

看了一个网站关于zen-cart安装集成phpbb3的步骤和方法,基本都有些错误及不正确的地方,我了自己记录方便,我将步骤及方法介绍如下:
1 到www.phpbb.com 官方下载一个最新版,然后根据需要在http://www.phpbb.com/languages/,下载指定的语言,并把相应的目录language下.
2 在指定的zen-cart目录下建立一个forums或bbs的目录,将phpbb3代码放入目录中,找到指定的数据库用户名密码资料,就可以安装,安装过程中可选择指定的语言,当然安装后也可重新选择默认的语言.
3 由了phpbb3需要将zencart的一个类文件换掉,网上流传的代码有问题,我做了修正和补充./includes/classes/class.phpbb.php
4 在configure.php中的define(‘DIR_WS_PHPBB’, ‘/home/网站名/public_html/forums/’);设置完整的路径
5 在admin/基本设置 中 将  打开phpBB链接? 设置成true.
完成上述5个步骤,即可在用户注册时,将注册信息同时注入到phpbb3的数据库中

centos 如何安装yum的方法

CentOS 5 i386:

wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/elfutils-libs-0.137-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/gmp-4.1.4-10.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/readline-5.1-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-2.4.3-27.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-2.6.26-2.1.2.8.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.8.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/expat-1.95.8-8.2.1.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/sqlite-3.3.6-5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/elfutils-0.137-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/rpm-python-4.4.2.3-18.el5.i386.rpm # (1)
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/m2crypto-0.16-6.el5.6.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-3.2.22-20.el5.centos.noarch.rpm (2)
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm (2)

rpm -Uvh elfutils-libs-0.137-3.el5.i386.rpm
rpm -Uvh gmp-4.1.4-10.el5.i386.rpm
rpm -Uvh readline-5.1-3.el5.i386.rpm
rpm -Uvh python-2.4.3-27.el5.i386.rpm
rpm -Uvh python-iniparse-0.2.3-4.el5.noarch.rpm
rpm -Uvh libxml2-2.6.26-2.1.2.8.i386.rpm
rpm -Uvh libxml2-python-2.6.26-2.1.2.8.i386.rpm
rpm -Uvh expat-1.95.8-8.2.1.i386.rpm
rpm -Uvh python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh sqlite-3.3.6-5.i386.rpm
rpm -Uvh python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh elfutils-0.137-3.el5.i386.rpm
rpm -Uvh rpm-python-4.4.2.3-18.el5.i386.rpm # (1)
rpm -Uvh m2crypto-0.16-6.el5.6.i386.rpm
rpm -Uvh python-urlgrabber-3.1.0-5.el5.noarch.rpm
rpm -Uvh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
rpm -Uvh yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm   yum-3.2.22-20.el5.centos.noarch.rpm
yum -y update
CentOS 5 X86_64:

wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/gmp-4.1.4-10.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/readline-5.1-3.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-2.4.3-27.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/libxml2-2.6.26-2.1.2.8.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/libxml2-python-2.6.26-2.1.2.8.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/expat-1.95.8-8.2.1.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/sqlite-3.3.6-5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/elfutils-libelf-0.137-3.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/elfutils-0.137-3.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/rpm-4.4.2.3-18.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/rpm-python-4.4.2.3-18.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/m2crypto-0.16-6.el5.6.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

wget ftp://ftp.sunet.se/pub/Linux/distributions/centos/5.5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

wget ftp://ftp.sunet.se/pub/Linux/distributions/centos/5.5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm

rpm -Uvh gmp-4.1.4-10.el5.x86_64.rpm

rpm -Uvh readline-5.1-3.el5.x86_64.rpm
rpm -Uvh python-2.4.3-27.el5.x86_64.rpm
rpm -Uvh libxml2-2.6.26-2.1.2.8.x86_64.rpm
rpm -Uvh libxml2-python-2.6.26-2.1.2.8.x86_64.rpm
rpm -Uvh expat-1.95.8-8.2.1.x86_64.rpm
rpm -Uvh python-elementtree-1.2.6-5.x86_64.rpm
rpm -Uvh sqlite-3.3.6-5.x86_64.rpm
rpm -Uvh python-sqlite-1.1.7-1.2.1.x86_64.rpm
rpm -Uvh elfutils-libelf-0.137-3.el5.x86_64.rpm
rpm -Uvh elfutils-0.137-3.el5.x86_64.rpm
rpm -Uvh rpm-4.4.2.3-18.el5.x86_64.rpm
rpm -Uvh rpm-python-4.4.2.3-18.el5.x86_64.rpm
rpm -Uvh m2crypto-0.16-6.el5.6.x86_64.rpm
rpm -Uvh python-urlgrabber-3.1.0-5.el5.noarch.rpm
rpm -Uvh yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
rpm -Uvh python-iniparse-0.2.3-4.el5.noarch.rpm
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
rpm -Uvh yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm yum-3.2.22-26.el5.centos.noarch.rpm
yum -y update

如上述文件找不到,可到http://rpm.pbone.net/,找查找,然后继续安装
注意:安装的时候最好几个同时安装,如果单个安装的话可能会出现依赖问题。
出现了相互依赖的问题。

混在一起安装,如
# rpm -ihv xxx.rpm yyyy.rpm

zencart gspay如何进行调试的方法

zencart gspay如何进行调试的呢,以下有一个方法,可以方便地进行支付调试!
1 在includes\module\payment\gspay.php中 ,找到这行$process_button_string .= zen_draw_hidden_field(zen_session_name(), zen_session_id());在下方增加$process_button_string .= ‘<input type=”hidden” name=”TransactionMode” value=”test”>’;    保存即可

2 进行支付步骤跳到gspay支付页面,用户名为TEST TRANSACTION,支付卡号为:4444445555555555.选择Visa卡支付,CVV2号码可以是任意3位数字。

3 按上述步骤,你就可以进行不用付钱的gspay支付.

记得正常后要将上述语句删除!!!!!