전체적용하기

전체적용하기

QA

전체적용하기

본문

전체 할인율을 적용하려고 합니다.


그래서 



if ($_POST['act_button'] == "할인율적용") {

    auth_check($auth[$sub_menu], 'w');

$totals = $_POST['total_count'] + 1;
    for ($i=0; $i<$totals; $i++) {

        // 실제 번호를 넘김
        $k =$i;

		if($_POST['it_10'] ){
			$discount_price = $_POST['it_cust_price'][$k];
			$count_price2 =  $_POST['it_10'] * 0.01;
			$count_price3 =  $discount_price * $count_price2;

			$total_discount_price = $discount_price - $count_price3;
		}else{
			$total_discount_price = $_POST['it_price'][$k];
		}


        $sql = "update {$g5['g5_shop_item_table']}
                   set 
                       it_price       = '{$total_discount_price}',
                       it_update_time = '".G5_TIME_YMDHIS."',
		    it_5       = '{$_POST['it_10']}'
                 where it_id   = '{$_POST['it_id'][$k]}' ";
        sql_query($sql);
    }

}



이렇게 했는데 할인율이 적용은 되는데 

전~~제품이 적용되는게 아니고 

제가 보고 있는 페이지 

예를 들어 1페이지에만 적용이 됩니다..

전~~~체 제품에 적용이 되게 하려면 어떻게 해야되나요~~?

이 질문에 댓글 쓰기 :

답변 1

item table 에서 해당 정보 불러온 다음 할인가 계산해서 업데이트 해보세요~


$sql = "select it_id, it_cust_price, it_10, it_price from {$g5['g5_shop_item_talbe']}";
$result = sql_query($sql);

while($row = sql_fetch_array($result) ){

$it_10 = $row['it_10'];
if($it_10 !== '') {

    // 할인가 계산
} else {
    $total_discount_price = $row['it_price'];
}


$sql2 = "update {$g5['g5_shop_item_table']} set it_pri~~ ";

sql_query($sql2);


}

답변을 작성하시기 전에 로그인 해주세요.
전체 34
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT