• By Pushpendra Singh
  • March 30, 2012
  • Magento
isShippingLabelsAvailable : Magento Issue

Magento Version 1.6 has a bug related to isShippingLabelsAvailable() method.

When you try to make shipment an order you may be get a error :

Fatal error: Call to a member function isShippingLabelsAvailable() on a non-object in app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php on line 132

This error lies in the Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Items class on line 130 within the canCreateShippingLabel() method.

In order to resolve it open app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php

Replace the below code :
public function canCreateShippingLabel() {
return $this->getOrder()->getShippingCarrier()->isShippingLabelsAvailable();
}

with below code:
public function canCreateShippingLabel() {
$carrier = $this->getOrder()->getShippingCarrier();
if(method_exists($carrier, ‘isShippingLabelsAvailable’)) {
return $carrier->isShippingLabelsAvailable();
} else {
return false;
}
}

Upload the Items.php

Are you looking for Magento Website Developement