2011-09-08 6 views
0

magentoMagentoグループ化された製品ラベルの質問

Magentoの私の製品のティアプライシングの設定があります。 「それぞれ321.60ドルで2枚買う」を「それぞれ321.60ドルで2-4枚買う」と「それぞれ205.52ドルで5枚買う」に変更する方法はありますか?それは必ずしもこれらの数字ではありません(「購入3-4」など)。

答えて

1

ティア価格の表示ロジックはapp/design/frontend/watercare/default/template/catalog/product/view/tierprices.phtml

に位置していて、最後のelseブロックを交換してください:これは最後のティア価格は常にその前{num}+とものになることを確認します

<?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']); 
?> 


2 - {num - 1}となります。

1

上記のコードを簡単に修正しました(これは1.7.0.2では正しく動作しませんでした) $ _qtyは修正が適用されるすべての層で同じままです。

<?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']); 
?> 
関連する問題