X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   descriptive minicart (https://forum.x-cart.com/showthread.php?t=13723)

2coolbaby 02-07-2006 06:24 PM

Actually that wasn't right. What we are trying to do is add actual cart product details into the minicart. Your code took that out. I figured out what to do. Here is how I coded minicart.tpl:

After the first line replace the rest of the code with this:

Quote:

<TABLE border="0" cellpadding="1" cellspacing="0">
<TR>
<TD rowspan="2" width="23">
{if $minicart_total_items > 0}[img]{$ImagesDir}/cart_full.gif[/img]{else}[img]{$ImagesDir}/cart_empty.gif[/img]{/if}
</TD>
<TD class="VertMenuItems">{if $minicart_total_items > 0}{$lng.lbl_items}: </TD>
<TD class="VertMenuItems" color="#0000ff">{$minicart_total_items}{else}<CENT ER>{$lng.lbl_cart_is_empty}</CENTER>{/if}</TD>
</TR>
<TR>
<TD class="VertMenuItems">{if $minicart_total_items > 0}{$lng.lbl_total}: </TD>
<TD class="VertMenuItems">{include file="currency.tpl" value=$minicart_total_cost}{/if}</TD>
</TR>
</TABLE>
{if $minicart_total_items > 0}
<table width="100%">
{foreach from=$minicart_contents item=item}
<tr><td>{$item.product|truncate:18:"...":true}</td><td>X {$item.amount}</td><td align="right">{$item.display_subtotal}</td></tr>
{/foreach}
</table>
{/if}
<HR size="1" NOSHADE class="VertMenuHr">

Be sire to add the the line to the minicart.php as stated in the original post.

junaid 02-13-2006 10:50 AM

okay to show amount in minicart without shipping edit minicart.php on around line 93

before:
$MINICART["total_cost"] = $cart["total_cost"];

change to:
$MINICART["total_cost"] = $cart["display_subtotal"];

i hope it helps, it for version 4.016
regards
Junaid

thundernugs 02-13-2006 10:59 AM

just what i was looking for

works smoothly in 4.0.17

nice work junaid! =D>

shan 03-01-2006 04:40 AM

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

?>


billstevens 03-09-2006 08:27 AM

Thanks!
 
Thanks for the update to this Mod it's working great. 4.017

-Bill

Total Hosting 03-09-2006 07:09 PM

Works great! Thanks.

Quick question though. I don't see the tool tips in the code.

Did you use overlib or something else?

Care to reveal?

Thanks again.

shan 03-10-2006 03:49 AM

Quote:

Originally Posted by Total Hosting
Works great! Thanks.

Quick question though. I don't see the tool tips in the code.

Did you use overlib or something else?

Care to reveal?

Thanks again.


I updated my post to show the tooltips too, they were missing, and changed a few other things too

Total Hosting 03-10-2006 02:28 PM

Thanks!

Works like a charm.

qantixrob 03-18-2006 01:35 AM

Thanks from me too!
 
Absolutely awesome mod !

Just a word of warning: remember to download your css file so you are working on the latest version of it not the original ! (and presumably if you re-skin you will need to update it again ?)

Anyway if you want to see it in action on a 2-column layout have a look at:

http://www.eyewearsystems.co.uk/xcart/home.php

Many thanks again !!!

taltos1 05-31-2006 07:09 PM

Quote:

Originally Posted by shan
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



............
I just did this and it is awesome, however, I would like to make it so that when a user clicks on the product name, it takes them to that products page?
Is this possible?

Thx!


All times are GMT -8. The time now is 08:30 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.