Stop Magento Redirecting to Empty Cart on Success.phtml

Recently when trying to modify the success.phtml section in magento, I found it very frustrating the fact you had to make new fake orders to see your modified file. Of course I could have used firebug or some extension like that but I much prefer making modifications and hitting refresh.

After a little digging into the core files, I managed to find a solution.

Open: app/code/core/Mage/Checkout/controllers/OnepageController.php

There is no need to move this file to local (unless you have already modified this file, so use the local version instead) as it’s only a temporary modification, obviously you don’t want this on the live site so *remember to undo this change when finished*.

Change: (Line:227 in 1.6.1.0)

$session->clear();

To:

//$session->clear();

Simple as that, hope this helps.

CSV to HTML using PHP

<?php
 
$file_handle = fopen("path/to/file/Book2.csv", "r");
 
while (!feof($file_handle) ) {
 
$line_of_text = fgetcsv($file_handle, 1024);
 
print "<p>" . $line_of_text[0] . "</p>";
print "<p>" . $line_of_text[1] . "</p>";
print "<p>" . $line_of_text[2] . "</p>";
 
}
 
fclose($file_handle);
 
?>

» Sample CSV File

Ruby on Rails Free Audio and Video Tutorials

Ruby on rails is an open source web development application that was created to make the everyday web programmer’s life that little bit easier. Rails is about allowing beautiful code to solve the problems most people have most of the time in web-application development. It’s about taking the pain away and making you happy.

During some research into ruby on rails I came across a free online tutorial which consists of 23 lessons. These lessons take you through the ins and outs of ruby on rails and helps get you on your way to creating beautiful agile web applications. Continue reading Ruby on Rails Free Audio and Video Tutorials