2012-04-04 4 views
0

마젠타 색 제품의 묶음에 대해 가격 책정 설정을하고 표시 방법을 변경하고 싶습니다. 현재 'x 금액에 대해 1을 구입하십시오'라는 말은 실제로 범위를 제대로 설명하지 않습니다. 어쨌든 x- 금액에 대해 '1-9 구매'행을 따라 무언가를 말하게해야합니까? 예를 들어, 제품 당 약 5 티어가 필요합니다.magento tier 가격 결정 구매 x - x

Buy 10-19 for £3.32 each 
Buy 20-49 for £2.99 each 
Buy 50-99 for £2.39 each 
Buy 100-199 for £2.39 each 
Buy 200-299 for £2.39 each 

이 번호는 제품마다 다를 수 있습니다.

첫 번째 계층에서이 작업을 훌륭하게 수행하는 방법을 설명하는 답변 된 질문이 있지만 모든 계층에서 작동해야합니다. 아마 루프 안에서?

<?php 
$_format = 'Buy %1$s for %2$s each'; 

if($index === count($_tierPrices) - 1) 
{ 
     $_format = 'Buy %1$s+ for %2$s each'; 
} 
else 
{ 
     $_next = $_tierPrices[$index + 1]; 
     $_qty = $_next['price_qty'] - 1; 
     if($_qty > 0) $_format = 'Buy %1$s-' . $_qty . ' for %2$s each'; 
} 

echo $this->__($_format, $_price['price_qty'], $_price['formated_price']); 
?> 

Magento grouped products label question

어떻게 루프이 코드는 모든 계층에 영향을 미치는 것이므로 계속 것.

감사

답변

1

간단한 수정해야 할 일이

<?php 
$_format = 'Buy %1$s for %2$s each'; 

if($index === count($_tierPrices) - 1) 
{ 
     $_format = 'Buy %1$s+ for %2$s each'; 
} 
else 
{ 
     $i = $i + 1; 
     $_next = $_tierPrices[$index + $i]; 
     $_qty = $_next['price_qty'] -1; 

     if($_qty > 0) $_format = 'Buy %1$s-' . $_qty . ' for %2$s each'; 
} 

echo $this->__($_format, $_price['price_qty'], $_price['formated_price']); 
?> 
관련 문제