Posts

Showing posts from September, 2015

Send mail from magento

$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 $mail->send(); ?> also you can use $emailTemplate  = Mage::getModel('core/email_template')->load(1);   //1 is Transactional Emails id $emailTemplate->setSenderEmail('sapnandu@gmail.com'); $emailTemplate->setSenderName('Sapnandu'); $emailTemplate->send('sourav.m@gsl.in','John', '');

The order confirmation email is not sent

Just do a small change in order.php ( public_html / app / code / core / Mage / Sales / Model / Order . php ) First create one directory strcture as below path and then copy and paste the file to below path. ( public_html / app / code / local / Mage / Sales / Model / Order . php ) Now, change from $mailer -> setQueue ( $emailQueue )-> send (); to $mailer -> send ();

Magento Register Form validate with VarienForm function get response

var theForm = new VarienForm ( 'frm_feedback' , true ); Where frm_feedback is your form id if ( theForm . validator && theForm . validator . validate ()) { // if validation successful pass then } else { //magento validation fire }   example: < form id =" co-shipping-method-form " action =""> var theForm = new VarienForm ( ' co-shipping-method-form ' , true );     if ( theForm . validator && theForm . validator . validate ()) { // if validation successful pass then } else { //magento validation fire }

How To Add Option Title To Product Option Select (Dropdown) and Remove ‘– Please Select –‘

First you need to find the two .phtml files located at the paths below: app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php and… app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php Copy these files to your local code directory and edit as below. On line 58 of Select.php, you’ll find this IF statement within function ‘public function getValuesHtml()': if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN) { $select->setName('options['.$_option->getid().']') ->addOption('', $this->__('-- Please Select --')); } Firstly, we need to get the option title: $getOptionName = ucwords($_option->getTitle()); And replace the ‘– Please Select –‘ value with it. Here’s the final section of code: if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN) { $getOptionName = ucwords($_option->getTitle()); $s...