/**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     switch ($this->getMode()) {
         case 'delete_favorite':
             // お気に入り削除
             $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id']));
             break;
         case 'getList':
             // スマートフォン版のもっと見るボタン用
             // ページ送り用
             if (isset($_POST['pageno'])) {
                 $this->tpl_pageno = intval($_POST['pageno']);
             }
             $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
             SC_Product_Ex::setPriceTaxTo($this->arrFavorite);
             // 一覧メイン画像の指定が無い商品のための処理
             foreach ($this->arrFavorite as $key => $val) {
                 $this->arrFavorite[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']);
             }
             echo SC_Utils_Ex::jsonEncode($this->arrFavorite);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     // ページ送り用
     if (isset($_POST['pageno'])) {
         $this->tpl_pageno = intval($_POST['pageno']);
     }
     $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objProduct = new SC_Product_Ex();
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     switch ($this->getMode()) {
         case 'delete_favorite':
             // お気に入り削除
             $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id']));
             break;
         case 'getList':
             // スマートフォン版のもっと見るボタン用
             // ページ送り用
             if (isset($_POST['pageno'])) {
                 $this->tpl_pageno = intval($_POST['pageno']);
             }
             $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
             $this->arrFavorite = $objProduct->setPriceTaxTo($this->arrFavorite);
             echo SC_Utils_Ex::jsonEncode($this->arrFavorite);
             SC_Response_Ex::actionExit();
             break;
     }
     // ページ送り用
     if (isset($_POST['pageno'])) {
         $this->tpl_pageno = intval($_POST['pageno']);
     }
     $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
示例#3
0
 public function doAction($arrParam)
 {
     $arrRequest = $this->doInitParam($arrParam);
     if (!$this->isParamError()) {
         $masterData = new SC_DB_MasterData_Ex();
         $arrSTATUS = $masterData->getMasterData('mtb_status');
         $arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image');
         $objProduct = new SC_Product_Ex();
         $arrSearchData = array('category_id' => $arrRequest['BrowseNode'], 'maker_name' => $arrRequest['Manufacturer'], 'name' => $arrRequest['Keywords'], 'orderby' => $arrRequest['Sort']);
         $arrSearchCondition = $this->getSearchCondition($arrSearchData);
         $disp_number = 10;
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $objQuery->setWhere($arrSearchCondition['where_for_count']);
         $objProduct = new SC_Product_Ex();
         $linemax = $objProduct->findProductCount($objQuery, $arrSearchCondition['arrval']);
         $objNavi = new SC_PageNavi_Ex($arrRequest['ItemPage'], $linemax, $disp_number);
         $arrProducts = $this->getProductsList($arrSearchCondition, $disp_number, $objNavi->start_row, $linemax, $objProduct);
         if (!SC_Utils_Ex::isBlank($arrProducts)) {
             $arrProducts = $this->setStatusDataTo($arrProducts, $arrSTATUS, $arrSTATUS_IMAGE);
             SC_Product_Ex::setPriceTaxTo($arrProducts);
             foreach ($arrProducts as $key => $val) {
                 $arrProducts[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']);
             }
             $arrData = array();
             foreach ($arrProducts as $key => $val) {
                 $arrData[] = array('product_id' => $val['product_id'], 'DetailPageURL' => HTTP_URL . 'products/detail.php?product_id=' . $val['product_id'], 'ItemAttributes' => $val);
             }
             $this->setResponse('Item', $arrData);
             return true;
         } else {
             $this->addError('ItemSearch.Error', '※ 要求された情報は見つかりませんでした。');
         }
     }
     return false;
 }
示例#4
0
 /**
  *
  * @return void
  */
 public function doJson()
 {
     $this->arrProducts = $this->setStatusDataTo($this->arrProducts, $this->arrSTATUS, $this->arrSTATUS_IMAGE);
     SC_Product_Ex::setPriceTaxTo($this->arrProducts);
     // 一覧メイン画像の指定が無い商品のための処理
     foreach ($this->arrProducts as $key => $val) {
         $this->arrProducts[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']);
     }
     echo SC_Utils_Ex::jsonEncode($this->arrProducts);
     SC_Response_Ex::actionExit();
 }