Magento product images duplicate issue with CSV product importer

Posted by Damodar Bashyal on January 28, 2014

 

Magento duplicate image issue and solution

Our client likes to leave images on media/import folder and when they import csv, if product image already existed, it was creating duplicate image.

So below is a quick workaround to fix this issue. Here we are just deleting previous images if we are going to re-import them again.

More»

Magento upgrade steps, issues and solutions

Posted by Damodar Bashyal on January 24, 2014

 

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

Magento upgrading steps, processes, issues, bugs and solutions

=======================================
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;
}

More»

Magento Print Customer's Group Name on the transactional emails

Posted by Damodar Bashyal on January 13, 2014

 

One of our Magento clients uses different customer groups to offer different price discounts on orders. When customers buy $100 worth of products within a year they become bronze member with 5% discount on future orders and Silver member if $200 or over and Gold if $300 and over and they get discount accordingly.

More»