当我转到Magento (ver 1.9)的运输页面时,出现致命错误。俗话说:



我在第439行有以下代码:

'dimensions_variables'  => array(
                'L'         => Zend_Measure_Weight::POUND,
                'LB'        => Zend_Measure_Weight::POUND,
                'POUND'     => Zend_Measure_Weight::POUND,
                'K'         => Zend_Measure_Weight::KILOGRAM,
                'KG'        => Zend_Measure_Weight::KILOGRAM,
                'KILOGRAM'  => Zend_Measure_Weight::KILOGRAM,
                'I'         => Zend_Measure_Length::INCH,
                'IN'        => Zend_Measure_Length::INCH,
                'INCH'      => Zend_Measure_Length::INCH,
                'C'         => Zend_Measure_Length::CENTIMETER,
                'CM'        => Zend_Measure_Length::CENTIMETER,
                'CENTIMETER'=> Zend_Measure_Length::CENTIMETER,

            )

我该如何解决?

最佳答案

因为您是从模型中调用的,所以您必须在类(class)之前添加它

require_once(Mage::getBaseDir('lib') . '/Zend/Measure/Weight.php');

class ........ extends Mage_Core_Model_Abstract

完成后,您可以立即调用Zend_Measure_Weight类。

关于php - 找不到 'Zend_Measure_Weight'类-Magento,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31074007/

10-12 17:30