Changeset 21410 for branches/version-2_11-dev/data/class/pages/products/LC_Page_Products_CategoryList.php
- Timestamp:
- 2012/01/17 16:32:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/pages/products/LC_Page_Products_CategoryList.php
r21317 r21410 65 65 $this->lfCheckCategoryId(); 66 66 67 // カテゴリ 情報を取得する。67 // カテゴリー情報を取得する。 68 68 $objFormParam = $this->lfInitParam($_REQUEST); 69 69 $arrCategoryData = $this->lfGetCategories($objFormParam->getValue('category_id'), true, $this); … … 91 91 92 92 /** 93 * 選択されたカテゴリ とその子カテゴリの情報を取得し、93 * 選択されたカテゴリーとその子カテゴリーの情報を取得し、 94 94 * ページオブジェクトに格納する。 95 95 * 96 * @param string $category_id カテゴリ ID97 * @param boolean $count_check 有効な商品がないカテゴリ を除くかどうか96 * @param string $category_id カテゴリーID 97 * @param boolean $count_check 有効な商品がないカテゴリーを除くかどうか 98 98 * @param object &$objPage ページオブジェクト 99 99 * @return void 100 100 */ 101 101 function lfGetCategories($category_id, $count_check = false, &$objPage) { 102 // カテゴリ の正しいIDを取得する。102 // カテゴリーの正しいIDを取得する。 103 103 $category_id = $this->lfCheckCategoryId($category_id); 104 104 if ($category_id == 0) { … … 106 106 } 107 107 108 $arrCategory = null; // 選択されたカテゴリ 109 $arrChildren = array(); // 子カテゴリ 108 $arrCategory = null; // 選択されたカテゴリー 109 $arrChildren = array(); // 子カテゴリー 110 110 111 111 $arrAll = SC_Helper_DB_Ex::sfGetCatTree($category_id, $count_check); 112 112 foreach ($arrAll as $category) { 113 // 選択されたカテゴリ の場合113 // 選択されたカテゴリーの場合 114 114 if ($category['category_id'] == $category_id) { 115 115 $arrCategory = $category; … … 117 117 } 118 118 119 // 関係のないカテゴリ はスキップする。119 // 関係のないカテゴリーはスキップする。 120 120 if ($category['parent_category_id'] != $category_id) { 121 121 continue; 122 122 } 123 123 124 // 子カテゴリ の場合は、孫カテゴリが存在するかどうかを調べる。124 // 子カテゴリーの場合は、孫カテゴリーが存在するかどうかを調べる。 125 125 $arrGrandchildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); 126 126 $category['has_children'] = count($arrGrandchildrenID) > 0; … … 132 132 } 133 133 134 // 子カテゴリ の商品数を合計する。134 // 子カテゴリーの商品数を合計する。 135 135 $children_product_count = 0; 136 136 foreach ($arrChildren as $category) { … … 138 138 } 139 139 140 // 選択されたカテゴリ に直属の商品がある場合は、子カテゴリの先頭に追加する。140 // 選択されたカテゴリーに直属の商品がある場合は、子カテゴリーの先頭に追加する。 141 141 if ($arrCategory['product_count'] > $children_product_count) { 142 $arrCategory['product_count'] -= $children_product_count; // 子カテゴリ の商品数を除く。142 $arrCategory['product_count'] -= $children_product_count; // 子カテゴリーの商品数を除く。 143 143 $arrCategory['has_children'] = false; // 商品一覧ページに遷移させるため。 144 144 array_unshift($arrChildren, $arrCategory);
Note: See TracChangeset
for help on using the changeset viewer.