View Single Post
  #39  
Old 01-26-2007, 07:17 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Smile Re: Improved minicart display

Thanks for the great mod for minicart. After working through a few snags I got it working.

Comments:

I added language variables to keep the minicart multilingual.

I found that /minicart.php needed to be editted directly through my hostings admin panel files administration to work.
Editting through DW made my cart wipe out. In the same vein, /minicart.tpl needed editting through xcart admin panel.

I could not find the exact text in /menu_cart.tpl, to comment out. So I boldly removed the code calling for the repeat view cart and checkout links. Worked.

Here's my modified code with the language variables for anyone with multilingual carts. Works with 4.0.19

{* $Id: minicart.tpl,v 1.12 2004/07/06 14:00:12 svowl Exp $ *}

{if $minicart_total_items > 0}

{foreach from=$minicart_contents item=item}
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr><TD class="MiniCartTextSmall"><b>{$item.amount} X
<a href="product.php?productid={ $item.productid }" title="{$item.product}">{$item.product|truncate:17 :"...":true}</a>
</b></tr></td></table>
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr><td>
{include file="currency.tpl" value=$item.display_subtotal}
</td><td align=right>

{if $config.Adaptives.platform eq 'MacPPC' && $config.Adaptives.browser eq 'NN'}{assign var="js_to_href" value="Y"}{/if}
{if $type eq 'input'}{assign var="img_type" value='INPUT type="image" class="blank"'}{else}{assign var="img_type" value='IMG'}{/if}
{assign var="js_link" value=$href|regex_replace:"/^\s*javascript\s*:/Si":""}
{if $js_link eq $href}{assign var="js_link" value="javascript: self.location='cart.php?mode=delete&productindex=` $item.cartid`'"}
{else}{assign var="js_link" value=$href}{if $js_to_href ne 'Y'}{assign var="onclick" value=$href}{assign var="href" value="javascript: void(0);"}{/if}{/if}
{if ($config.Adaptives.platform ne 'MacPPC' || $config.Adaptives.browser ne 'NN')}<a href="{$js_link}">{$lng.lbl_remove}</a>
{else}
<A href="cart.php?mode=delete&productindex=`$item.car tid`"{if $onclick ne ''} onclick="{$onclick}"{/if}{if $title ne ''} title="{$title}"{/if}{if $target ne ''} target="{$target}"{/if}><FONT class="FormButton">{$button_title} </FONT></A>
{/if}

</td></tr></table>

<HR size="1" NOSHADE class="VertMenuHr">
{/foreach}

<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<TD class="ProductDetailsTitle">{$lng.lbl_shipping}</td><td align="right" class="MiniCartTextSmall">{include file="currency.tpl" value=$minicart_shipping}</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<TD class="ProductDetailsTitle">{$lng.lbl_total}: </td>
<td align="right" class="MiniCartTextSmall">{include file="currency.tpl" value=$minicart_total_cost}</td>
</tr>
</table>
{else}
{$lng.lbl_cart_is_empty}
{/if}
<hr size="1" noshade class="VertMenuHr">

<A href="cart.php" class="VertMenuItems">{$lng.lbl_view_cart}</A><BR>
<A href="cart.php?mode=checkout" class="VertMenuItems">{$lng.lbl_checkout}</A><BR>


These are the labels I added:

{$lng.lbl_remove}
{$lng.lbl_shipping}

Happy modding!
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
Reply With Quote