php交流

2008-07-28

zencart如何开启错误提示

归类于: zencart — admin @ 9:37 am

在/include/application_top.php下找到如下代码,把它去掉就会显示错误.

if (defined(’STRICT_ERROR_REPORTING’) && STRICT_ERROR_REPORTING == true) {
@ini_set(’display_errors’, ‘1′);
error_reporting(E_ALL);
} else {
error_reporting(E_ALL & ~E_NOTICE);
}

2008-07-25

共享sensorforyou的最近浏览过的产品功能

归类于: zencart — admin @ 3:15 pm

很简单的一个功能,就是在产品内容页面放入一段代码,把当前的产品id放到cookie中,当检查到cookie中有相应的值时,就把他按自己的样子显示出来
1。在includes/modules/pages/product_info/header_php.php 中加入以下代码,以写cookie
if($_GET[’products_id’] != ”) {
if(!isset($_COOKIE[’product_history’]) ) {
$history_array = (int)$_GET[’products_id’];
zen_setcookie(’product_history’, $history_array, time()+60*60*24*30, ‘/’, ‘www.sensorforyou.com’);

} else {
$history_array = explode(’,',$_COOKIE[’product_history’]);
array_unshift($history_array,(int)$_GET[’products_id’]);
$history_array = array_unique($history_array);
if(count($history_array) > 6)
array_pop($history_array);
zen_setcookie(’product_history’, implode(’,',$history_array), time()+60*60*24*30, ‘/’, ‘www.sensorforyou.com’);

}

}
注意要自己把zen_setcookie函数的域名参数改为自己的域名 (阅读全文…)

基于 WordPress