在庫がない場合、選択肢の横に(品切れ中)とは表示されるが、紛らわしいので消してしまおうという事に。
まずは「商品詳細ページ」のページ詳細を見てみる事に。
どうやら規格の選択肢の生成にはSmartyのhtml_optionを使っているようだ。
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
<!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}--> |
Smarty公式によると
{html_options} は、HTML の <select><option> グループにデータを代入して作成する カスタム関数 です。
html_optionsのオプションのoptionsに配列を渡して選択肢を作るようだ。
ではさてoptionsに渡されている変数は$arrClassCat1
これはLC_Page_Products_Detail.phpで渡されているが、中身はSC_Product.phpで設定されているようだ。
290行目付近で設定されていました。
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
if (!in_array($classcat_id1, $classCats1)) { | |
$classCats1[$classcategory_id1] = $arrProductsClass['classcategory_name1'] . ($classcategory_id2 == 0 && !$stock_find_class ? ' (品切れ中)' : ''); | |
} |
ここを在庫がない場合は非表示にする為に下記の様に分岐をさせます。
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
if (!in_array($classcat_id1, $classCats1)) { | |
if (!$classcategory_id2 == 0 && $stock_find_class) { | |
$classCats1[$classcategory_id1] = $arrProductsClass['classcategory_name1']; | |
} | |
} |
これで在庫のない規格は選択肢から消え去ります。
0 コメント:
コメントを投稿