開発メモ

開発用のメモです。

EC CUBE カスタマ検索条件追加

class SC_CustomerList_Ex extends SC_CustomerList {

public function __construct( $array, $mode = '' ) {
    parent::__construct( $array );

    // 追加項目
    $key = "hoge";
    if( ! isset( $this->arrSql[ 'search_' . $key ] ) )
        $this->arrSql[ 'search_' . $key ] = '';
    if( is_array( $this->arrSql[ 'search_' . $key ] ) ) {
        $arrStatusVal = $this->setItemTerm( $this->arrSql[  'search_' . $key  ], $key );
        foreach( $arrStatusVal as $data ) {
            $this->arrVal[ ] = $data;
        }
    } else if( strlen( $this->arrSql[ 'search_' . $key ] ) > 0 ) {
        $this->setWhere( ' ' . $key . ' =  ?' );
        $this->arrVal[ ] = $this->arrSql[ 'search_' . $key ];
    }
}
Twitter: @asahina_alice