gpt4 book ai didi

php - Magento _ $weee Helper->type Of Display() 方法

转载 作者:可可西里 更新时间:2023-11-01 00:48:56 25 4
gpt4 key购买 nike

我正在调查 Magento 臭名昭著的价格 block /price.phtml 文件,我遇到了一些看起来像错误和/或废弃代码路径的东西,但我想运行它首先由社区确保我了解正在发生的事情。

在整个文件中,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 版本,其中值“4”存储在

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')),
);
}

}

关于php - Magento _ $weee Helper->type Of Display() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11532023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com