This is a short weblog of damodar bashyal

Text

This post details on how I was able to add new template tag on Magento Cms pages and static blocks. If you want to know more about these directives and template tags, you can check official magento wiki here.
I have already added this functionality and example on my github repository here https://github.com/dbashyal/Magento-General-Module-Extension. This module consists of other functionalities, so check code and strip out that you don’t need it. http://dlvr.it/6KqnMd

Text

It’s easy to redirect simple page urls from one location to another but query strings redirection can make you pull your hair.
This is how I redirected simple pages: http://dlvr.it/5pqLvc

Text

Lets create new image attribute first at: magento admin > Catalog > Attributes > Manage Attributes > Add New Attribute
Set Attribute Properties as below: http://dlvr.it/5p7jDD

Text

This is the function I always forget and keep googling, So here are my finds to delete, revert or remove commits from local and remote. http://dlvr.it/5ldBLk

Text

This is raw copy from my notes during magento store upgrade.

======================================= Restrict access to /index.php with IP Address whitelist.
This is what I have:
if (file_exists($maintenanceFile)) {
// START IP BLOCKER
// Remove file ‘maintenance.flag’ when you decide to go live
$ip_whitelist = array(‘x.x.x.x’, ‘127.0.0.1’, ‘x.x.x.x’);
if(!in_array($_SERVER[‘REMOTE_ADDR’], $ip_whitelist)) {
$protocol = “HTTP/1.0”;
if ( “HTTP/1.1” == $_SERVER[“SERVER_PROTOCOL”] )
$protocol = “HTTP/1.1”;
header( “$protocol 503 Service Unavailable”, true, 503 );
header( “Retry-After: 3600” );
header(‘Location: /index_landingpage.php’); // our own custom landing page.
exit;
}
// END IP BLOCKER
include_once dirname(__FILE__) . ‘/errors/503.php’;
exit;
} http://dlvr.it/5l0ZGM

Text

Are you seeing a lot of 404 page reports on google webmaster tools? Then fear not, we now have free t404 to handle magento’s 404 pages. http://dlvr.it/5jx3HX

Text

One of the magento based website had strange issue. All rules in the admin > Promtions > Catalog Price Rules were inactive. But still some products were displaying as sale items. So ran mysql code listed below to find out what was happening. http://dlvr.it/5ZwT23

#selfie )( bishal and me

#selfie )( bishal and me

Text

Today because of magento bug when I saved payment info on client’s site, it replaced all payment info on database with encrypted values. http://dlvr.it/5PVRq0

Text

Entering into a marriage will be one of the most emotionally charged events of your life. You will be filled with love, fear, happiness, and overwhelming joy. While it is normal to acknowledge that these emotions may tone down a little as time passes in a marriage, it is also easy to say that you can keep all of these positive feelings in your marriage for life with a little pre-planning. http://dlvr.it/54jfWJ