Friday, April 30, 2010

"prakashkhandelwal@rediffmail.com"

Sunday, April 11, 2010

Succesfull Registraion

To Show a new page to user after registraion that he has successfull registered rather than account page

Step 1 .You have to create one page through cms give it's url as
customer/account/newuser

Step 2. Open /code/core/Mage/Customer/controllers/AccountController.php
in method createPostAction()

find this
else {
$session->setCustomerAsLoggedIn($customer);
$url = $this->_welcomeCustomer($customer);
$this->_redirectSuccess($url))

}

comment out $this->_redirectSuccess($url)) statement and add

$this->_redirectSuccess(Mage::getUrl('*/*/NewUser', array('_secure'=>true)));

That should be enough

Magento Pagination

Hello People

I am posting the way i did pagination in the My Wishlist Table .I used that way to paginate few other modules(self-built).

This is for1.4.0.1 I don't know about rest fo the version.

1.
code/core/Mage/Wishlist/Block/Customer/Wishlist.php

comment out the _prepareLayout function and add

protected function _prepareLayout()
{
parent::_prepareLayout();
$pager = $this->getLayout()->createBlock('page/html_pager', 'wishlist.customer.pager')
->setCollection($this->getWishlist());
$this->setChild('pager', $pager);
$this->getWishlist()->load();
return $this;
}

Add One more method in the same file wishlist.php
public function getPagerHtml()
{
return $this->getChildHtml('pager');
}

2 Open /app/design/frontend/base/default/template/wishlist/view.phtml
and add
getPagerHtml(); ?>

above
and below


That's it.

If this is usefull to you don't forget to post the comment.