Last active
August 29, 2015 13:58
-
-
Save zenith6/10280243 to your computer and use it in GitHub Desktop.
EC-CUBE の「商品管理>商品登録(商品規格)」の編集項目の表示順を変更するパッチです。登録済みの項目が先頭に来るようになります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php | |
=================================================================== | |
--- data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php (リビジョン 23289) | |
+++ data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php (作業コピー) | |
@@ -512,6 +512,11 @@ | |
} | |
} | |
+ // 登録済みの規格を先頭に並べる。 | |
+ $del_flags = array_map(function ($class) { return (int)$class['del_flg']; }, $arrMergeProductsClass); | |
+ $indexes = array_keys($arrMergeProductsClass); | |
+ array_multisort($del_flags, SORT_NUMERIC, SORT_ASC, $indexes, SORT_NUMERIC, SORT_ASC, $arrMergeProductsClass); | |
+ | |
// 登録済みのデータで上書き | |
$objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrMergeProductsClass)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment