Ejemplo n.º 1
0
 public function doAction($arrParam)
 {
     $arrRequest = $this->doInitParam($arrParam);
     if (!$this->isParamError()) {
         $masterData = Application::alias('eccube.db.master_data');
         $arrSTATUS = $masterData->getMasterData('mtb_status');
         $arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image');
         /* @var $objProduct Product */
         $objProduct = Application::alias('eccube.product');
         $arrSearchData = array('category_id' => $arrRequest['BrowseNode'], 'maker_name' => $arrRequest['Manufacturer'], 'name' => $arrRequest['Keywords'], 'orderby' => $arrRequest['Sort']);
         $arrSearchCondition = $this->getSearchCondition($arrSearchData);
         $disp_number = 10;
         $objQuery = Application::alias('eccube.query');
         $objQuery->setWhere($arrSearchCondition['where_for_count']);
         /* @var $objProduct Product */
         $objProduct = Application::alias('eccube.product');
         $linemax = $objProduct->findProductCount($objQuery, $arrSearchCondition['arrval']);
         /* @var $objNavi PageNavi */
         $objNavi = Application::alias('eccube.page_navi', $arrRequest['ItemPage'], $linemax, $disp_number);
         $arrProducts = $this->getProductsList($arrSearchCondition, $disp_number, $objNavi->start_row, $linemax, $objProduct);
         if (!Utils::isBlank($arrProducts)) {
             $arrProducts = $this->setStatusDataTo($arrProducts, $arrSTATUS, $arrSTATUS_IMAGE);
             Application::alias('eccube.product')->setPriceTaxTo($arrProducts);
             foreach ($arrProducts as $key => $val) {
                 $arrProducts[$key]['main_list_image'] = Utils::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;
 }
Ejemplo n.º 2
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     $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);
             Application::alias('eccube.product')->setPriceTaxTo($this->arrFavorite);
             // 一覧メイン画像の指定が無い商品のための処理
             foreach ($this->arrFavorite as $key => $val) {
                 $this->arrFavorite[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']);
             }
             echo Utils::jsonEncode($this->arrFavorite);
             Application::alias('eccube.response')->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;
 }
Ejemplo n.º 3
0
 /**
  *
  * @return void
  */
 public function doJson()
 {
     $this->arrProducts = $this->setStatusDataTo($this->arrProducts, $this->arrSTATUS, $this->arrSTATUS_IMAGE);
     Application::alias('eccube.product')->setPriceTaxTo($this->arrProducts);
     // 一覧メイン画像の指定が無い商品のための処理
     foreach ($this->arrProducts as $key => $val) {
         $this->arrProducts[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']);
     }
     echo Utils::jsonEncode($this->arrProducts);
     Application::alias('eccube.response')->actionExit();
 }