Tuesday, March 22, 2016

Add option to customer attribute programmatically In Magento

To programmatically Add option to customer attribute , Add the function given in the reference url to your controller or block:

http://blog.onlinebizsoft.com/magento-programmatically-insert-new-attribute-option/

And replace the below code

 $attribute_code         = $attribute_model->getIdByCode('catalog_product', $arg_attribute);
  

To

 $attribute_code         = $attribute_model->getIdByCode('customer', $arg_attribute);
  

Monday, March 21, 2016

Magento Change Pager Phtml Custom Module



In you block of custom module, for e.g.In my case,  Netgo_Userstatus_Block_Userstatus_List

Just Use the blow code in _prepareLayout() function

  protected function _prepareLayout()
{
        parent::_prepareLayout();
        $pager = $this->getLayout()->createBlock(
            'page/html_pager',
            'netgo_userstatus.userstatus.html.pager'
        )->setTemplate('page/html/newsfeed_pager.phtml')
        ->setCollection($this->getUserstatuss());
        $this->setChild('pager', $pager);
        $this->getUserstatuss()->load();
        return $this;
    }

The Red colored is the extra code that I have added, you can define your phtml file for the pager.