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

2019-05-12 (일) 00:00:29 3,869

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

어떡해 해야 하나요?

// 품절
    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개 / 댓글 1개

<?php if($is_soldout) { ?>

<script>

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

</script>

<?php } ?

답변에 대한 댓글 1개

이소스를 어디에 붙혀야 하나요?? 바꿔도 클릭하면 그냥 들어가지네요ㅠㅠ

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