Php 马根托';s$weeeHelper->;typeOfDisplay()方法

Php 马根托';s$weeeHelper->;typeOfDisplay()方法,php,magento,Php,Magento,我正在调查Magento臭名昭著的price block/price.phtml文件,我遇到了一些看起来像bug和/或废弃代码路径的东西,但我想先让社区运行它,以确保我了解发生了什么 在整个文件中,Magento将在条件调用中使用以下方法 $_weeeHelper->typeOfDisplay($_product, 0) $_weeeHelper->typeOfDisplay($_product, 1) $_weeeHelper->typeOfDisplay($_product

我正在调查Magento臭名昭著的price block/
price.phtml
文件,我遇到了一些看起来像bug和/或废弃代码路径的东西,但我想先让社区运行它,以确保我了解发生了什么

在整个文件中,Magento将在条件调用中使用以下方法

$_weeeHelper->typeOfDisplay($_product, 0)
$_weeeHelper->typeOfDisplay($_product, 1)
$_weeeHelper->typeOfDisplay($_product, 4)
$_weeeHelper->typeOfDisplay($_product, 2)
根据我的代码跟踪收集的信息,此方法(如调用的)最终将第二个参数与两个配置值之一进行比较。或者

Tax -> Fixed Product Taxes -> Display Prices On Product View Page
Tax -> Fixed Product Taxes -> Display Prices In Product Lists
取决于当前上下文。如果我们在产品页面上,这是第一个。否则,它将假定为产品列表页面。(而“在产品页面上”表示在
Mage::registry('current_product')
中设置了一个值)

这一切都很好,除了以下通话

$_weeeHelper->typeOfDisplay($_product, 4)
这些配置字段的唯一可能值为0-3。没有“4”

那么,第一个问题:上面是否准确地描述了
typeOfDisplay
方法的行为?(假定
$zone
参数为
null

第二个问题:如果是,是否有(或是否有)版本的Magento在其中一个

Tax -> Fixed Product Taxes -> Display Prices In Product Lists
Tax -> Fixed Product Taxes -> Display Prices On Product View Page

字段?

好吧,也许这是部分答案

在CE 1.3.3.0中,似乎确实存在
4
的值

class Mage_Weee_Model_Config_Source_Display
{

    public function toOptionArray()
    {
        return array(
            array('value'=>0, 'label'=>Mage::helper('weee')->__('Including FPT only')),
            array('value'=>1, 'label'=>Mage::helper('weee')->__('Including FPT and FPT description [excl. FPT VAT]')),
            array('value'=>4, 'label'=>Mage::helper('weee')->__('Including FPT and FPT description [incl. FPT VAT]')),
            array('value'=>2, 'label'=>Mage::helper('weee')->__('Excluding FPT, FPT description, final price')),
            array('value'=>3, 'label'=>Mage::helper('weee')->__('Excluding FPT')),
        );
    }

}

签入CE 1.6.2.0。您在哪里看到0-3作为可能的配置值?我在config.xml中看到的唯一一件事是所有
default/tax/weee/*
值都默认为零。这看起来像
typeOfDisplay()
函数定义中的
$product
参数甚至没有在函数中使用,这很有趣。Sparcksoft-查看后端系统配置部分。我所说的可能值是Tax->Fixed Product Tax->Display Prices in Product lists中的下拉值实际上这就是我需要的全部答案。由于有一个值是“4”,price.phtml看起来像是人们害怕重新考虑的文件之一,这就解释了一切。谢谢