Clean uc_product template

Contrib type: 
Code/CSS Snippet
Status: 
Initial upload
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 1.x

Ive put together a nice clean template for the product node, because I know a lot of newer ubercarters like myself will have a very hard time figureing it out. I originally made it for just my site but I decided to share it as my attempt to give back to the community. I built it in dreamweaver so Im not sure how "clean" the code is but it has a really nice result. And there are sections on it where you could easily add information feilds to the side and stuff. Any way here it is just copy and paste it using contemplate

I also included a screen shot to show you what it looks like before you mess around with it.

And it has thickbox support

<?php

// Grabs the firsts image path and sets $imagePath.
$imagePath = $node->field_image_cache['0']['filepath'];
?>

<style type="text/css">
<!--
.style1 {font-size: 12px}
.style11 {font-weight: bold}
.style13 {font-size: 12px; font-weight: bold; }
.styleimages {float: left; }
-->
</style>

<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style14 {font-weight: bold}
-->
</style>
<table width="321" border="1">
  <tr>
    <td width="141"><div id="price"><?php // product title  ?>
  <div id="node">
    <h2><?php print $title ?></h2>
  </p>
  <p class="style13">Author:
      <span class="field-label style1"><strong><span class="field-item"><?php print $node->name  ?></span></strong></span> </p>
  <p class="style13">SKU: <span class="field-label style1"><strong><span class="field-item"><?php print $node->model ?></span></strong></span>
</p>
  <p class="style13">&nbsp;</p>
  <p>&nbsp;</p>
      <p>&nbsp;</p>
    </div></td>
    <td width="164"><p>Sell Price: <?php print uc_currency_format($node->sell_price); ?></p>
    <?php print $node->content['add_to_cart']["#value"]; ?>
    <p><?php print $node->field_download[0]['view'] ?> </p>
    <div class="field field-type-text field-field-version">
      <h3 class="field-label style1">Version</h3>
      <h3 class="field-label style1"><?php print $node->field_version[0]['view'] ?></h3>
      <div class="field-items">
        <p>&nbsp;</p>
        </div>
    </div></td>
  </tr>
  <tr>
    <td><p align="center"><img src="/files/imagecache/product/<?php print $imagePath; ?>" alt="Title"></p>
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div id="image">
      <div align="center">
        <p>&nbsp;</p>
        <ul class="other_imgs">
          <?php
          
// get all images
           
foreach ($node->field_image_cache as $images) {
       
?>

          <a href="/files/imagecache/product/<?php print $images['filepath']; ?>" class="thickbox title="<?php print $images['title']; ?>" rel="pagination"><img src=" /files/imagecache/uc_thumbnail/<?php print $images['filename']; ?>" alt="<?php print $images['alt']; ?>" hspace="0" border="0" class="styleimages"></a>
          <div align="center">
              <?php   
       
}
       
?>

             
            </p>
          </div>
        </ul>
        <p>&nbsp;</p>
      </div>
    </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><ul class="other_imgs">
      <div align="Left">
        <p><?php print $node->content['body']['#value'];  ?></p>
        <?php // product description  ?>
        <p class="field-items">&nbsp;        </p>
      </div>
    </ul></td>
    <td><p class="style1">&nbsp;</p>
      <div class="field field-type-text field-field-geometry">
        <h3 class="field-label style1">Preview Files:</h3>
        <p class="field-label style1"> <?php print $node->files[0] ?> </p>
      </div>
      <p>&nbsp;</p>
      <p class="style1">&nbsp; </p>
      <div class="field field-type-text field-field-keywords">
      <div class="field-items"></div>
    </div></td>
  </tr>
</table>
<p><span class="field-label style1"><?php print $node->content['add_to_cart']["#value"]; ?></span></p>
<p>&nbsp;</p>
<div class="field field-type-image field-field-image-cache"><div class="field-items"></div>
</div>

PreviewAttachmentSize
product template.jpgproduct template.jpg43.35 KB