在购物车页面上显示分层定价 [英] Display Tiered Pricing on the Cart page

查看:50
本文介绍了在购物车页面上显示分层定价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果此页面上的我是: http:///checkout/cart/

If Im on this page: http:///checkout/cart/

对于购物车中的产品,我想显示商品页面上显示的价格(如果有).

With products in my cart I would like to display the tiered pricing, the same that is shown on the item page, if available.

我的尝试是添加

<checkout_cart_index>
    <block type="catalog/product_view" name="product.tierprices" as="tierprices" template="catalog/product/view/tierprices.phtml"/>
    </checkout_cart_index>

添加到我的xml文件并添加

to my xml file and add

<?php echo $this->getChildHtml('tierprices') ?>

\app\design\frontend\enterprise\<mytemplate>\template\checkout\cart\item\default.phtml

什么都不做-还有其他建议吗?

Doesn’t do anything - any further suggestions?

推荐答案

似乎无法轻松更改布局.您需要修改项目渲染器并添加手动显示的层级价格.要获取可用等级的价格列表,您需要获取价格模型.您可以从产品模型中获取它

It seems impossible to easily change layout. You need to modify item renderer and add tier price displaying manually. To fetch list of available tier prices you need to get price model. You can get it from product model

$product->getPriceModel()

或者如果没有产品型号,请尝试以下代码

or if don't have product model try the following code

Mage::getSingleton('catalog/product_type')->priceFactory($productTypeId)

报价项目包含产品类型信息.

Quote item contains product type information.

当您具有价格模型时,只需调用方法getTierPrice()即可将所有层级价格作为数组获取.

When you have price model just call method getTierPrice() to get all tier prices as array.

$priceModel->getTierPrice()

这篇关于在购物车页面上显示分层定价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆