根据产品的id,调出来产品的tier price的数组

在产品详细页面对应的文件:templatge/catalog/product/view.phtml

加入代码:

<?php
$prices = $_product->getFormatedTierPrice();
var_dump($prices);
?>

然后就会吧tieprice显示出来

array
  0 => 
    array
      'price_id' => string '2' (length=1)
      'website_id' => string '0' (length=1)
      'all_groups' => string '1' (length=1)
      'cust_group' => int 32000
      'price' => string '58.0000' (length=7)
      'price_qty' => string '2.0000' (length=6)
      'website_price' => string '58.0000' (length=7)
      'formated_price' => string '<span class="price">$58.00</span>' (length=33)
  1 => 
    array
      'price_id' => string '3' (length=1)
      'website_id' => string '0' (length=1)
      'all_groups' => string '1' (length=1)
      'cust_group' => int 32000
      'price' => string '56.0000' (length=7)
      'price_qty' => string '3.0000' (length=6)
      'website_price' => string '56.0000' (length=7)
      'formated_price' => string '<span class="price">$56.00</span>' (length=33)
  2 => 
    array
      'price_id' => string '4' (length=1)
      'website_id' => string '0' (length=1)
      'all_groups' => string '1' (length=1)
      'cust_group' => int 32000
      'price' => string '54.0000' (length=7)
      'price_qty' => string '5.0000' (length=6)
      'website_price' => string '54.0000' (length=7)
      'formated_price' => string '<span class="price">$54.00</span>' (length=33)
  3 => 
    array
      'price_id' => string '5' (length=1)
      'website_id' => string '0' (length=1)
      'all_groups' => string '1' (length=1)
      'cust_group' => int 32000
      'price' => string '50.0000' (length=7)
      'price_qty' => string '10.0000' (length=7)
      'website_price' => string '50.0000' (length=7)
      'formated_price' => string '<span class="price">$50.00</span>' (length=33)

price_qty是产品的个数
price是不同个数对应的不同的tier price
然后前台特效就可以通过ajax异步调取,在产品价格增加的时候显示出来不同的价格,比较利于做批发和零售于一体的外贸b2c商城!