2

I am creating a custom module collection which has content as product grid serialization. I have referred article How to create the Product Grid Serializer Block In Custom module.

I use Mage::registry('current_[entity]')->getId(); to get the id. In my case I have used Mage::registry('current_collections')->getId(); But i am getting error:

Fatal error: Call to a member function getId() on a non-object in ..Tab/Product.php file.

How can I get current collections id from registry?

4

Take a look at /app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php

/**
 * Initialize order model instance
 *
 * @return Mage_Sales_Model_Order || false
 */
protected function _initOrder()
{
    ....

    Mage::register('sales_order', $order);
    Mage::register('current_order', $order);
    return $order;
}

In order to use Mage::registry('current_order') it must first be set (Mage::register('current_order', $order);) some where , else you going to get a Fatal error

  • thank, i registered collections. Now it is showing error Fatal error: Call to a member function setCollectionsProducts() on a non-object in CollectionsController.php also i am not finding any method with name setCollectionsProducts – Magento warrior Nov 15 '14 at 11:43
  • I think i am unable to access object of layout block in function productsAction() in controller. Error found for code $this->getLayout()->getBlock('collections.edit.tab.product') Here it returns Boolean false. – Magento warrior Nov 15 '14 at 12:32
  • In order to keep this site clean, can you just create a new question and add code from your controller, layout.xml and config – Renon Stewart Nov 15 '14 at 13:00

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.