Showing posts from August, 2010

send mail with attached file

in magento there is no available methods for attach file. once we do it in magento by adding a following code
in  mage/core/model/email/template.php at the end of file.

public function addAttachment(Zend_Pdf $pdf){
        $file = $pdf->render();
        $attachment = $this->getMail()->createAttachment($file);
        $attachment->type = 'application/pdf';
    $attachment->filename = 'yourfile.pdf';

but i prefer to use Zend_Mail to send mail with attached file.
for this u need to do following.

            $mail = new Zend_Mail();
            $mail->setBodyHtml(" body text"); // here u also use setBodyText options.

            // this is for to set the file format
$content = file_get_contents("$file_path");
            $at = …

enabled but dont want to show payment method on frontend checkout

if u wish to do like want to allowed some payment method work on backend but not in frontend. or may be like your payment method enabled
but it should not appear on frontend checkout.

for ex. in my case : i have one method "PAY By INVOICE". this will available in backend but not for frontend customers.

to accomplish this i modified in
path:- **/template/checkout/onepage/payment/methods.phtml

which contain the following.

<div class="payment-methods">
    <dl id="checkout-payment-method-load">
    <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
        <?php if( sizeof($this->getMethods()) > 1 ): ?>
            <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->htmlEscape($_method->getTitle()) ?>" class="radio…

Magento - Reset the admin password

Hi, if u getting trouble in login from admin side because of password then no worry u can reset it simply.

SELECT * FROM admin_user;

above query should retrieve the admin user data. here find the user name name to which u want to reset password. and apply following query

UPDATE admin_user SET password=CONCAT(MD5('admin123')) WHERE username='admin';

u can also do this in mysql query browser