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)

mac 04-29-2005 02:14 PM

descriptive minicart
 
We needed our minicart to display more information than it currently does. I couldn't find a mod to do it, so here is what I did.

Added a line to minicart.php:
Code:

...
$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
?>


Added a section to minicart.tpl:
Code:

...
{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}
<tr><td>Total</td><td></td><td align="right">{include file="currency.tpl" value=$minicart_total_cost}</td></tr>
</table>
{/if}
...


I didn't format the table much, so season to taste. The minicart now displays:

cartitem1___X2___5.00
cartitem2___X1___6.00
Total__________$11.00

IndieDepot 05-19-2005 08:23 PM

Great Mod...thanks.

- Shannon

junaid 06-20-2005 12:14 AM

thanks ..

2019 06-29-2005 01:41 AM

thnx 8)

donavichi 08-07-2005 12:37 PM

Brilliantly Simple mod.

Thanks very much!

thundernugs 02-04-2006 01:26 AM

nice work - this works great in 4.0.17 with some very minor formatting -

but, is there any way to

a) get the shipping cost to show up (like a product) to make the total make sense

or

b) have the subtotal show up in the minicart that does not include the shipping costs?

we use flat rate shipping so the cost is already known when items are added to the cart.

thanks!

2coolbaby 02-05-2006 11:45 AM

Can anyone give me the location of the minicart.tpl? I just can't find it.

wjbrewer 02-05-2006 11:54 AM

skin1/customer/main

2coolbaby 02-07-2006 10:13 AM

For some reason I have Total (with amount) showing up on the right side and the bottom and it is cramping the cart contents. I have looked at the code it doesn't look like that should be there so obviously I am missing something. Here is the code I have for in minicart.tpl:

<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}

{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}
<tr><td>Total</td><td></td><td align="right">{include file="currency.tpl" value=$minicart_total_cost}</td></tr>
</table>
{/if}
</TD>


4.0.17

thundernugs 02-07-2006 05:36 PM

looks like your table/cell tags may be a bit off, try this

Code:

<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}<CENTER>{$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>
<HR size="1" NOSHADE class="VertMenuHr">


this works for me in 4.0.17

mike


All times are GMT -8. The time now is 04:31 AM.

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