Monday , December 11 2017
Home >> Tag Archives: Magento tutorial (page 2)

Tag Archives: Magento tutorial

Sending Email in Magento

Anyone can send mail using php mail() function. But in magento, all the functionality you need to just send argument inside those functions. See the following code to send mail using magento function: <?php  $mail = Mage::getModel(‘core/email’); $mail->setToName(‘Your Name’); $mail->setToEmail(‘Youe Email’); $mail->setBody(‘Mail Text / Mail Content’); $mail->setSubject(‘Mail Subject’); $mail->setFromEmail(‘Sender Mail Id’); $mail->setFromName(“Msg to Show on Subject”); $mail->setType(‘html’);// YOu can use Html or text as Mail format   try { $mail->send(); Mage::getSingleton(‘core/session’)->addSuccess(‘Your request has been sent’); $this->_redirect(”); } catch (Exception $e) { Mage::getSingleton(‘core/session’)->addError(‘Unable to send.’); ...

Read More »

Magento Developers’ Guide – Part 10: Rewrite to modify a Magento controller

How to make a rewrite of a controller ? Because your module will not know where to search for your extended class…you have to make a require in your controller. require_once “Mage/Checkout/controllers/CartController.php”; This gives you something like: require_once “Mage/Checkout/controllers/CartController.php”; class Pfay_Checkout_CartController extends Mage_Checkout_CartController {     # Rewrite of indexAction     public function indexAction() {         die(‘your method has been rewrited !!’);     } } The require_once is important if your ...

Read More »

Magento Developers' Guide – Part 10: Rewrite to modify a Magento controller

How to make a rewrite of a controller ? Because your module will not know where to search for your extended class…you have to make a require in your controller. require_once “Mage/Checkout/controllers/CartController.php”; This gives you something like: require_once “Mage/Checkout/controllers/CartController.php”; class Pfay_Checkout_CartController extends Mage_Checkout_CartController {     # Rewrite of indexAction     public function indexAction() {         die(‘your method has been rewrited !!’);     } } The require_once is important if your ...

Read More »
Heap | Mobile and Web Analytics