0
opencart에 새 분류 방법 i'e "높이로 정렬"을 추가하려고합니다.크기로 정렬 opencart
A.location은 다음과 같습니다 카탈로그/모델/카탈로그/product.php - 같은 파일
elseif($data['sort'] == 'p.height'){
$sql .= " ORDER BY(" . $data['sort'] . ")ASC";
/*$sql .= "SELECT * FROM". DB_PREFIX . "product p ORDER BY p.height DESC";*/
}
여기
$sort_data = array(
'pd.name',
'p.model',
'p.quantity',
'p.price',
'rating',
'p.sort_order',
'p.date_added',
'p.height'
);
B.> 추가 p.height C. 위치 : /catalog/controller/product/category.php
$this->data['sorts'][] = array(
'text' => $this->language->get('text_size_asc'),
'value' => 'height-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=height&order=ASC' . $url)
);
결과 옵션에서 높이로 정렬을 볼 수 있지만 선택하면 기본 정렬 값을 반환하지 않습니다.
내가 잘못하고있는 위치를 제안 할 수 있습니까?
@sanki에
&sort=p.height
에&sort=height
을 변경해야합니다 - 당신은 당신이 가지고있는 ELSEIF 코드가 필요하지 않습니다 –위의 편집을 참조하십시오. 그냥 표준 모델 파일을 사용하고 정렬 배열에 'p.height'를 추가하십시오. 그게 모두 필요합니다. –
@sanki - 괜찮습니다. 답변으로 표시하려면 왼쪽의 체크 표시를 클릭하십시오. –