I am using the block rewrite below to add two fields to module Amasty_Shopby.


class Etre_Amshopby_Block_Rewrite_Shopby_Adminhtml_Filter_Edit_Tab_General extends Amasty_Shopby_Block_Adminhtml_Filter_Edit_Tab_General

protected function _prepareRegularForm()

    $fldSet3 = $this->_form->addFieldset('etre_amshopby_extra', array('legend'=> $this->__('Bonus Options by Etre')));
    $fldSet3->addField('labelOnFrontend', 'select', array(
        'label'     => $this->__('Show Label on Frontend'),
        'name'      => 'displayLabelFrontEnd',
        'values'    => $this->yesno,
        'required' => true
    $fldSet3->addField('labelInDropdown', 'select', array(
        'label'     => $this->__('Show Label in Dropdown'),
        'name'      => 'displayLabelInDropdown',
        'values'    => $this->yesno,
        'required' => true

The fields show up but they do not save. I'm not sure what the most appropriate way to handle this is.

My guess is part of what needs to be done is each of these fields needs to be added to the Amasty filter table in the DB but I have setup few SQL install scripts within Magento modules so I am unsure as to how I should proceed.

The save action for the filter form is below. My fields are displayed when Zend_Debug::dump($data) is called within this action.

public function saveAction()
    $id     = $this->getRequest()->getParam('id');
    $model  = Mage::getModel('amshopby/filter');
    $data = $this->getRequest()->getPost();
    if ($data) {

        if ($model->getData('display_type') == Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_FROMTO) {
            $model->setData('from_to_widget', true);

        try {

            $msg = Mage::helper('amshopby')->__('Filter properties have been successfully saved');
            if ($this->getRequest()->getParam('continue')){
                $this->_redirect('*/*/edit', array('id' => $model->getId()));
            else {

        } catch (Exception $e) {
            $this->_redirect('*/*/edit', array('id' => $id));

    Mage::getSingleton('adminhtml/session')->addError(Mage::helper('amshopby')->__('Unable to find a filter to save'));

1 Answer 1


Yes, if you are going to modify Improved Layered Navigation module by Amasty, you need to

1. Increment the module version
2. Put the update SQL script in the folder `app\code\local\Amasty\Shopby\sql\amshopby_setup\mysql4-upgrade-2.8.0-2.8.1.php`

where 2.8.0 is your current module version and 2.8.1 is your new version.
Then clear the cache to apply the changes.

Alternatively, you can just add 2 fields directly in the database table.

  • I'd considered taking this route but was unsure if it was the only one available. In the spirit of extending, not modifying, I was hoping I could accomplish the same through my extension. Plausible? Commented Jul 27, 2015 at 12:31

Your Answer

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

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