영카트 옵션을 라디오로 만들고 싶어요.ㅠㅠ 정보
영카트 옵션을 라디오로 만들고 싶어요.ㅠㅠ본문
원본 입니다... shop.lib.php 427줄. 아래 수정을 해보았는데..아래쪽 참고.
---------------------------------------------------------------------------------------------------------
// 상품 옵션
function get_item_options($subject, $option, $index)
{
$subject = trim($subject);
$option = trim($option);
if (!$subject || !$option) return "";
$str = "";
$arr = explode("\n", $option);
// 옵션이 하나일 경우
if (count($arr) == 1)
{
$str = $option;
}
else
{
$str = "<select name=it_opt{$index} onchange='amount_change()'>\n";
for ($k=0; $k<count($arr); $k++)
{
$arr[$k] = str_replace("\r", "", $arr[$k]);
$opt = explode(";", trim($arr[$k]));
$str .= "<option value='$arr[$k]'>{$opt[0]}";
// 옵션에 금액이 있다면
if ($opt[1] != 0)
{
$str .= " (";
// - 금액이 아니라면 모두 + 금액으로
if (!ereg("[-]", $opt[1]))
$str .= "+";
$str .= display_amount($opt[1]) . ")";
}
$str .= "</option>\n";
}
$str .= "</select>\n<input type=hidden name=it_opt{$index}_subject value='$subject'>\n";
}
return $str;
}
-----------------------------------------------------------------------------------------------------------------------------
수정본 아래.
-----------------------------------------------------------------------------------------------------------------------------
// 옵션이 하나일 경우
if (count($arr) == 1)
{
$str = $option;
}
else
{
for ($k=0; $k<count($arr); $k++)
{
$arr[$k] = str_replace("\r", "", $arr[$k]);
$opt = explode(";", trim($arr[$k]));
$str .= "<input type=radio name='it_opt{$index}' onClick='amount_change()' value='$arr[$k]'checked>{$opt[0]}\n";
// 옵션에 금액이 있다면
if ($opt[1] != 0)
{
$str .= " (";
// - 금액이 아니라면 모두 + 금액으로
if (!ereg("[-]", $opt[1]))
$str .= "";
$str .= display_amount($opt[1]) . ")<br>";
}
}
$str .= "\n<input type=hidden name=it_opt{$index}_subject value='$subject'>\n";
}
return $str;
}
------------------------------------------------------------------------------------------------------------------------
이렇게 수정하니까. 가격이 출력이 안되는듯해요.
$str .= "<input type=radio name='it_opt{$index}' onClick='amount_change()' value='$arr[$k]'checked>{$opt[0]}\n";
이부분에서 $str .= 이쩜을 빼고 하니까 나오기는 하는데 딸랑 옵션이 한개만 나와요ㅠㅠ
여기저기 찾아 봐도 없고 아시는분 부탁드립니다.ㅠㅠ
---------------------------------------------------------------------------------------------------------
// 상품 옵션
function get_item_options($subject, $option, $index)
{
$subject = trim($subject);
$option = trim($option);
if (!$subject || !$option) return "";
$str = "";
$arr = explode("\n", $option);
// 옵션이 하나일 경우
if (count($arr) == 1)
{
$str = $option;
}
else
{
$str = "<select name=it_opt{$index} onchange='amount_change()'>\n";
for ($k=0; $k<count($arr); $k++)
{
$arr[$k] = str_replace("\r", "", $arr[$k]);
$opt = explode(";", trim($arr[$k]));
$str .= "<option value='$arr[$k]'>{$opt[0]}";
// 옵션에 금액이 있다면
if ($opt[1] != 0)
{
$str .= " (";
// - 금액이 아니라면 모두 + 금액으로
if (!ereg("[-]", $opt[1]))
$str .= "+";
$str .= display_amount($opt[1]) . ")";
}
$str .= "</option>\n";
}
$str .= "</select>\n<input type=hidden name=it_opt{$index}_subject value='$subject'>\n";
}
return $str;
}
-----------------------------------------------------------------------------------------------------------------------------
수정본 아래.
-----------------------------------------------------------------------------------------------------------------------------
// 옵션이 하나일 경우
if (count($arr) == 1)
{
$str = $option;
}
else
{
for ($k=0; $k<count($arr); $k++)
{
$arr[$k] = str_replace("\r", "", $arr[$k]);
$opt = explode(";", trim($arr[$k]));
$str .= "<input type=radio name='it_opt{$index}' onClick='amount_change()' value='$arr[$k]'checked>{$opt[0]}\n";
// 옵션에 금액이 있다면
if ($opt[1] != 0)
{
$str .= " (";
// - 금액이 아니라면 모두 + 금액으로
if (!ereg("[-]", $opt[1]))
$str .= "";
$str .= display_amount($opt[1]) . ")<br>";
}
}
$str .= "\n<input type=hidden name=it_opt{$index}_subject value='$subject'>\n";
}
return $str;
}
------------------------------------------------------------------------------------------------------------------------
이렇게 수정하니까. 가격이 출력이 안되는듯해요.
$str .= "<input type=radio name='it_opt{$index}' onClick='amount_change()' value='$arr[$k]'checked>{$opt[0]}\n";
이부분에서 $str .= 이쩜을 빼고 하니까 나오기는 하는데 딸랑 옵션이 한개만 나와요ㅠㅠ
여기저기 찾아 봐도 없고 아시는분 부탁드립니다.ㅠㅠ
댓글 전체