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
  #11  
Old 02-07-2006, 06:24 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

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

Default

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.
__________________
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
  #12  
Old 02-13-2006, 10:50 AM
 
junaid junaid is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 96
 

Default

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
__________________
xcart 4.18 on linux
Reply With Quote
  #13  
Old 02-13-2006, 10:59 AM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

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

Default

just what i was looking for

works smoothly in 4.0.17

nice work junaid!
__________________
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
  #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
  #15  
Old 03-09-2006, 08:27 AM
 
billstevens billstevens is offline
 

Member
  
Join Date: Oct 2004
Posts: 26
 

Default Thanks!

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

-Bill
__________________
Bill
X-Cart 4.1.9
Reply With Quote
  #16  
Old 03-09-2006, 07:09 PM
 
Total Hosting Total Hosting is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 52
 

Default

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.
__________________
Regards,

Peter Stoermer
http://www.TotalHosting.com for http://www.EmpowermentGroup.com
X-cart: 4.0.17
Reply With Quote
  #17  
Old 03-10-2006, 03:49 AM
  shan's Avatar 
shan shan is offline
 

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

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #18  
Old 03-10-2006, 02:28 PM
 
Total Hosting Total Hosting is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 52
 

Default

Thanks!

Works like a charm.
__________________
Regards,

Peter Stoermer
http://www.TotalHosting.com for http://www.EmpowermentGroup.com
X-cart: 4.0.17
Reply With Quote
  #19  
Old 03-18-2006, 01:35 AM
 
qantixrob qantixrob is offline
 

Member
  
Join Date: Dec 2005
Posts: 22
 

Default 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 !!!
__________________
Rob - www.eyewearsystems.co.uk
v4.0.16 [UNIX]
England
Reply With Quote
  #20  
Old 05-31-2006, 07:09 PM
 
taltos1 taltos1 is offline
 

Senior Member
  
Join Date: Mar 2005
Location: USA
Posts: 160
 

Default

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!
__________________
X-Cart Gold Version 4.0.18
EWDHosting.com is my Host
Unix Servers
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:10 AM.

   

 
X-Cart forums © 2001-2020