September 25, 2015

jQuery how can remove comma from end of string.



Please see my below example for remove comma from end of string in jQuery.

var edited = test.replace(/^,|,$/g,'');

Enjoy!

How to download script from jsfiddle site?



Yes its possible to view source code of jsfiddle siet.

http://stackoverflow.com/questions/9851878/is-there-a-download-function-in-jsfiddle

Enjoy!

September 11, 2015

How to change page title in Magento?



If you want to change page title from admin side then please follow below steps:


* Login in admin and open CMS > Static pages, then edit page which you want to change "Page Title".

* In frontend and any module, you can use xml file to set new title for your page. The syntax is:

<reference name=“header”>
    <action method=“setTitle” translate=“title”><title>Your Title Here!</title></action>
</reference>

Enjoy!

PHP send email and when click on any link of that email than how to track.



Following is example for track email viewed OR not?

<?php
$user_id = $_GET['user_id'];

If ( $user_id )
{
    $FileName = $id.".txt";
    $ourFileHandle = fopen($FileName, 'w') or die("can't open file");
    fclose($ourFileHandle);
}
else
{
    $to = "jhon@gmail.com"; //to address

    $subject ="Read Receipt Email";

    $message = "Testing whether the read receipt script works or not";
    $message = "<img src=\"http://www.example.com/email.php?user_id=".$to." width=\"0\" height=\"0\" >";
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: kelly@ymail.com' . "\r\n";

    if (mail($to, $subject, $message, $headers) )
    {
        echo "Mail sent successfully";
    }
    else
    {
        echo "failed to send mail";
    }
}

?>

Enjoy!

September 1, 2015

NEWSLETTER SUBSCRIBE CODE MOVE AT FOOTER IN MAGENTO



First you can create a block on the fly and position it precisely in your template files with one line of code:

Add this code: 

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>


Enjoy!

1980s Photo Prompts: Easy Online Copy & Paste

Are you on a quest to enhance your photography projects with a touch of nostalgic flair? Look no further than 1980s photo prompts. These car...