30Dec/100

Automatically Show A Message When Your Office Is Closed

If you offer phone support, it is extremely important to tell your customers what hours your customer service is available. A simple 8-5 Mon-Fri next to your phone number can increase the number of potential customers who will call in. No one wants to call and leave a message, let them know if a live person is available!

However, with the holidays, those hours can be pretty erratic. Is your customer service center closed for New Years Eve and New Years Day? Or just one specific day? Here is a quick and easy way to show a message that will automatically expire whenever you need it to.First, we are going to edit template/page/html/header.phtml. Make sure you copy this to your theme folder, don't edit the base/default file.

At the very beginning of the file (directly after the copyright info), add this block of code:

<?php
 $end_date = strtotime('6:00pm December 31, 2010');
 $now = time();

 if ($end_date < $now) {
 ?>
 <?php
 } else {
 ?>
 <style type="text/css">
 .top-message {
 background: #eee;
 border-top: 2px solid #ccc;
 text-align: center;
 font-size: 12px;
 position: fixed;
 bottom: 0;
 right: 0;
 left: 0;
 padding: 5px;
}
 </style>
 <div><strong>Happy New Year!</strong> Our offices will be closed Friday, Dec 31.</div>
 <?php
 }

?>

Example: http://www.wickercentral.com (IMPORTANT, after 6PM Dec 31 the message will disappear)

In this example, we are showing a message that stays fixed to the bottom of the page. This message will only be shown if the current date/time is before Dec 31 6:00PM (Eastern Standard in this example). You can easily change the date and message in this for any holiday you need. When the holiday is over, the message will automatically disappear. This saves you the trouble of trying to remember to change the header on New Years Eve. Let's be honest, no one wants to be editing PHP code on New Years Eve.

Everyone have a safe and happy holiday!

About John Webber

John is the founder of MagThemes.com and has been working with Magento since version 0.9
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.