shop.lip.php 에서 ca_id 불러오기...
본문
이전에도 ca_id 불러오기로 질문을 남겼었는데,
shop.lip.php 에서도 ca_id를 붙혀줘야 되더라고요....
shop.lip.php 103~118줄, 437~438줄
// $type : 상품유형 (기본으로 1~5까지 사용)
// $list_skin : 상품리스트를 노출할 스킨을 설정합니다. 스킨위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php
// $list_mod : 1줄에 몇개의 상품을 노출할지를 설정합니다.
// $list_row : 상품을 몇줄에 노출할지를 설정합니다.
// $img_width : 상품이미지의 폭을 설정합니다.
// $img_height : 상품이미지의 높이을 설정합니다. 0 으로 설정하는 경우 썸네일 이미지의 높이는 폭에 비례하여 생성합니다.
//function __construct($type=0, $list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0, $ca_id='') {
function __construct($list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0) {
$this->list_skin = $list_skin;
$this->list_mod = $list_mod;
$this->list_row = $list_row;
$this->img_width = $img_width;
$this->img_height = $img_height;
$this->set_href(G5_SHOP_URL.'/item.php?it_id=');
$this->count++;
}
// 437~438줄
if($anchor)
$img = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'">'.$img.'</a>';
$this->set_href(G5_SHOP_URL.'/item.php?이부분에it_id=');
$this->set_href(G5_SHOP_URL.'/item.php?&ca_id='.$row['ca_id'].'it_id=');
$img = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'이부분에">'.$img.'</a>';
$img = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'&ca_id='.$row['ca_id'].'">'.$img.'</a>';
이런식으로 붙혀줬지만 작동을 안하더라고요...
다른부분에서 수정해을 해줘야하는 건지 작동시키는 php가 틀린건지 잘 모르겠습니다.
&ca_id={$row['ca_id']} 이걸 사용하자니 오류가 뜨고요.
ca_id를 못불러오는건지... 잘 모르겠습니다...
도와주세요!
답변 1
테스트는 못해봤지만..
이렇게 해보세요.
function __construct($list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0) {
global $ca;
$this->list_skin = $list_skin;
$this->list_mod = $list_mod;
$this->list_row = $list_row;
$this->img_width = $img_width;
$this->img_height = $img_height;
$this->set_href(G5_SHOP_URL.'/item.php?ca_id='.$ca['ca_id'].'&it_id=');
$this->count++;
}