2013-06-05 2 views
0

Magento 제품 세부 정보 페이지의 계층 형 가격 정책을 그리드/테이블 형식으로 지정하는 방법을 알아 내려고합니다. 예를 들어, 수량 행, 가격 행 및 할인 행을 갖고 싶습니다. 그리고 약 5 개의 기둥이 있습니다. 이것이 가능한가? 우리는 대량으로 제품을 판매하므로이 레이아웃이 중요합니다. 만약 누군가가 나를 바로 지시 할 수 있다면 좋을 것입니다. 나는 magento에 익숙하지 않고 픽업하기 어려운 것들의 커스터마이징 측면을 찾고 있습니다.Magento 프론트 엔드에서 계층 형 가격 테이블/그리드 만들기

감사합니다.

답변

2

를 다음 템플릿

magento/app/design/frontend/default/your_theme/template/catalog/product/view/tierprices.phtml 

당신이 할 수있는 루프 $_tierPrices 배열을 수정하고 생성 HTML 테이블 요소 수 내 tierprices.phtml에 대해 다음 템플릿을 만들었습니다.
는 참고로 나는 젠토에 1.8.x를

<?php 
$_product = $this->getProduct(); 
$_tierPrices = $this->getTierPrices(); 
if (count($_tierPrices) > 0): 
    $_data = array(); 
    $_prevQty = 0; 
    $_counter = 0; 
    $_tierPrices = array_reverse($_tierPrices); 
    foreach ($_tierPrices as $_index => $_price){ 
     $_counter++; 
     if($_price['price_qty']>$_prevQty){ 
      if($_counter == 1){ 
       $label = $_price['price_qty'] . '+'; 
      } else { 
       $label = $this->__('%d or less',$_price['price_qty']); 
      } 
      $_data[] = array('prev'=>$_prevQty,'next'=>$_price['price_qty'],'label'=>$label,'price'=>$_price['formated_price']); 
      $_prevQty = $_price['price_qty']; 
     } else { 
      $label = $_price['price_qty'] . '-' . $_prevQty; 
      $_data[] = array('prev'=>$_prevQty,'next'=>$_price['price_qty'],'label'=>$label,'price'=>$_price['formated_price']); 
      $_prevQty = $_price['price_qty']; 
     } 
    } 
    $_data = array_reverse($_data); 
?> 
    <table class="tiered-pricing"> 
     <tbody> 
      <tr> 
       <th>Quantity</th> 
       <th>Price</th> 
      </tr> 
     <?php foreach ($_data as $_row): ?> 
      <tr> 
       <td><?php echo $_row['label']; ?></td> 
       <td><?php echo $_row['price']; ?></td> 
      </tr> 
     <?php endforeach; ?> 
     </tbody> 
    </table> 
<?php 
endif; 
?> 

을하고 있는데 그것은 계층 가격 데이터의 테이블 버전을합니다.

관련 문제