Magento Fix – Transactional Email Preview Showing HTML only

Post Image

In Magento version 1.6.1.0, I noticed when previewing a transactional email it displayed in html only. Obviously this isnt right so I come up with this little fix.

Stop Magento Redirecting to Empty Cart on Success.phtml

Post Image

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 …

Quick Magento Tip: Logo / Images in Transactional Emails Not Appearing

Post Image

Magento by default will choose the logo_email.gif from the default package and default theme. To force it to use the logo_email.gif or any other image from your custom package or theme add the following snippets to your skin url.

 
_package="MyPackageName" _theme="MyCustomThemeName"

Example:

 
{{skin url="images/logo_email.gif" _area=’frontend’ _package="MyPackageName" _theme="MyCustomThemeName"}}

Magento Issue Fix – “El is NULL”

Post Image

I have recently come across an issue when trying to add a Widget to a CMS page.
When clicking “Insert Widget” a javascript alert appeared shouting El is NULL.
The reason for this is a missing forward slash from Lib/Varien/Data/Form/Element/Editor.php Line 202.
To fix this error copy Lib/Varien/Data/Form/Element/Editor.php to app/code/local/Lib/Varien/Data/Form/Element/Editor.php
app/code/local/Lib/Varien/Data/Form/Element/Editor.php
Line 202 – Replace

‘onclick’ …

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

Magento – Get Cart Quantity Within A Session

Post Image

<?php
function getCartQuantity () {
$cart = Mage::getModel(’checkout/cart’)->getQuote()->getData();
if (isset($cart[’items_qty’]))
return (int)$cart[’items_qty’];
else
return 0;
}
echo getCartQuantity ().’ Item(s)’;
?>

 Page 1 of 8  1  2  3  4  5 » ...  Last »