Re: Improved minicart display
This is the 4.1.3 version for the cart.
You do not need to edit the skin1.css or any language files.
Below is a picture of the cart and the lines in bold are the extra lines added to the original x-cart 4.1.3 tpl file.
At shopcart/skin1/customer/main/minicart.tpl
{* $Id: minicart.tpl,v 1.17 2006/03/28 08:21:07 max Exp $ *}
{if $short_mode eq "short"} {* Crystal_Blue *}
<table cellpadding="0" cellspacing="3">
<tr>
<td>{if $minicart_total_items > 0}<a href="cart.php"><img src="{$ImagesDir}/custom/cart_top_full.gif" width="19" height="16" alt="" /></a>{else}<img src="{$ImagesDir}/custom/cart_top_empty.gif" width="19" height="16" alt="" />{/if}
</td>
<td nowrap="nowrap"><a href="cart.php" class="MainSubtitleLink">{$lng.lbl_view_cart}</a></td>
</tr>
<tr>
<td colspan="2"><img src="{$ImagesDir}/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
<tr>
<td><a href="cart.php?mode=checkout"><img src="{$ImagesDir}/custom/checkout_arr.gif" width="16" height="14" alt="" align="middle" /></a></td>
<td nowrap="nowrap"><a href="cart.php?mode=checkout" class="MainSubtitleLink">{$lng.lbl_checkout}</a></td>
</tr>
</table>
{else} {* Crystal_Blue *}
<table cellpadding="1" cellspacing="0">
{if $minicart_total_items > 0}
<tr>
<td rowspan="3" width="23"><a href="cart.php"><img src="{$ImagesDir}/cart_full.gif" width="19" height="16" alt="" /></a></td>
<td class="VertMenuItems"><b>{$lng.lbl_cart_items}: </b></td>
<td class="VertMenuItems">{$minicart_total_items}</td>
</tr>
{* START - ADDED SHIPPING AMOUNT TO CART *}
<tr>
<td class="VertMenuItems"><b>{$lng.lbl_shipping}: </b></td>
<td class="VertMenuItems">{include file="currency.tpl" value=$minicart_shipping}</td>
</tr>
{* END - ADDED SHIPPING AMOUNT TO CART *}
<tr>
<td class="VertMenuItems"><b>{$lng.lbl_total}: </b></td>
<td class="VertMenuItems">{include file="currency.tpl" value=$minicart_total_cost}</td>
</tr>
{else}
<tr>
<td width="23"><img src="{$ImagesDir}/cart_empty.gif" width="19" height="16" alt="" /></td>
<td class="VertMenuItems" align="center"><b>{$lng.lbl_cart_is_empty}</b></td>
</tr>
{/if}
</table>
<hr class="VertMenuHr" size="1" />
{* START - DISPLAY PRODUCT DESCRIPTION *}
<table cellpadding="1" cellspacing="0">
{if $minicart_total_items > 0}
{foreach from=$minicart_contents item=item}
<tr>
<td class="MainSubtitleLink">{$item.amount} X</td>
<td class="MainSubtitleLink"><a title="{$item.product}">{$item.product|truncate:15 :"...":true}</a></td>
<td align="right" class="MainSubtitleLink">{include file="currency.tpl" value=$item.display_subtotal}</td></tr>
{/foreach}
{else}
<div align="center"><a href="home.php?cat=268" class="MainSubtitleLink">Please Click HERE for SPECIAL OFFERS</a></div>
{/if}
</table>
{* END - DISPLAY PRODUCT DESCRIPTION *}
<hr class="VertMenuHr" size="1" />
{/if} {* Crystal_Blue *}
And of cause the shopcart/minicart.php
Add at the bottom:
$smarty->assign("minicart_contents", $cart["products"]); //added this line
$smarty->assign("minicart_shipping", $cart["shipping_cost"]); //added this line
?>
|