コード例 #1
0
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     $objAddress = new SC_Helper_Address_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     switch ($this->getMode()) {
         // お届け先の削除
         case 'delete':
             if ($objFormParam->checkError()) {
                 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                 SC_Response_Ex::actionExit();
             }
             $objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'));
             break;
             // スマートフォン版のもっと見るボタン用
         // スマートフォン版のもっと見るボタン用
         case 'getList':
             $arrData = $objFormParam->getHashArray();
             //別のお届け先情報
             $arrOtherDeliv = $objAddress->getList($customer_id, ($arrData['pageno'] - 1) * SEARCH_PMAX);
             //県名をセット
             $arrOtherDeliv = $this->setPref($arrOtherDeliv, $this->arrPref);
             $arrOtherDeliv['delivCount'] = count($arrOtherDeliv);
             $this->arrOtherDeliv = $arrOtherDeliv;
             echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv);
             SC_Response_Ex::actionExit();
             break;
             // お届け先の表示
         // お届け先の表示
         default:
             break;
     }
     //別のお届け先情報
     $this->arrOtherDeliv = $objAddress->getList($customer_id);
     //お届け先登録数
     $this->tpl_linemax = count($this->arrOtherDeliv);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
コード例 #2
0
 /**
  * 配送住所のプルダウン用連想配列を取得する.
  *
  * 会員ログイン済みの場合は, 会員登録住所及び追加登録住所を取得する.
  * 非会員の場合は, 「お届け先の指定」画面で入力した住所を取得する.
  *
  * @param  SC_Customer        $objCustomer SC_Customer インスタンス
  * @param  SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_Helper_Address_Ex $objAddress
  * @return array              配送住所のプルダウン用連想配列
  */
 public function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress)
 {
     $masterData = new SC_DB_MasterData_Ex();
     $arrPref = $masterData->getMasterData('mtb_pref');
     $arrResults = array('' => '選択してください');
     // 会員ログイン時
     if ($objCustomer->isLoginSuccess(true)) {
         $addr = array(array('other_deliv_id' => NULL, 'customer_id' => $objCustomer->getValue('customer_id'), 'name01' => $objCustomer->getValue('name01'), 'name02' => $objCustomer->getValue('name02'), 'kana01' => $objCustomer->getValue('kana01'), 'kana02' => $objCustomer->getValue('kana02'), 'zip01' => $objCustomer->getValue('zip01'), 'zip02' => $objCustomer->getValue('zip02'), 'pref' => $objCustomer->getValue('pref'), 'addr01' => $objCustomer->getValue('addr01'), 'addr02' => $objCustomer->getValue('addr02'), 'tel01' => $objCustomer->getValue('tel01'), 'tel02' => $objCustomer->getValue('tel02'), 'tel03' => $objCustomer->getValue('tel03')));
         $arrAddrs = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id')));
         foreach ($arrAddrs as $val) {
             $other_deliv_id = SC_Utils_Ex::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id'];
             $arrResults[$other_deliv_id] = $val['name01'] . $val['name02'] . ' ' . $arrPref[$val['pref']] . $val['addr01'] . $val['addr02'];
         }
         // 非会員
     } else {
         $arrShippings = $objPurchase->getShippingTemp();
         foreach ($arrShippings as $shipping_id => $val) {
             $arrResults[$shipping_id] = $val['shipping_name01'] . $val['shipping_name02'] . ' ' . $arrPref[$val['shipping_pref']] . $val['shipping_addr01'] . $val['shipping_addr02'];
         }
     }
     return $arrResults;
 }