显示第一层价格为默认价格 [英] Display First Tier Price as default Price

查看:72
本文介绍了显示第一层价格为默认价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,将第一个层级价格显示为Magento网站的默认价格.以下是我到目前为止所做的事情:

I am working on a project to display the first Tier Price as the default Price for a Magento website. Following is what I have done so far:

  1. 编辑了price.phtml文件

已替换

$ _ product = $ this-> getProduct();

$_product = $this->getProduct();

使用

$_product = $this->getTierPrice($quantity);

第44行

我对此进行了测试,但结果与预期不符.我想念什么吗?

I tested this out and this isn't working the way I expected. Am I missing something?

推荐答案

哦,只是在开始时检查一下,您的代码是这样的,是吗?:

Oh, just to check at the start, your code is like this, yes?:

$_product = $this->getProduct();              //$this is Mage_Catalog_Block_Product_Abstract
$price = $_product->getTierPrice($quantity);  //$_product is Mage_Catalog_Model_Product

因此,使用变量$_product代表实际的产品模型,您能告诉我们这些函数调用返回的值是什么吗?

So with the variable $_product representing the actual product model, can you tell us what value is returned from these function calls:

$dummyPrice = $this->getTierPrice($quantity);
$dummyPrice = $this->getTierPrice(1);
$dummyPrice = $this->getTierPrice(); //should return an array of the tiers
$dummyPrice = $this->getFormatedTierPrice(1);
$dummyPrice = $this->getFormatedTierPrice();//should return an array of the tiers

这篇关于显示第一层价格为默认价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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