php 未找到类'Zend_Measure_Weight'- Magento

polkgigr  于 2023-01-16  发布在  PHP
关注(0)|答案(1)|浏览(127)

我得到致命的错误,当我去航运页面在Magento (ver 1.9)。它说:
致命错误:在/home/www/www.example.com的第439行未找到类"Zend_Measure_Weight"mysite.com/www/newsite/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php on line 439
我在第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,

            )

我该怎么修呢?

e3bfsja2

e3bfsja21#

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

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

class ........ extends Mage_Core_Model_Abstract

完成后,现在可以调用Zend_Measure_Weight类了。

相关问题