~欢迎来到*秋の网*部落格 Welcome to Chew's Web blog~ 使用火狐会更好 Download Best view using Mozilla Firefox. Download

Thursday, July 31, 2014

Magento: ActiveCampaign Settings not loading issue

After installing ActiveCampaign extension, when clicking on status, the Settings page show blank. (hope this may help everyone)

1st, in order to solve this, enable System log to see what is the problem.
System -> Configuration -> Developer -> Enable "Log Settings"

*The problem shows unable to load Connection.php. this is due to installation problem that the file has installed as a directory.

2nd, create a file in /app/code/community/ActiveCampaign/Subscriptions/Block/Adminhtml/Subscriptions/Edit/Tab/Connection.php and paste the code below.

class ActiveCampaign_Subscriptions_Block_Adminhtml_Subscriptions_Edit_Tab_Connection extends Mage_Adminhtml_Block_Widget_Form
{
  protected function _prepareForm()
  {
      $form = new Varien_Data_Form();
      $this->setForm($form);
      $fieldset = $form->addFieldset('subscriptions_form', array('legend'=>Mage::helper('subscriptions')->__('Add Connection Details')));

      $fieldset->addField('title', 'text', array(
          'label'     => Mage::helper('subscriptions')->__('Title'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'title',
      ));

      /*
      $fieldset->addField('filename', 'file', array(
          'label'     => Mage::helper('subscriptions')->__('File'),
          'required'  => false,
          'name'      => 'filename',
  ));
  */

      $fieldset->addField('status', 'select', array(
          'label'     => Mage::helper('subscriptions')->__('Status'),
          'name'      => 'status',
          'values'    => array(
              array(
                  'value'     => 1,
                  'label'     => Mage::helper('subscriptions')->__('Enabled'),
              ),

              array(
                  'value'     => 2,
                  'label'     => Mage::helper('subscriptions')->__('Disabled'),
              ),
          ),
      ));

      $fieldset->addField('api_url', 'text', array(
          'label'     => Mage::helper('subscriptions')->__('API URL'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'api_url',
      ));

      $fieldset->addField('api_key', 'text', array(
          'label'     => Mage::helper('subscriptions')->__('API Key'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'api_key',
      ));

      /*
      $fieldset->addField('content', 'editor', array(
          'name'      => 'content',
          'label'     => Mage::helper('subscriptions')->__('Content'),
          'title'     => Mage::helper('subscriptions')->__('Content'),
          'style'     => 'width:700px; height:500px;',
          'wysiwyg'   => false,
          'required'  => true,
      ));
      */

      if ( Mage::getSingleton('adminhtml/session')->getSubscriptionsData() )
      {
          $form->setValues(Mage::getSingleton('adminhtml/session')->getSubscriptionsData());
          Mage::getSingleton('adminhtml/session')->setSubscriptionsData(null);
      } elseif ( Mage::registry('subscriptions_data') ) {
          $form->setValues(Mage::registry('subscriptions_data')->getData());
      }
      return parent::_prepareForm();
  }

}


0 comments:

秋の网 - 赵のchew © 2009 - 2012. Leave me comment, I will reply u as soon as possible.