Archive for the ‘Basic Zen Cart Tips’ Category

How to Display a “Low Stock” Alert on Zen Cart Product Pages

Tuesday, November 25th, 2008

To create a sense of urgency and let customers know a product has only one item left in stock, a simple SQL query is needed in the tpl_product_info_display.php file.

1. First, you must be tracking stock of your products through Zen Cart.

2. Download, includes/template/Your_Templates/tpl_product_info_display.php and open the file.

Copy this code:

<!-- bof limited supply -->
<?php

$limitedSupply_query = "SELECT products_quantity, products_id
FROM " . TABLE_PRODUCTS . "
WHERE products_id = '" . (int)$_GET['products_id'] . "' ";

$limitedSupply = $db->Execute($limitedSupply_query);

if ($limitedSupply->fields['products_quantity'] == 1)  {
echo '<div id="limited">Only one left</div>';
}
?>
<!-- eof limited supply -->

3. Paste the code in the file where you would like the alert message to appear, I usually put it just above the Add to Cart button. Upload the edited file to includes/templates/Your_Template/

4. Download your stylesheet and create and define #limited. Upload the edited stylesheet to includes/templates/Your_Template/css/

5. Find a product on your web site that has only one product. Make any needed changes to the stylesheet.

How to Add Additional Order Status Options in Zen Cart

Monday, October 27th, 2008

By default, Zen Cart comes with 3 Order Status options; processing, delivered and update. Oftentimes, you may want to add additional options such as “Shipped”. Adding new options is quite easy, just follow the steps below.
1. Go to Localization –> Order Status in your Zen Cart admin area and click on the “Insert” button.

2. Enter your new Order Status in the field provided and click on the “insert” button.

Now when processing orders, you will have “Shipped” as a Order Status option.

Happy Zen Cart!

Adding a “New Product” Icon to Product Description Pages in Zen Cart

Friday, October 24th, 2008

Here’s an easy way to add a “New Product” icon automatically to your product description pages in Zen Cart.

1. Create a small graphic that says New or NEW PRODUCT and name it new.gif. Then upload your image to includes/templates/YOUR_CUSTOM_TEMPLATE/images .

2. Open includes/templates/YOUR_CUSTOM_TEMPLATE/css/stylesheet.css at the bottom add the following lines:

.newProduct {
background-image:url(../images/new.gif);
width: Your image width in px;
height: Your image height in px;
}

Make sure you enter your actual image pixel dimensions.

3. Open includes/templates/YOUR_CUSTOM_TEMPLATE/templates/tpl_product_info_display.php and add the following:

$datesql = “select products_date_added from zen_products where products_id = “. (int)$_GET['products_id'] .” “;
$date_display = $db->Execute($datesql);
$newdate = $date_display->fields['products_date_added'];
$newdate2 = $newdate - 30;
function reformatDate($newdate) {
list($year, $month, $day, $hour, $min, $sec) = split( ‘[: -]‘,
$newdate);
return “$year-$month-$day”;
}
$dateA=$newdate;
$theDate=reformatDate($dateA);
$thirty_days_ago = mktime()-2592000;
if ($theDate >= date(’Y-m-d’, $thirty_days_ago)) { echo ‘<div class=”new”>
</div>’; }
?>

You may have to play with the placement of the code to get the image in the correct place.

Your products will display the new.gif icon you created for 30 days!

How to Offer Free Shipping in Zen Cart

Wednesday, October 22nd, 2008

Offering Free Shipping on orders over a certain dollar amount is a great promotion and is easy to set up!

1. Log in to your Zen Cart admin
2. Go to “Modules -> Order Total”

3. Click on “Shipping”, default installation 6th line. See screen shot, click for full size view.


4. Click on the “edit” button
5. Check “Yes” under “Allow Free Shipping”, enter the minimum dollar amount an order must have to receive free shipping.Select National, international or both for Free Shipping zones. See screen shot, click for full size view.


6. Click “update” for your changes to take effect.

Holiday Check Out Buttons for Your Zen Cart Store

Tuesday, October 21st, 2008

Looking for a good way to spruce up your eCommerce site for the holidays?

eSales411.com has new holiday themed checkout button set for Zen Cart. Sets include 7 buttons that guide your customers through the checkout process. At only $5 per set, this is a great way to get your set ready for the holidays.

Here are a few samples:

To purchase the buttons, visit eSales411.com