View Single Post
  #14  
Old 03-01-2006, 04:40 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

Heres my version of this.... cleaned it up, added shipping cost and some tool tips with the full product name and shipping name if you hover over the items

Works fine in V4.0.17

Make a css style too as follows.

Code:
.MiniCartTextTiny { FONT-SIZE: 9px; }

Code:
{* $Id: minicart.tpl,v 1.12 2004/07/06 14:00:12 svowl Exp $ *} {if $minicart_total_items > 0} <table width="100%" border="0" cellpadding="1" cellspacing="0"> {foreach from=$minicart_contents item=item} <tr> <TD class="MiniCartTextTiny">{$item.amount} X</td> <TD class="MiniCartTextTiny"><a title="{$item.product}">{$item.product|truncate:15:"...":true}</a></td><td align="right" class="MiniCartTextTiny">{$item.display_subtotal}</td></tr> {/foreach} </table> <HR size="1" NOSHADE class="VertMenuHr"> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <TD class="MiniCartTextTiny"><a title="{$minicart_delivery}">Shipping Cost</a></td><td align="right" class="MiniCartTextTiny"><a title="{$minicart_delivery}">{$minicart_shipping}</a></td> </tr> </table> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <TD class="MiniCartTextTiny">{$lng.lbl_total}: </td> <td align="right" class="MiniCartTextTiny">{include file="currency.tpl" value=$minicart_total_cost}</td> </tr> </table> {else} {$lng.lbl_cart_is_empty} {/if} <hr size="1" noshade class="VertMenuHr">

heres the minicart.php file too

Code:
# # $Id: minicart.php,v 1.1.2.1 2005/01/12 07:41:43 svowl Exp $ # if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); } x_session_register ("cart"); $MINICART["total_cost"] = price_format(0); $MINICART["total_items"] = 0; if (!empty($cart)) { if (!empty($cart["total_cost"])) $MINICART["total_cost"] = $cart["total_cost"]; $MINICART["total_items"] = ((!empty($cart["products"]) and is_array($cart["products"]))?count($cart["products"]):0) + ((!empty($cart["giftcerts"]) and is_array($cart["giftcerts"]))?count($cart["giftcerts"]):0); } $smarty->assign("minicart_total_cost", $MINICART["total_cost"]); $smarty->assign("minicart_total_items", $MINICART["total_items"]); $smarty->assign("minicart_contents", $cart["products"]); //added this line $smarty->assign("minicart_shipping", $cart["shipping_cost"]); //added this line $smarty->assign("minicart_delivery", $cart["delivery"]); //added this line ?>
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote