0

I am learning Magento and getting this error: Cannot add the item to shopping cart.

I am stucked here anyone can help

Exception.log

Exception: Warning: A non-numeric value encountered  in \app\code\core\Mage\Shipping\Model\Carrier\Abstract.php on line 466 in \app\code\local\Mage\Core\functions.php:246
Stack trace:
#0 \app\code\core\Mage\Shipping\Model\Carrier\Abstract.php(466): mageCoreErrorHandler(2, 'A non-numeric v...', 'E:\\xampp\\htdocs...', 466, Array)
#1 \app\code\core\Mage\Shipping\Model\Carrier\Abstract.php(432): Mage_Shipping_Model_Carrier_Abstract->_getPerorderPrice('7.95', 'F', '')
#2 \app\code\core\Mage\Shipping\Model\Carrier\Flatrate.php(85): Mage_Shipping_Model_Carrier_Abstract->getFinalPriceWithHandlingFee('7.95')
#3 \app\code\core\Mage\Shipping\Model\Shipping.php(209): Mage_Shipping_Model_Carrier_Flatrate->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#4 \app\code\core\Mage\Shipping\Model\Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('flatrate', Object(Mage_Shipping_Model_Rate_Request))
#5 \app\code\local\Amasty\Shiprestriction\Model\Shipping\Shipping.php(9): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#6 \app\code\core\Mage\Sales\Model\Quote\Address.php(944): Amasty_Shiprestriction_Model_Shipping_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#7 \app\code\core\Mage\Sales\Model\Quote\Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#8 \app\code\core\Mage\Sales\Model\Quote\Address\Total\Shipping.php(155): Mage_Sales_Model_Quote_Address->collectShippingRates()
#9 \app\code\core\Mage\Sales\Model\Quote\Address.php(1013): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#10 \app\code\core\Mage\Sales\Model\Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#11 \app\code\local\Idev\OneStepCheckout\Model\Sales\Quote.php(27): Mage_Sales_Model_Quote->collectTotals()
#12 \app\code\core\Mage\Checkout\Model\Cart.php(461): Idev_OneStepCheckout_Model_Sales_Quote->collectTotals()
#13 \app\code\core\Mage\Checkout\controllers\CartController.php(240): Mage_Checkout_Model_Cart->save()
#14 \app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Checkout_CartController->addAction()
#15 \app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('add')
#16 \app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 \app\code\core\Mage\Core\Model\App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#18 \app\Mage.php(683): Mage_Core_Model_App->run(Array)
#19 \index.php(83): Mage::run('', 'store')
#20 {main}

Help will be appreciated.

Thanks

1

mmm

Just a try... go to Backoffice > Sales > Shipping methods and fill 0 (instead of empty value, as I suppose it'd be) in Handling Fee parameter for Flat Rate method

0

app/code/core/Mage/Shipping/Model/Carrier/Abstract.php

protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
    {
        if ($handlingType == self::HANDLING_TYPE_PERCENT) {
            return ($cost * $this->_numBoxes) + ($cost * $this->_numBoxes * $handlingFee / 100);
        }

        if(isset($handlingFee) && $handlingFee){
            return ($cost * $this->_numBoxes) + ($handlingFee);
        }
        return ($cost * $this->_numBoxes);
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.