0

I have Magento 1.9.3.10 with the patch for PHP 7.2 applied. If I click "add to cart" on a product that has options and no options are selected, I get this error:

Exception: Warning: count(): Parameter must be an array or an object that implements Countable  in /var/www/html/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php on line 57 in /var/www/html/app/code/core/Mage/Core/functions.php:232
Stack trace:
#0 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php(57): mageCoreErrorHandler(2, 'count(): Parame...', '/var/www/html/a...', 57, Array)
#1 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php(533): Mage_Catalog_Model_Product_Option_Type_Select->validateUserValue(NULL)
#2 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php(322): Mage_Catalog_Model_Product_Type_Abstract->_prepareOptions(Object(Varien_Object), Object(Mage_Catalog_Model_Product), 'full')
#3 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php(410): Mage_Catalog_Model_Product_Type_Abstract->_prepareProduct(Object(Varien_Object), Object(Mage_Catalog_Model_Product), 'full')
#4 /var/www/html/app/code/core/Mage/Sales/Model/Quote.php(969): Mage_Catalog_Model_Product_Type_Abstract->prepareForCartAdvanced(Object(Varien_Object), Object(Mage_Catalog_Model_Product), 'full')
#5 /var/www/html/app/code/core/Mage/Sales/Model/Quote.php(1045): Mage_Sales_Model_Quote->addProductAdvanced(Object(Mage_Catalog_Model_Product), Object(Varien_Object), 'full')
#6 /var/www/html/app/code/core/Mage/Checkout/Model/Cart.php(268): Mage_Sales_Model_Quote->addProduct(Object(Mage_Catalog_Model_Product), Object(Varien_Object))
#7 /var/www/html/app/code/core/Mage/Checkout/controllers/CartController.php(235): Mage_Checkout_Model_Cart->addProduct(Object(Mage_Catalog_Model_Product), Array)
#8 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
#9 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('add')
#10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /var/www/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#12 /var/www/html/app/Mage.php(686): Mage_Core_Model_App->run(Array)
#13 /var/www/html/index.php(85): Mage::run('', 'store')
#14 {main}

1 Answer 1

0

Exception: Warning: count(): Parameter must be an array or an object that implements Countable

It is already Fixed in 1.9.4.0.

2
  • 1
    Do you how this is fixed by Magento 1.9.4.0? I ran a diff between Magento 1.9.3.10 including the PHP 7.2 patch and Magento 1.9.4.0, but I can't find it. Nov 30, 2018 at 19:55
  • What specific custom option are you using? Please show your product settings in the admin panel.
    – UOK
    Dec 5, 2018 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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