Subesh Pokhrel's Blog – Magento Development Tips,PHP,Google Maps
PHP & Magento Tips & Tutorials

During one of my project works I came across a situation like changing the input of TINYMCE editor to image. Can you believe what can be the user’s requirement? :P Basically what the client needed was to change the text to image and text should be in American Typewriter Font with the option of showing text as image formatted by alignment. i.e Left Alignment, Center Alignment or Right Alignment in a white background image. Then I did some research, this is another way of saying I Googled a lot! lol. I came across two scripts, one which converted text to image and another a function to set alignment. So I thought that why not combine both the codes and publish for others, who may need it as well.

Continue reading “Converting Text to Image in PHP formatted by alignment” »

  • Share/Bookmark

Handling Products image in Magento is quite easy to do. Magento has deviced as very good class and function to create product’s image by defining widht and height and in addition it caches that image created if you want to get the same sized image next time. But managing other images like category images or other image you may need in your module can be quite troublesome. I went to the core of the function used to cache product’s image and came up with the script which can be used to cache any other images, like the product’s image.

Continue reading “Image Resize In Magento & cache the resized image” »

  • Share/Bookmark

As you may know or not ! Magento is the fastest growing eCommerce plateform, nowonder because Magento has a lots of flexibility in it. You can feel that too if you are a just a user and as for me as Programmer I just Love it. One of the salient feature that makes Magento a leader in eCommerce software is its ability to Import and Export data to an from the system.

Continue reading “Product Import In Magento Alongwith Updating The Attribute’s Options” »

  • Share/Bookmark

Here is a simple way of adding product link such as Related, Upsell and Crosssell Link to a product in Magento. I just got the way of doing this and thought to share! So kind of me :)

Continue reading “Adding Related Product and other links to Product in Magento” »

  • Share/Bookmark

Working with AJAX in Magento

Posted on November 17, 2009 | 5 Comments

Ajax in Magento can be pretty troublesome.Because you will need to take controllers and layout into account.And I almost used up a whole day trying to make ajax work. Here are some of the steps I’d like to share so that you will not waste lots of your time, before making this work :D .
Let’s first know in Magento terms what we need.

Continue reading “Working with AJAX in Magento” »

  • Share/Bookmark

Magento as you might know or not! has really a very PIA (Pain in the A**) type of methods to create SQL, execute and fetch! There are two ways of getting SQL from the collection of Magento. Here are the two ways.

Continue reading “How to get Query as a String in Magento?” »

  • Share/Bookmark

I was working in Magento trying to print PDF of the shipping information, with out changing the locale of the site and it was set to “Dutch”. And I came up with this word “gemailed”, I pronounced it as “G-Mailed”. Then suddenly my mind clicked with a connection G-Mailed and Gmail. So i thought it would be a good (if not better) discovery and share on my blog. Here’s the screen shot of the translation.

Continue reading “Wonder if this is the reason behind the name “Gmail”!” »

  • Share/Bookmark

I am a big fan of Latitude and Longitude, as you all might know, I have other post related to Latitude and Longitude and Google Maps.
I came across one of the greatest feature of Mozilla Firefox 3.5, and that was to get the latitude and Longitude of user using simple Javascript. No API to use, No query to Google or anything. Here’s the code.

Continue reading “Get Latitude and Longitude Of User From Simple Javascript!” »

  • Share/Bookmark

Googling “Google” On Google

Posted on December 30, 2008 | 6 Comments

Have you ever tried searching for “Google” on Google? You might have or not, I don’t know, but when I asked to one of my friend he gave me a very humorous answer. He said it would go into a “infinite loop“.
Mathematically speaking R=G(G), here R is Result and G stands for searching in Google, where the searching parameter is itself Google (G). So, when you break it up or simplify this we can see as follows:

Continue reading “Googling “Google” On Google” »

  • Share/Bookmark

I have completed first phase of a simple, yet useful Newsletter System. When I demonstrated to the clients, they came up with a question if the newsletter being send was opened or not by the newsletter subscribers ? I then thought.. let see how its done. Then I came with this simple tracking trick, most of the spammers used to verify if the email address was valid or not.
The first thing I did was adding 1px by 1px image on the footer of the newsletter, whose source was set something like this http://subesh.com.np/newsletter/track.php?identitycode=CLIENTID_SENDEMAILID. Here CLIENTID = Your Clients ID and SENDEMAILID = Id of the Newsletter sent. Now, when the image is loaded while viewing the newsletter on the mail or say when the client reads the newsletter email. The track.php page is requested with identitycode as the GET parameter. And when you get the request from the mail to your server’s page, you can do anything you want. What I did was setting the mail_read column of the database field as 1. And echoed the source of the image file on the last line.
The code below is for the track.php.

Continue reading “Newsletter Email Tracking: Read or Not?” »

  • Share/Bookmark

Search engine optimization by SEO Design Solutions