2012/04/24

frontend cannot see pending payment orders


要加番 <visible_on_front/> 先會俾CUSTOMER見到...

app/code/core/Mage/Sales/etc/config.xml 

<new translate="label">
  <
label>New</label>
    <
statuses>
      <
pending/>
      <
processing/>
      <
holded/>
      <
complete/>
      <
closed/>
      <
canceled/>
    </
statuses>
    <
visible_on_front/>
  </new>
  <
pending translate="label">
    <
label>Pending</label>
    <
statuses>
      <
pending/>
      <
processing/>
      <
holded/>
      <
complete/>
      <
closed/>
      <
canceled/>
    </
statuses>
    <
visible_on_front/>
  </
pending>

漏左就會FRONTEND睇唔到某D STATUS既ORDER...

2012/04/17

Linux 下的各種解壓, 壓縮方法

 大致總結了一下Linux下各種格式的壓縮包的壓縮、解壓方法。.tar
打包:tar cvf FileName.tar DirName
解包: tar xvf FileName.tar

.gz
壓縮:gzip FileName
解壓1:gunzip FileName.gz
解壓2:gzip -d FileName.gz

.tar.gz
壓縮:tar zcvf FileName.tar.gz DirName
解壓:tar zxvf FileName.tar.gz

.bz2
壓縮: bzip2 -z FileName
解壓1:bzip2 -d FileName.bz2
解壓2:bunzip2 FileName.bz2

.tar.bz2
壓縮:tar jcvf FileName.tar.bz2 DirName
解壓:tar jxvf FileName.tar.bz2

.bz
壓縮:unkown
解壓1:bzip2 -d FileName.bz
解壓2:bunzip2 FileName.bz

.tar.bz
壓縮:unkown
解壓:tar jxvf FileName.tar.bz

.Z
壓縮:compress FileName
解壓:uncompress FileName.Z

.tar.Z
壓縮:tar Zcvf FileName.tar.Z DirName
解壓:tar Zxvf FileName.tar.Z

.tgz
壓縮:unkown
解壓:tar zxvf FileName.tgz


.tar.tgz
壓縮:tar zcvf FileName.tar.tgz FileName
解壓:tar zxvf FileName.tar.tgz

.zip
壓縮:zip FileName.zip DirName
解壓:unzip FileName.zip

.rar
壓縮:rar e FileName.rar
解壓:rar a FileName.rar

.lha
壓縮:lha -a FileName.lha FileName
解壓:lha -e FileName.lha

2012/04/16

javascript get/set cookie

/*set Cookie*/
function setCookie(c_name, c_data, expireDays){
var date=new Date();
if (!expireDays) expireDays = 1000;

date.setTime(date.getTime()+expireDays*24*3600*1000);
document.cookie = c_name+'='+escape(c_data)+'; expires='+date.toUTCString()+'; path=/';
}

/*get Cookie*/
function getCookie(c_name) {
if (document.cookie.length>0) {
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1) {
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}

2012/04/12

PHP 中 extract() 的功用

近日在看一個牛人的代碼時,看到一個非常好用的函數:extract(),它的主要作用是將數組展開,鍵名作為變量名,元素值為變量值,可以說為數組的操作提供了另外一個方便的工具,比方說,可以很方便的提取$_POST或者$_GET的元素,對錶單提交上來的內容不能不用一一賦值,直接使用下面代碼:
form.html


 
<form action="action.php" method="post"><input type="text" name="username"><input type="password" name="password"><input type="submit">
在action.php中只要使用extract()函數將$_POST全局數據解開:action.php


 
<?phpextract($_POST);//相當於$username = $_POST['username'];//$password = $_POST['password'];?>
是不是很方便呢?呵呵,下面是PHP手冊裡的詳細解釋:
extract(PHP 4, PHP 5)
extract — 從數組中將變量導入到當前的符號表

說明int extract ( array $var_array [, int $extract_type [, string $prefix ]] )
本函數用來將變量從數組中導入到當前的符號表中。接受結合數組var_array 作為參數並將鍵名當作變量名,值作為變量的值。對每個鍵/值對都會在當前的符號表中建立變量,並受到extract_type 和prefix 參數的影響。

2012/04/03

[MAGENTO] DASHBOARD 中的圖表消失了


DASHBOARD 中LAST 24 HOURS的圖表不見了

由官方論壇看到

                            
This is related to the minimal allowed GET variable length settings. Check your settings for suhosin:

suhosin.get.max_value_length 1024


SOLUTION: 
Putting “suhosin.get.max_value_length = 1024” into /etc/php5/conf.d/suhosinn.ini” reload apache