OpenCart 버전 2.1.3은 없지만 카테고리 페이지에서 첫 번째 추가 이미지를 표시하는 방법은 다음과 같습니다. category.php
에서
찾기 :
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
을 교체 :
<?php if($product['thumb2']){ ?><img src="<?php echo $product['thumb2']; ?>"><?php } ?>
,691 다음 foreach
그것을 사용 내부 category.tpl
에 그런
$image_results = $this->model_catalog_product->getProductImages($result['product_id']);
if ($image_results) {
$image2 = $this->model_tool_image->resize($image_results[0]['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
} else {
$image2 = false;
}
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'thumb2' => $image2,
나는 이것을 OpenCart 2.3.0.2와 함께 테스트했다.
Source