채택완료

품절시 상품 클릭 하면 알림창 뜨게 할려면?

2019-05-12 (일) 00:33:17 2,371

품절시 상품 클릭 하면 팝업창 뜨게 할려면?

어떡해 해야 하나요?

// 품절
    if (is_soldout($row['it_id']))
        $icon .= '<span class="shop_icon_soldout">품절</span>';
    
    $icon .= '</span>';

    if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
        if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
        else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
        else $sct_last = '';
    } else { // 1줄 이미지 : 1개
        $sct_last = 'sct_clear';
    }

    if ($i == 1) {
        if ($this->css) {
            echo "<ul class=\"{$this->css}\">\n";
        } else {
            echo "<ul class=\"sct sct_20\">\n";
        }
    }

    echo "<li class=\"sct_li sct_li_{$i} {$sct_last}\" style=\"width:{$this->img_width}px\">\n";

    echo "<div class=\"sct_20_wrap\">\n";
    echo "<div class=\"sct_img\">\n";

    if ($this->href) {
        echo "<a href=\"{$this->href}{$row['it_id']}\">\n";
    }

    if ($this->view_it_img) {
        echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
    }

    if ($this->href) {
        echo "</a>\n";
    }

|

답변 1개 / 댓글 2개

채택된 답변
+20 포인트

<?php

if($is_soldout) { 

  alert("상품의 재고가 부족하여 구매할 수 없습니다.");

}

?>

답변에 대한 댓글 2개

저렇게 해도 안됩니다. ㅠㅠㅠ
죄송.. 아래와 같이 수정하세요..
if (is_soldout($row['it_id']))
alert("상품의 재고가 부족하여 구매할 수 없습니다.");
}

답변을 작성하려면 로그인이 필요합니다.