> 백엔드 개발 > PHP 튜토리얼 > items with the same id already exist in magento

items with the same id already exist in magento

WBOY
풀어 주다: 2016-07-06 13:52:30
원래의
951명이 탐색했습니다.

1、最近在magento项目中遇到这样的一个问题(错误日志的内容):

<code>a:5:{i:0;s:69:"Item (Mage_SalesRule_Model_Rule) with the same id "105" already exist";i:1;s:5399:"#0 /home/websites/blueberrypet/com170/lib/Varien/Data/Collection/Db.php(576): Varien_Data_Collection->addItem(Object(Mage_SalesRule_Model_Rule))
#1 /home/websites/blueberrypet/com170/app/code/core/Mage/SalesRule/Model/Validator.php(100): Varien_Data_Collection_Db->load()
#2 /home/websites/blueberrypet/com170/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php(60): Mage_SalesRule_Model_Validator->init('1', '1', 'blueberrypet25')
#3 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote/Address.php(957): Mage_SalesRule_Model_Quote_Freeshipping->collect(Object(Mage_Sales_Model_Quote_Address))
#4 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(1263): Mage_Sales_Model_Quote_Address->collectTotals()
#5 /home/websites/blueberrypet/com170/app/code/local/Idev/OneStepCheckout/Model/Sales/Quote.php(27): Mage_Sales_Model_Quote->collectTotals()
#6 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(1839): Idev_OneStepCheckout_Model_Sales_Quote->collectTotals()
#7 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(354): Mage_Sales_Model_Quote->_afterLoad()
#8 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Model/Session.php(148): Mage_Sales_Model_Quote->loadByCustomer(Object(Mage_Customer_Model_Customer))
#9 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Model/Cart.php(521): Mage_Checkout_Model_Session->getQuote()
#10 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php(189): Mage_Checkout_Model_Cart->getSummaryQty()
#11 /home/websites/blueberrypet/com170/app/design/frontend/blueberrypet_pkg/default/template/checkout/cart/cartheader.phtml(35): Mage_Checkout_Block_Cart_Sidebar->getSummaryCount()
#12 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#13 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bluebe...')
#14 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#15 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#16 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#17 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('topCart', true)
#18 /home/websites/blueberrypet/com170/app/design/frontend/blueberrypet_pkg/default/template/page/html/header.phtml(45): Mage_Core_Block_Abstract->getChildHtml('topCart')
#19 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#20 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bluebe...')
#21 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#22 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#23 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#24 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#25 /home/websites/blueberrypet/com170/app/design/frontend/base/default/template/page/2columns-left.phtml(42): Mage_Core_Block_Abstract->getChildHtml('header')
#26 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#27 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#28 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#29 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#30 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#31 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#32 /home/websites/blueberrypet/com170/app/code/core/Mage/Customer/controllers/AccountController.php(115): Mage_Core_Controller_Varien_Action->renderLayout()
#33 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Customer_AccountController->indexAction()
#34 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#35 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#36 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#37 /home/websites/blueberrypet/com170/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#38 /home/websites/blueberrypet/com170/index.php(99): Mage::run('', 'store')
#39 {main}";s:3:"url";s:18:"/customer/account/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}</code>
로그인 후 복사
로그인 후 복사

各位大神,帮帮忙,看这个问题怎么解决,谢谢!

回复内容:

1、最近在magento项目中遇到这样的一个问题(错误日志的内容):

<code>a:5:{i:0;s:69:"Item (Mage_SalesRule_Model_Rule) with the same id "105" already exist";i:1;s:5399:"#0 /home/websites/blueberrypet/com170/lib/Varien/Data/Collection/Db.php(576): Varien_Data_Collection->addItem(Object(Mage_SalesRule_Model_Rule))
#1 /home/websites/blueberrypet/com170/app/code/core/Mage/SalesRule/Model/Validator.php(100): Varien_Data_Collection_Db->load()
#2 /home/websites/blueberrypet/com170/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php(60): Mage_SalesRule_Model_Validator->init('1', '1', 'blueberrypet25')
#3 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote/Address.php(957): Mage_SalesRule_Model_Quote_Freeshipping->collect(Object(Mage_Sales_Model_Quote_Address))
#4 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(1263): Mage_Sales_Model_Quote_Address->collectTotals()
#5 /home/websites/blueberrypet/com170/app/code/local/Idev/OneStepCheckout/Model/Sales/Quote.php(27): Mage_Sales_Model_Quote->collectTotals()
#6 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(1839): Idev_OneStepCheckout_Model_Sales_Quote->collectTotals()
#7 /home/websites/blueberrypet/com170/app/code/core/Mage/Sales/Model/Quote.php(354): Mage_Sales_Model_Quote->_afterLoad()
#8 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Model/Session.php(148): Mage_Sales_Model_Quote->loadByCustomer(Object(Mage_Customer_Model_Customer))
#9 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Model/Cart.php(521): Mage_Checkout_Model_Session->getQuote()
#10 /home/websites/blueberrypet/com170/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php(189): Mage_Checkout_Model_Cart->getSummaryQty()
#11 /home/websites/blueberrypet/com170/app/design/frontend/blueberrypet_pkg/default/template/checkout/cart/cartheader.phtml(35): Mage_Checkout_Block_Cart_Sidebar->getSummaryCount()
#12 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#13 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bluebe...')
#14 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#15 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#16 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#17 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('topCart', true)
#18 /home/websites/blueberrypet/com170/app/design/frontend/blueberrypet_pkg/default/template/page/html/header.phtml(45): Mage_Core_Block_Abstract->getChildHtml('topCart')
#19 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#20 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/bluebe...')
#21 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#22 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#23 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#24 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#25 /home/websites/blueberrypet/com170/app/design/frontend/base/default/template/page/2columns-left.phtml(42): Mage_Core_Block_Abstract->getChildHtml('header')
#26 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(241): include('/home/websites/...')
#27 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#28 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#29 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#30 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#31 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#32 /home/websites/blueberrypet/com170/app/code/core/Mage/Customer/controllers/AccountController.php(115): Mage_Core_Controller_Varien_Action->renderLayout()
#33 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Customer_AccountController->indexAction()
#34 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#35 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#36 /home/websites/blueberrypet/com170/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#37 /home/websites/blueberrypet/com170/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#38 /home/websites/blueberrypet/com170/index.php(99): Mage::run('', 'store')
#39 {main}";s:3:"url";s:18:"/customer/account/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}</code>
로그인 후 복사
로그인 후 복사

各位大神,帮帮忙,看这个问题怎么解决,谢谢!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿