产品详细信息页面上的可配置属性之一是日期。当前,这些以在数据库中找到的顺序显示。

我需要以升级顺序在产品页面上显示这些内容。到目前为止,我已经掌握了这个文件

Mage/Catalog/Model/Product/Type/Configurable.php  

该属性似乎是通过此方法调用的

getConfigurableAttributeCollection($product = null)

getConfigurableAttributes($product = null)
 {
    Varien_Profiler::start('CONFIGURABLE:'.__METHOD__);
    if (!$this->getProduct($product)->hasData($this->_configurableAttributes)) {
        $configurableAttributes = $this->getConfigurableAttributeCollection($product)
            ->orderByPosition()
            ->load(); 
        $this->getProduct($product)->setData($this->_configurableAttributes, $configurableAttributes);
    }
    Varien_Profiler::stop('CONFIGURABLE:'.__METHOD__);
    return $this->getProduct($product)->getData($this->_configurableAttributes);
}

我在不同的点上完成了各种var_dumps(),但我仍然不确定我可以在哪里或应该对这些日期进行分类。

有帮助吗?

解决方案

我能够捕获数据

shop/app/code/local/Mage/Catalog/Block/Product/View/Type/Configurable.php

我创建了一种新方法来执行我需要的更改,并将其称为这样

   $attributes[145]['options'] = $this->getOrderDateOptions($attributes);
许可以下: CC-BY-SA归因
scroll top