
St. Cloud Ear, Nose & Throat
Features
- Concrete5
- Custom Physician Bio’s
- Homepage Image Slider
- Geo Locations Map / Sitemap
Don’t force a specific URL in C5
In /config/site.php add the line
define('REDIRECT_TO_BASE_URL', false);
Yup, yer done.
This is useful when making a site live and DNS is still propagating. This way it’ll respond to both site.com and site.mnwebdevelopment.com and not redirect you back to the old site.
Magento Transactional Emails
You will want to edit Magento’s email templates to update the logo used and change the default store hours that are listed. You can also change the link colors to better match the site or go all out and create something totally different from the Magento defaults.
Make Changes to Existing Templates
To make changes to Magento’s Transactional Emails, in the Admin go to System > Transactional Emails.
Click Add New Template. From the Template dropdown find the email you want to edit, click Load Template.
Give the template a new name in Template Name. I usually give it the same name and add site initials after it. Ex: “New Invoice – dm” for a new template for Dombrovski Meats.
You can then make your changes, see a preview, and save it.
Templates I usually edit (26)
– Credit Memo Update
– Credit Memo Update for Guest
– Forgot Admin Password
– Forgot Password
– Invoice Update
– Invoice Update for Guest
– New Credit Memo
– New Credit Memo for Guest
– New Invoice
– New Invoice for Guest
– New Order
– New Order for Guest
– New Shipment
– New Shipment for Guest
– New account
– New account confirmation key
– New account confirmed
– Newsletter subscription confirmation
– Newsletter subscription success
– Newsletter unsubscription success
– Order Update
– Order Update for guest
– Remind Password
– Share Wishlist
– Shipment Update
– Shipment Update for Guest
All these may not be used for every project, but I think they should all be done just in case.
Create a Custom Variable for Store Hours
Magento automatically puts in the company phone number from the site’s general configuration, but the store hours are hard-coded in the templates.
Go to System > Custom Variable and click Add New Variable.
In Variable Code add store_hours, in Variable Name add Store Hours. In Variable Plain Value put the store hours. Save it.
In the email template put {{customVar code=store_hours}} wherever you want to replace or add store hours.
Not every template that has a phone number will have the hours listed, these are the emails that do:
– New Credit Memo
– New Credit Memo for Guest
– New Invoice
– New Invoice for Guest
– New Order
– New Order for Guest
– New Shipment
– New Shipment for Guest
Change the Logo used in the Emails
The default logo is the Magento logo. Just replace logo_email.gif in \skin\frontend\default\your_theme\images with a new image.
edt: I don’t think this is necessary any more.
Upload the logo in the Admin at System > Configuration > General – Design > Transactional Emails
Applying the new Email Templates
Set templates in:
System > Configuration > Customers – Newsletter
System > Configuration > Customers – Customer Configuration
System > Configuration > Customers – Wishlist
System > Configuration > Sales – Sales Emails
System > Configuration > Advanced – Admin
I think that’s all of them.
Advanced Editing
The transactional email templates do not contain the output for products and order details, such as the bottom portion of the New Order email that shows the products ordered, billing address, and shipping address.
These templates are stored here:
Physical Products –
\app\design\frontend\default\your_theme\template\email
Downloadable Products –
\app\design\frontend\default\your_theme\template\downloadable\email
If these directories don’t exist, copy them from the core files
\app\design\frontend\base\default\template
Clean up Payment Info Block
Create a copy of \app\design\frontend\base\default\template\payment\info\default.phtml into your own package/theme.
Add to th:
style="font-size:12px; text-align:left;"
Add to td:
style="font-size:12px;"
Add Shipment Tracking Links to Email
Create a copy of \app\design\frontend\base\default\template\email\order\shipment\track.phtml into your own package/theme.
Replace:
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
with:
<?php if ($_item->getCarrierCode()=='usps'): ?> <td align="center" valign="top" style="padding:3px 9px"><a href="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td> <?php elseif ($_item->getCarrierCode()=='ups'): ?> <td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/processInputRequest?tracknum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td> <?php elseif ($_item->getCarrierCode()=='dhl'): ?><?php /*?>Admin says this DHL is deprecated<?php */?> <td align="center" valign="top" style="padding:3px 9px"><a href="http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td> <?php elseif ($_item->getCarrierCode()=='dhlint'): ?> <td align="center" valign="top" style="padding:3px 9px"><a href="http://www.dhl-usa.com/content/us/en/express/tracking.shtml?brand=DHL&AWB=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td> <?php elseif ($_item->getCarrierCode()=='fedex'): ?> <td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/Tracking?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td> <?php else: ?> <td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td> <?php endif; ?>
This will create tracking links for USPS, UPS, DHL and Fedex.
New Package Theme Creation and Transactional Emails
The following may no longer be an issue.
If your theme creation involves creating a new Package with a Default theme inside (\app\design\frontend\your_package\default), you will find that the logo image in the email templates will not have the correct file path. It will still be “/skin/frontend/default/default/images/logo_email.gif”.
In this part of the email template:
<img src="{{skin url="images/logo_email.gif" _area="frontend"}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/>
Add:
_package="your_package"
after:
_area="frontend"
to make:
<img src="{{skin url="images/logo_email.gif" _area="frontend" _package="your_package"}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/>
If your theme within the package is not called “default”, add the following to the same area:
_theme="your_theme"
Magento: Replace Product Image Zoomer with Lightbox
Follow these instructions to add a Prototype lightbox to the Product Detail page.
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/adding_lightbox_to_magento_v2
I did Step 7 differently though (Adding Lightbox to base image)
In this file \app\design\frontend\default\blank\template\catalog\product\view\media.phtml
I commented out:
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?> <p class="product-image product-image-zoom"> <?php $_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />'; echo $_helper->productAttribute($_product, $_img, 'image'); ?> </p> <p class="zoom-notice" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p> <div class="zoom"> <img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" title="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" /> <div id="track"> <div id="handle"></div> </div> <img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" title="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" /> </div> <script type="text/javascript"> //<![CDATA[ Event.observe(window, 'load', function() { product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint'); }); //]]> </script> <?php else: ?> <p class="product-image"> <?php $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />'; echo $_helper->productAttribute($_product, $_img, 'image'); ?> </p> <?php endif; ?>
and put this
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?> <p class="product-image"> <a href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" rel="lightbox[rotation]" title="<?php echo $_product->getName();?>"> <img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(265,265); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" /> </a> </p> <?php else: ?> <p class="product-image"> <img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(265,265); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" /> </p> <?php endif; ?>
If you get the lightbox working but the Close button image is not loading, try this.
Open \app\design\frontend\default\your_theme\template\page\html\head.phtml
and add a / inside the quotation marks of getJsSkinUrl(”)
var SKIN_URL = '<?php echo $this->helper('core/js')->getJsSkinUrl('/') ?>';
Magento: Remove White Frame from Product Images
Product images can be found in these files:
Product Listings –
\app\design\frontend\default\your_theme\template\catalog\product\list.phtml
Product Detail –
\app\design\frontend\default\your_theme\template\catalog\product\view\media.phtml
Cart –
\app\design\frontend\default\your_theme\template\checkout\cart\item\default.phtml
Cart Sidebar Recently Added –
\app\design\frontend\default\your_theme\template\checkout\cart\sidebar\default.phtml
There are many more instances of product images, but these are probably the more important ones. Just do a search in DW in the /template folder for ->resize to find them.
Find where the product image is added, will look something like this.
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
Before
->resize(135)
Add
->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)
->constrainOnly(true) – This will not resize an image that is smaller than the dimensions inside the resize() part.
->keepAspectRatio(true) – This will not distort the height/width of the image.
->keepFrame(false) – This will not put a white frame around your image.
Make sure that resize() has the max width and height twice.
->resize(135, 135)
Also remove the width and height attributes from the image.
Source
http://www.magthemes.com/magento-blog/customize-magentos-image-resize-functionality/
Recent Comments