Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

descriptive minicart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-29-2005, 02:14 PM
 
mac mac is offline
 

Newbie
  
Join Date: Apr 2005
Posts: 2
 

Default 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
__________________
Evidence Media
x-cart 4.1.3
Reply With Quote
  #2  
Old 05-19-2005, 08:23 PM
 
IndieDepot IndieDepot is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 30
 

Default

Great Mod...thanks.

- Shannon
__________________
- www.TheShotList.com
X-Cart version 4.0.13
PHP 4.3.10
MySQL 4.0.23
Web server Apache
Operation system Linux
Perl 5.008004
XML parser (expat) 1.95.6
Reply With Quote
  #3  
Old 06-20-2005, 12:14 AM
 
junaid junaid is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 96
 

Default

thanks ..
__________________
xcart 4.18 on linux
Reply With Quote
  #4  
Old 06-29-2005, 01:41 AM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

thnx
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
  #5  
Old 08-07-2005, 12:37 PM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

Brilliantly Simple mod.

Thanks very much!
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #6  
Old 02-04-2006, 01:26 AM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default

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!
__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
  #7  
Old 02-05-2006, 11:45 AM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default

Can anyone give me the location of the minicart.tpl? I just can't find it.
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #8  
Old 02-05-2006, 11:54 AM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default

skin1/customer/main
Reply With Quote
  #9  
Old 02-07-2006, 10:13 AM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default

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
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #10  
Old 02-07-2006, 05:36 PM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default

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
__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:46 PM.

   

 
X-Cart forums © 2001-2020