Location: PHPKode > projects > Simple PHP Shopping cart - asaancart > asaancart v-0.9/templates/shop/pages/product.tpl
<form method="get" action="cart.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">  
  <tr>
    <td valign="top">
    <img src="images/spacer.gif" height="1" width="700">
    {section name=productData loop=$productData}
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="340" valign="top">
          <div id="product_image_box">

<!-- image framw -->
{section name=productDataImages loop=$productDataImages}
            {if $imgCnt==0}
            <a href="javascript:openImageViewer('{$productDataImages[productDataImages].image_filename}','{$product_id}','{$productData[productData].product_name}');"><img src="../product_images/{$productDataImages[productDataImages].image_filename}" width="300" id="main_product_image" border="0"/></a><input type="hidden" id="product_image_name" value="{$productDataImages[productDataImages].image_filename}" />
            {php}$this->assign('imgCnt',1);{/php}
            {/if}
{/section}
<br />
{section name=productDataImages loop=$productDataImages}
            <a href="#" onClick="changeProductImage('{$productDataImages[productDataImages].image_filename}')"><img src="../product_images/{$productDataImages[productDataImages].image_filename}" border="0" width="60" /></a>
{/section}
</div>
</td>
        <td align="left" valign="top">        
{section name=allBrands loop=$allBrands}
{if $allBrands[allBrands].brand_id == $productData[productData].brand_id}
<img src="../brand_images/{$allBrands[allBrands].brand_logo}" title="{$allBrands[allBrands].brand_name}" width="70" /><br />{/if}
{/section}
<h2>{$productData[productData].product_name}</h2>
<span style="font-size:20px; color:#666666; font-weight:bold;">{if $productData[productData].product_deal_price>0}AU ${$productData[productData].product_deal_price}{else}AU ${$productData[productData].product_price}{/if}</span>
<h3>Overview</h3>
<p>{$productData[productData].product_description}</p>
<br />
<h3>Features</h3>
<p>{$productData[productData].product_overview}</p>
<br />
{section name=productAttributes loop=$productAttributes}
{if $productAttributes[productAttributes].product_id == $productData[productData].product_id}
<br />{$productAttributes[productAttributes].attribute_name}: {$productAttributes[productAttributes].attribute_value}
{/if}
{/section}

<h3>Price</h3>
{if $productData[productData].product_deal_price>0}
Was: <span style="text-decoration:line-through">AU ${$productData[productData].product_price}</span><br />
Now: <span style="text-decoration:none; font-weight:bold;">AU ${$productData[productData].product_deal_price}</span><br />
Save: <span style="text-decoration:none; font-weight:bold; color:red;">AU ${$productData[productData].product_price-$productData[productData].product_deal_price|string_format:"%.2f"}</span>
    {else}
        AU$ {$productData[productData].product_price}<br />
        <span class="gst">incl GST</span>
    {/if}

{if $productData[productData].is_new=="yes"}{php}$this->assign('productTag','New Arrival'); $this->assign('productTagStyle','new_arrival');{/php}{/if}
    {if $productData[productData].is_special=="yes"}{php}$this->assign('productTag','Special Item'); $this->assign('productTagStyle','on_special');{/php}{/if}
    {if $productData[productData].is_clearence=="yes"}{php}$this->assign('productTag','Clearence Item'); $this->assign('productTagStyle','clearence_item');{/php}{/if}    
    <div style="padding-top:5px;"></div><span class="{$productTagStyle}">{$productTag}</span>
    {php}$this->assign('productTag',''); $this->assign('productTagStyle','');{/php}

<br />
<br />
Please enter quantity: <input type="text" name="qty_entered" id="qty_entered" value="1" size="5" />
<br />
<br />

<div style="background-color:#f3f3f3; padding:7px;">
{section name=productVariantGroups loop=$productVariantGroups}
        
        <h3>{$productVariantGroups[productVariantGroups].group_name}</h3>
        <select name="selected_product_variant_{$productVariantGroups[productVariantGroups].variant_group_id}">
        	{section name=productVariants loop=$productVariants}
            {if $productVariantGroups[productVariantGroups].variant_group_id==$productVariants[productVariants].variant_group_id}
            	{if $productVariants[productVariants].qty>0}<option value="{$productVariants[productVariants].id}">{$productVariants[productVariants].variant_name}&nbsp;&nbsp;{if $productVariants[productVariants].surcharge>0}(${$productVariants[productVariants].surcharge} surcharge){/if}</option>{/if}
            {/if}
            {/section}
        </select>
        
<br />
           	{section name=productVariants loop=$productVariants}
            {if $productVariantGroups[productVariantGroups].variant_group_id==$productVariants[productVariants].variant_group_id}
            	{if $productVariants[productVariants].qty==0}<div style="color:red;">{$productVariants[productVariants].variant_name} is out of stock</div>{/if}
            {/if}
        {/section}
    {/section}

</div>

<h3>Live Stock Chart</h3>
{if $stock_options=="no_stock_level"}
<strong>Availability:</strong> {$availability}
<br /> 
{/if}

{if $stock_options=="product_based_stock_level"}
    {if $totalProductQty!=0}
    <strong>Total in stock:</strong> {$totalProductQty}
    {else}
    <span style="color:red; font-weight:bold;">Out of Stock</span>
    {/if}<br />
    <br /><br />
<br />

    <img src="http://chart.apis.google.com/chart?chs=250x20&chbh=10&cht=bhs&chco=66CC33&chm=t {$totalProductQty},000000,0,-1,11&chd=t:{$totalProductQty}&chds=0,300" alt="11" />

{/if}

{if $stock_options=="variant_based_stock_level"}
{if $stock_variant_group_id!=-1} 
	{section name=productVariantGroups loop=$productVariantGroups}
        {if $productVariantGroups[productVariantGroups].variant_group_id==$stock_variant_group_id}
        	{section name=productVariants loop=$productVariants}
            {if $productVariantGroups[productVariantGroups].variant_group_id==$productVariants[productVariants].variant_group_id}
            	<div style="width:70px; float:left;">{$productVariants[productVariants].variant_name}</div><div style="width:260px; float:left;"> <img src="http://chart.apis.google.com/chart?chs=250x20&chbh=10&cht=bhs&chco=66CC33&chm=t {$productVariants[productVariants].qty},000000,0,-1,11&chd=t:{$productVariants[productVariants].qty}&chds=0,{$totalProductQty}" alt="{$productVariants[productVariants].variant_name}, total quantity - {$productVariants[productVariants].qty}" title="{$productVariants[productVariants].qty}" /></div><div style="clear:both;"></div>
            {/if}
            {/section}
        {/if}
    {/section}
 {/if}   
{/if}
<br />
<br />
<br />



<input type="hidden" name="product_id" value="{$productData[productData].product_id}" />
<input type="hidden" name="product_name" value="{$productData[productData].product_name}" />
<input type="hidden" name="mode" value="add" />
<input type="image" src="images/btns/add_to_cart_btn.gif" />
<br />
<br />
</td>
      </tr>
    </table>
    {/section}</td>
</tr>
  <tr>
    <td valign="top">
    {if $totalRelatedProducts>0}
    <div id="section_heading">You might also be interested in ...</div>
    {section name=relatedProducts loop=$relatedProducts}
    <div id="product_info_box" align="left">
		<div id="inner_pro_info_box">
            <div>
            {section name=productMainImage loop=$productMainImage}
            {if $productMainImage[productMainImage].product_id == $relatedProducts[relatedProducts].product_id}
            <a href="product.php?product_id={$relatedProducts[relatedProducts].product_id}&product_name={$relatedProducts[relatedProducts].product_name}"><img src="../product_images/{$productMainImage[productMainImage].image_filename}" width="150" height="150" border="0" alt="{$relatedProducts[relatedProducts].product_name}" title="{$relatedProducts[relatedProducts].product_name}"/></a><br />
<br />{/if}
            {/section}
          </div>
			<div><a href="product.php?product_id={$relatedProducts[relatedProducts].product_id}&product_name={$relatedProducts[relatedProducts].product_name}">{$relatedProducts[relatedProducts].product_name|truncate:60:"..."}</a><br /><br /></div>
            <div class="price_text">
            {if $relatedProducts[relatedProducts].product_deal_price>0}
                Was: <span style="text-decoration:line-through">AU ${$relatedProducts[relatedProducts].product_price}</span><br />
                Now: <span style="text-decoration:none; font-weight:bold;">AU ${$relatedProducts[relatedProducts].product_deal_price}</span><br />
                Save: <span style="text-decoration:none; font-weight:bold; color:red;">AU ${$relatedProducts[relatedProducts].product_price-$relatedProducts[relatedProducts].product_deal_price|string_format:"%.2f"}</span>
            {else}
                AU$ {$relatedProducts[relatedProducts].product_price}<br />
                <span class="gst">incl GST</span>
            {/if}
            <br /><br />
                {if $relatedProducts[relatedProducts].is_new=="yes"}{php}$this->assign('productTag','New Arrival'); $this->assign('productTagStyle','new_arrival');{/php}{/if}
        {if $relatedProducts[relatedProducts].is_special=="yes"}{php}$this->assign('productTag','Special Item'); $this->assign('productTagStyle','on_special');{/php}{/if}
        {if $relatedProducts[relatedProducts].is_clearence=="yes"}{php}$this->assign('productTag','Clearence Item'); $this->assign('productTagStyle','clearence_item');{/php}{/if}    
        <div style="padding-top:5px;"></div><span class="{$productTagStyle}">{$productTag}</span>
        {php}$this->assign('productTag',''); $this->assign('productTagStyle','');{/php}
            </div>
        </div>
    </div>
    {/section}
    {/if}
<div style="clear:both; padding:7px;"></div>
    </td>
  </tr>
</table>
</form>
Return current item: Simple PHP Shopping cart - asaancart