상품페이지에서 상품문의 남기기 가능할까요?
본문
새창이 아닌 상품페이지에서 상품문의 남기기를 하고 싶습니다.
혹시 가능하다면 어떤 팁을 좀 얻을 수 있을까요?
답변 1
자잘한 css수정은 빼고 상품문의누르면 iframe로 아래쪽에 띄워서 확인누르면 페이지 재로딩되면서 보이는것 알려드릴께요.
/skin/shop/shop/basic/itemqa.skin.php의 111~126번째줄이에요.
//////////////////////////////////////여기부터 원본 111번째줄//////////////////////////////////////
<div id="sit_qa_wbtn">
<!-- <a href="javascript:itemqawin('it_id=<?php echo $it_id; ?>');">상품문의 쓰기<span class="sound_only"> 새 창</span></a> -->
<a href="<?php echo $itemqa_form; ?>" class="btn02 itemqa_form">상품문의 쓰기<span class="sound_only"> 새 창</span></a>
<a href="<?php echo $itemqa_list; ?>" id="itemqa_list" class="btn01">더보기</a>
</div>
<script>
$(function(){
$(".itemqa_form").click(function(){
window.open(this.href, "itemqa_form", "width=810,height=680,scrollbars=1");
return false;
});
$(".itemqa_delete").click(function(){
return confirm("정말 삭제 하시겠습니까?\n\n삭제후에는 되돌릴수 없습니다.");
});
///////////////////////////////////여기까지가 원본 126번째줄////////////////////////////////////////
//////////////////////////////////////여기부터 수정본//////////////////////////////////////
<div id="sit_qa_wbtn">
<!-- <a href="javascript:itemqawin('it_id=<?php echo $it_id; ?>');">상품문의 쓰기<span class="sound_only"> 새 창</span></a> -->
<a class="btn02 itemqa_form">상품문의 쓰기<span class="sound_only"> 새 창</span></a> // 여기에 원래 href가 있는데 누르면 이동되서 지워버렷!!!긔...
<a href="<?php echo $itemqa_list; ?>" id="itemqa_list" class="btn01">더보기</a>
</div>
<style type="text/css">
#sit_qa_wfrom_iframe{width:100%;height:500px;display:none;}//iframe의 크기 및 초기에 안보이도록 display:none처리
</style>
<div id="sit_qa_wfrom">// iframe이 들어갈곳 iframe의 추가 옵션은 알아서 주세요~ 저는 그냥 젠코딩으로 만든거에 아이디값만 줬어요.
<iframe id="sit_qa_wfrom_iframe" src="" frameborder="0"></iframe>
</div>
<script>
$(function(){
$(".itemqa_form").click(function(){// 상품문의쓰기를 누르면~
document.getElementById("sit_qa_wfrom_iframe").style.display = "block"; // iframe을 블럭으로 바꿔서 보이게 하고
document.getElementById("sit_qa_wfrom_iframe").src = "<?=$itemqa_form?>"; // iframe의 src를 상품문의쓰기 버튼에 있던 href의 값을가져와서 넣어버리면 링크는 끝!
//window.open(this.href, "itemqa_form", "width=810,height=680,scrollbars=1");//이건 원본
return false;
});
$(".itemqa_delete").click(function(){
return confirm("정말 삭제 하시겠습니까?\n\n삭제후에는 되돌릴수 없습니다.");
});
//////////////////////////////////////여기까지가 수정본//////////////////////////////////////
이제 /shop/itemqaformupdate.php로 가셔서
//////////////////////////////////////121번째줄 else부터~123번째줄 ?>까지 원본 //////////////////////////////////////
else
alert_opener($alert_msg, $url);
?>
//////////////////////////////////////여기까지 원본//////////////////////////////////////
//////////////////////////////////////여기부터 수정본 //////////////////////////////////////
else{?>
<script type="text/javascript">
parent.location.reload();//iframe으로 열었고 iframe의 기본이 display:none이니깐 부모창을 리로드시키면 iframe은 안보이는게 되겠죠~
</script>
<?
//alert_opener("aaaaaaaaaaaaaaaaa".$alert_msg, $url);//이건 원본소스 주석
}?>
//////////////////////////////////////여기까지 수정본//////////////////////////////////////
끝...
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.