'장바구니를 추가 할 최대 한 항목'오류. 매우 독특하고 실제로 Magento가 아닌 고유 한 오류입니다. 나는 내 고객의 코드에서 그것을 발견했다.
if ($cartItems >= 1) {
Mage::getSingleton('core/session')->addError($this->__('Maximum one item to add the shopping cart.'));
$this->_goBack();
return;
}
및
if ($params['product'] != $productId) {
if ($cartItems >= 1) {
$this->_getSession()->addError($this->__('Maximum one item to add the shopping cart.'));
$this->_goBack();
return;
}
}
및
if ($params['product'] != $productId) {
if ($cartItems > 1) {
Mage::getSingleton('checkout/session')->addError($this->__('Maximum one product to add the shopping cart.'));
$this->_redirect('checkout/cart');
return;
}
}
및
if ($item->getProductId() != $productId) {
if ($cartItems >= 1) {
$this->_getSession()->addError($this->__('Maximum one item to add the shopping cart.'));
$this->_goBack();
return;
}
}
당신은 거를 : 당신은 몇 개의 파일에 다음 코드 블록을 찾아해야합니다 그들을 찾을 가능성이 높다. /app/code/local/{Name}/{Module}/controllers/Checkout/CartController.php
/app/code/local/{Name}/{Module}/controllers/Checkout/OnepageController.php
/app/code/local/{Name}/{Module}/controllers/Sales/OrderController.php
{Name}은 반드시 하나의 확장자로 제한되지는 않습니다 ... 여러 번 찾았습니다./app/code/local의 모든 파일을 모두 검색하여 확인하십시오. '수정'하려면 if ($cartItems > 1) {
의 '1'을 다른 (더 높은) 숫자로 변경하거나 if 문을 주석으로 처리하고 if(false) {
으로 바꿉니다.
품목을 장바구니에 추가하려고 할 때 정확한 오류 텍스트를 게시 할 수 있습니까? 이를 통해 Magento에서 오류의 원인이되는 예외를 발견 한 다음 해당 오류를 해결하는 PHP 논리를 확인하여 항목을 거부하는 이유를 확인할 수 있습니다. –
@ AlanStorm 감사합니다. 오류는 "장바구니를 추가 할 최대 항목 1 개"입니다.이 파일은 내가 확인하기를 원하는 파일입니까? – Abude
정확한 오류 메시지/문구가 기본 1.6 CE 코드의 아무 곳에 나 나타나지 않습니다. 그건 내게 누군가가 당신의 오류 메시지를 변경했거나 제 3 자 확장이 그 오류를 던지고 있다고 말합니다. 표시되는 파일을 찾아야합니다 ('장바구니를 추가 할 항목'으로 검색). 그러면 해당 파일을 추적하는 데 도움이됩니다. –