Trent: Halloween Ninja

This post is equal parts “Holy Cow! No Halloween Pic of Trent,” and “Hey, let’s sort out this LifePics thing we have going for Unique Photo, Inc.”

Buy Digital Prints

So here’s Trent all Ninja’d Up ready to trick or treat. Lisa always gets the house looking so nice for every holiday and this year was no exception. So this is sort of an e-Commerce post – you can click the picture and order prints, calendars, gifts of all shapes and sizes. And it’s also for the family – mine. Happy Belated Halloween!

Magento – display SKU on product listing page

In list.phtml, I want to be able to see the SKU in the product listing. list.phtml is a simple if a tad large “if-else” construct, the first part of the if being list view, the else part being the grid view. So, if you want it in both places, you’ll have to hit 2 spots. list.phtml is found in app/design/frontend/pathToYourTheme/template/catalog/product.

On this particular project, SKU is very important. We mail out several catalogs to various verticals, and some people don’t know anything but the SKU when they’re ordering.

My theme is based on default. Your actual line numbers may vary, but here’s the context for list view, the “if” of our template:


55 <?php // Product description ?>
56 <div class="product-shop">
57 <h5><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a></h5>
58 <?php echo $this->htmlEscape($_product->getSku()); ?>
59 <?php if($_product->getRatingSummary()): ?>
60 <?php echo $this->getReviewsSummaryHtml($_product) ?>
61 <?php endif; ?>

Grid view is the “else” of this section, it’s down a little further in list.phtml:


102 <h5><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><? php echo $this->htmlEscape($_product->getName()) ?></a></h5>
103 <?php echo $this->htmlEscape($_product->getSku()); ?>
104 <?php if($_product->getRatingSummary()): ?>
105 <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
106 <?php endif; ?>

And that’s it! You’ll have a nice display of your SKU.

Get An Email List Out of Your osCommerce Database

I’ve found it necessary to get an email list out of a few osCommerce stores so that I can export that data to a mailing house.

Please note that this SQL doesn’t look at the customer’s newsletter selection – our external company handles whether or not they wish to receive e-mail from us. So you may have to join the customers table in here.


SELECT DISTINCT customers_company, customers_name, customers_email_address
FROM orders
WHERE date_purchased <= '2008-11-10 23:59:59'
ORDER BY customers_company, customers_name, customers_email_address

It’s probably overkill to have all those fields specified in ORDER BY, but I only have a couple thousand addresses and a big powerful machine. I’m sure MySQL can handle it.

I used phpMyAdmin to execute this query and export to a tab delimited csv.