Bugfix - Magento 1: Call to a member function getSku() on a non-object in app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line 710 Print

  • 30

If you get reports from customers complaining that they are unable to login to their account, it may be because they previously added an item to their cart and that item/SKU has since been deleted from Magento. This has now been fixed as of Magento 1.6.1.0.

Call to a member function getSku() on a non-object in  app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line  710


To get around this, create a local override to enable customer / order editing where a product SKU had been deleted.

Copy the file at app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php to app/code/local/Mage/Catalog/Model/Product/Type/Configurable.php. If the app/code/local/Mage/Catalog/Model/Product/Type/ directory structure doesn't exist then you will need to create it.

Edit app/code/local/Mage/Catalog/Model/Product/Type/Configurable.php at around line 710

//$simple_sku = $simpleOption->getProduct($product)->getSku();
$optionProduct = $simpleOption->getProduct($product);
$simple_sku = null;
if ($optionProduct) {
$simple_sku = $simpleOption->getProduct($product)->getSku();
}



If you are a Create Hosting customer on the Magento Hosting Plan, feel free to submit a support ticket and we can take care of this issue for you.


Was this answer helpful?

« Back