Search code examples
phpformsmagentoadminbackend

Magento 1.9.2 - Save custom admin form product new & edit page (custom tab)


I achieved to add a custom tab / grid to the product new & edit page with an input field inside. Following this tutorial

The problem is that it's not saving the data input. And at this point I have no idea if this is actually not covered in the tutorial or I made a mistake.

Is this enough to save the data input?

$customFieldValue =  $this->_getRequest()->getPost('custom_field');

$product->save();

How could I debug this value in the backend?


Solution

  • It is not covered by tutorial. To see the difference you probably have to add new attribute to product and then do something like:

    $customFieldValue =  $this->_getRequest()->getPost('custom_field');
    $product->setNewAttribute($customFieldValue); 
    $product->save();