- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php
r22607 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Products_List extends LC_Page_Ex 35 { 34 class LC_Page_Products_List extends LC_Page_Ex { 36 35 37 36 // {{{ properties … … 69 68 * @return void 70 69 */ 71 function init() 72 { 70 function init() { 73 71 parent::init(); 74 72 … … 85 83 * @return void 86 84 */ 87 function process() 88 { 85 function process() { 89 86 parent::process(); 90 87 $this->action(); … … 97 94 * @return void 98 95 */ 99 function action() 100 { 96 function action() { 101 97 102 98 $objProduct = new SC_Product_Ex(); … … 147 143 } 148 144 149 $this->tpl_rnd = SC_Utils_Ex::sfGetRandomString(3); 145 $this->tpl_rnd = SC_Utils_Ex::sfGetRandomString(3); 146 147 150 148 } 151 149 … … 155 153 * @return void 156 154 */ 157 function destroy() 158 { 155 function destroy() { 159 156 parent::destroy(); 160 157 } … … 165 162 * @return integer カテゴリID 166 163 */ 167 function lfGetCategoryId($category_id) 168 { 164 function lfGetCategoryId($category_id) { 169 165 170 166 // 指定なしの場合、0 を返す … … 190 186 191 187 /* 商品一覧の表示 */ 192 function lfGetProductsList($searchCondition, $disp_number, $startno, $linemax, &$objProduct) 193 { 188 function lfGetProductsList($searchCondition, $disp_number, $startno, $linemax, &$objProduct) { 194 189 195 190 $arrOrderVal = array(); … … 229 224 ,product_id DESC 230 225 __EOS__; 231 $objQuery->setOrder($order);226 $objQuery->setOrder($order); 232 227 break; 233 228 } … … 249 244 250 245 /* 入力内容のチェック */ 251 function lfCheckError($product_id, &$arrForm, $tpl_classcat_find1, $tpl_classcat_find2) 252 { 246 function lfCheckError($product_id, &$arrForm, $tpl_classcat_find1, $tpl_classcat_find2) { 253 247 254 248 // 入力データを渡す。 … … 274 268 * @return void 275 269 */ 276 function lfGetDisplayNum($display_number) 277 { 270 function lfGetDisplayNum($display_number) { 278 271 // 表示件数 279 272 return (SC_Utils_Ex::sfIsInt($display_number)) … … 287 280 * @return str 288 281 */ 289 function lfGetPageTitle($mode, $category_id = 0) 290 { 282 function lfGetPageTitle($mode, $category_id = 0) { 291 283 if ($mode == 'search') { 292 284 return '検索結果'; … … 294 286 return '全商品'; 295 287 } else { 296 $objCategory = new SC_Helper_Category_Ex(); 297 $arrCat = $objCategory->get($category_id); 298 return $arrCat['category_name']; 288 $arrCat = SC_Helper_DB_Ex::sfGetCat($category_id); 289 return $arrCat['name']; 299 290 } 300 291 } … … 305 296 * @return array 306 297 */ 307 function lfGetSearchConditionDisp($arrSearchData) 308 { 298 function lfGetSearchConditionDisp($arrSearchData) { 309 299 $objQuery =& SC_Query_Ex::getSingletonInstance(); 310 300 $arrSearch = array('category' => '指定なし', 'maker' => '指定なし', 'name' => '指定なし'); … … 316 306 // メーカー検索条件 317 307 if (strlen($arrSearchData['maker_id']) > 0) { 318 $objMaker = new SC_Helper_Maker_Ex(); 319 $maker = $objMaker->get($arrSearchData['maker_id']); 320 $arrSearch['maker'] = $maker['name']; 308 $arrSearch['maker'] = $objQuery->get('name', 'dtb_maker', 'maker_id = ?', array($arrSearchData['maker_id'])); 321 309 } 322 310 … … 333 321 * @return int 334 322 */ 335 function lfGetProductAllNum($searchCondition) 336 { 323 function lfGetProductAllNum($searchCondition) { 337 324 // 検索結果対象となる商品の数を取得 338 325 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 347 334 * @return array 348 335 */ 349 function lfGetSearchCondition($arrSearchData) 350 { 336 function lfGetSearchCondition($arrSearchData) { 351 337 $searchCondition = array( 352 338 'where' => '', … … 391 377 } 392 378 379 $searchCondition['where_for_count'] = $searchCondition['where']; 380 393 381 // 在庫無し商品の非表示 394 382 if (NOSTOCK_HIDDEN) { 395 383 $searchCondition['where'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 396 } 397 398 // XXX 一時期内容が異なっていたことがあるので別要素にも格納している。 399 $searchCondition['where_for_count'] = $searchCondition['where']; 384 $searchCondition['where_for_count'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 385 } 400 386 401 387 return $searchCondition; … … 407 393 * @return str 408 394 */ 409 function lfSetSelectedData(&$arrProducts, $arrForm, $arrErr, $product_id) 410 { 395 function lfSetSelectedData(&$arrProducts, $arrForm, $arrErr, $product_id) { 411 396 $js_fnOnLoad = ''; 412 397 foreach ($arrProducts as $key => $value) { … … 429 414 * @return void 430 415 */ 431 function lfAddCart($arrForm, $referer) 432 { 416 function lfAddCart($arrForm, $referer) { 433 417 $product_class_id = $arrForm['product_class_id']; 434 418 $objCartSess = new SC_CartSession_Ex(); … … 444 428 * @return Array $arrProducts 商品一覧情報 445 429 */ 446 function setStatusDataTo($arrProducts, $arrStatus, $arrStatusImage) 447 { 430 function setStatusDataTo($arrProducts, $arrStatus, $arrStatusImage) { 448 431 449 432 foreach ($arrProducts['productStatus'] as $product_id => $arrValues) { … … 465 448 /** 466 449 * 467 * @ return void468 * /469 function doJson()470 {450 * @param type $objProduct 451 * @return void 452 */ 453 function doJson(&$objProduct) { 471 454 $this->arrProducts = $this->setStatusDataTo($this->arrProducts, $this->arrSTATUS, $this->arrSTATUS_IMAGE); 472 SC_Product_Ex::setPriceTaxTo($this->arrProducts);455 $this->arrProducts = $objProduct->setPriceTaxTo($this->arrProducts); 473 456 474 457 // 一覧メイン画像の指定が無い商品のための処理 … … 486 469 * @return void 487 470 */ 488 function doDefault(&$objProduct) 489 { 471 function doDefault(&$objProduct) { 490 472 //商品一覧の表示処理 491 473 $strnavi = $this->objNavi->strnavi; … … 536 518 $this->lfAddCart($this->arrForm, $_SERVER['HTTP_REFERER']); 537 519 538 // 開いているカテゴリーツリーを維持するためのパラメーター 539 $arrQueryString = array( 540 'category_id' => $this->arrForm['category_id'], 541 ); 542 543 SC_Response_Ex::sendRedirect(CART_URLPATH, $arrQueryString); 520 521 SC_Response_Ex::sendRedirect(CART_URLPATH); 544 522 SC_Response_Ex::actionExit(); 545 523 } … … 552 530 } 553 531 554 $this->tpl_javascript .= 'function fnOnLoad() 555 {' . $js_fnOnLoad . '}'; 532 $this->tpl_javascript .= 'function fnOnLoad(){' . $js_fnOnLoad . '}'; 556 533 $this->tpl_onload .= 'fnOnLoad(); '; 557 534 }
Note: See TracChangeset
for help on using the changeset viewer.