结束后被checkout
重定向到checkout / onepage / success /
,但是报错:
data_invalid
a:5:{i:0;s:12:\\\\\\\"data_invalid\\\\\\\";i:1;s:3376:\\\\\\\"#0 /var/www/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php(140): Mage_Api_Model_Resource_Abstract->_fault(\\\\\\\’data_invalid\\\\\\\’, \\\\\\\’Cannot do invoi...\\\\\\\’)
#1 /var/www/app/design/frontend/default/prosoundeffect/template/checkout/success.phtml(32): Mage_Sales_Model_Order_Invoice_Api->create(\\\\\\\’100000172\\\\\\\’, Array)
#2 /var/www/app/code/core/Mage/Core/Block/Template.php(241): include(\\\\\\\’/var/www/www.pr...\\\\\\\’)
#3 /var/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView(\\\\\\\’frontend/defaul...\\\\\\\’)
#4 /var/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /var/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#6 /var/www/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /var/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#8 /var/www/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#9 /var/www/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml(\\\\\\\’content\\\\\\\’, true)
#10 /var/www/app/design/frontend/default/prosoundeffect/template/page/1column.phtml(49): Mage_Core_Block_Abstract->getChildHtml(\\\\\\\’content\\\\\\\’)
#11 /var/www/app/code/core/Mage/Core/Block/Template.php(241): include(\\\\\\\’/var/www/www.pr...\\\\\\\’)
#12 /var/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView(\\\\\\\’frontend/defaul...\\\\\\\’)
#13 /var/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /var/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#15 /var/www/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#16 /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#17 /var/www/app/code/core/Mage/Checkout/controllers/OnepageController.php(244): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_OnepageController->successAction()
#19 /var/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch(\\\\\\\’success\\\\\\\’)
#20 /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /var/www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#22 /var/www/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#23 /var/www/index.php(89): Mage::run(\\\\\\\’\\\\\\\’, \\\\\\\’store\\\\\\\’)
#24 {main}\\\\\\\”;s:3:\\\\\\\"url\\\\\\\”;s:56:\\\\\\\"/checkout/onepage/success/\\\\\\\”;s:11:\\\\\\\"script_name\\\\\\\”;s:40:\\\\\\\"/index.php\\\\\\\”;s:4:\\\\\\\"skin\\\\\\\”;s:7:\\\\\\\"default\\\\\\\";}}
If i comment out the line
if (!$order->canInvoice()) {
$this->_fault(\\\\\\\’data_invalid\\\\\\\’, Mage::helper(\\\\\\\’sales\\\\\\\’)->__(\\\\\\\’Cannot do invoice for order.\\\\\\\’));
在app/code/core/Mage/Sales/Model/Order/Invoice/Api.php
一切工作正常。
函数 QtyToInvoice 返回 0
如何解决这个问题?