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

Improved minicart display

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 01-09-2007, 07:41 AM
 
jackel jackel is offline
 

Advanced Member
  
Join Date: May 2006
Location: United Kingdom
Posts: 48
 

Default Re: Improved minicart display

eq? not = ?
__________________
MarkH
Web Development Manager
Jackel International Limited
X-Cart Version 4.0.13 + Customisations
http://www.tommeetippee.co.uk/
Reply With Quote
  #32  
Old 01-09-2007, 08:49 AM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default Re: Improved minicart display

hmm, don't think that is it, b/c it is trying to declare a variable..

The line of code was taken directly from the first page - not sure why I am having issues with it.

*edit*

Fixed the problem - it was my Dreamweaver acting up. It didn't like the copy&paste, so I just edited through the admin side.

Thanks!

And now, trying to get the 'remove' function to not redirect you to the cart. I'm assuming this will need to be done the same way 'add to cart' is done.

...wish me luck!
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #33  
Old 01-13-2007, 03:06 AM
  newattraction's Avatar 
newattraction newattraction is offline
 

Member
  
Join Date: Oct 2006
Posts: 17
 

Smile Improved Descriptive Minicart Mod for v4.1.5

Improved Descriptive Minicart Mod for v4.1.5

1. Total price now calculated correctly (including shipping cost)
2. Move mouse pointer over a product link in minicart √ and the product title will appear
3. Original loaded and empty cart images/icons preserved
4. Modified and tested to work in v4.1.5

Step 1. Add the following css style code to the bottom of file \skin1\skin1.css:

Code:
/* Custom Descriptive Minicart Mod START - mycode */ .MiniCartTextTiny { FONT-SIZE: 9px; } /* Custom Descriptive Minicart Mod END - mycode */

Step 2. Replace \skin1\customer\main\minicart.tpl with the following code (based on original x-cart v4.1.5 tpl file):

Code:
{* $Id: minicart.tpl,v 1.17 2006/03/28 08:21:07 max Exp $ *} {if $minicart_total_items > 0} <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td rowspan="2" width="23"><a href="cart.php"><img src="{$ImagesDir}/cart_full.gif" width="19" height="16" alt="" /></a></td> <td class="VertMenuItems"><b>{$lng.lbl_cart_items}: </b></td> <td class="VertMenuItems">{$minicart_total_items}</td> </tr> </table> <hr size="1" NOSHADE class="VertMenuHr"> {foreach from=$minicart_contents item=item} <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td class="MiniCartTextTiny"><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.cartid`"{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="MiniCartTextTiny"><a title="{$minicart_delivery}">{$lng.lbl_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="ProductPriceSmall">{$lng.lbl_total}: </td> {* calculate grand total including shipping cost*} {math assign="grandtotal" equation="minicarttotalcost+minicartshipping" minicarttotalcost=$minicart_total_cost minicartshipping=$minicart_shipping} {* end of grand total calculation *} <td align="right" class="ProductPriceSmall">{include file="currency.tpl" value=$grandtotal}</td> </tr> </table> {else} <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td rowspan="2" width="23"><img src="{$ImagesDir}/cart_empty.gif" width="19" height="16" alt="" /></td> <td class="VertMenuItems" align="center"><b>{$lng.lbl_cart_is_empty}</b></td> </tr> <tr> <td class="VertMenuItems">&nbsp;</td> </tr> </table> {/if} <hr size="1" noshade class="VertMenuHr">

Please add a language variable $lng.lbl_remove = Remove from Admin backend.

Step 3. In file minicart.php, after:

Quote:
$smarty->assign("minicart_total_items", $MINICART["total_items"]);

Add:

Quote:
$smarty->assign("minicart_contents", $cart["products"]); //mycode
$smarty->assign("minicart_shipping", $cart["shipping_cost"]); //mycode
$smarty->assign("minicart_delivery", $cart["delivery"]); //mycode

Done!

Feel free to test drive at my website www.vonbell.com - add few items to cart and see how they will show up in mini cart.

Good luck!

Guosheng
www.vonbell.com
P.S. Attached: 2 screenshots (x-cart v4.1.5)
Attached Thumbnails
Click image for larger version

Name:	loaded_minicart.gif
Views:	357
Size:	11.8 KB
ID:	216  Click image for larger version

Name:	empty_minicart.gif
Views:	313
Size:	9.5 KB
ID:	217  
__________________
www.vonbell.com
xcart v4.1.6
Reply With Quote
  #34  
Old 01-17-2007, 11:49 AM
 
Jay77 Jay77 is offline
 

Member
  
Join Date: Dec 2006
Posts: 23
 

Default Re: Improved minicart display

Hi, Great mod.
My only problem (as i'm new) is I cant work out the language variables. I have found out that I need to click Labguages > then select English but where do I go from there ? - its working great except for the remove function - assuming its the language variable bit.
Thanks.
__________________
Version 4.1.6
Reply With Quote
  #35  
Old 01-18-2007, 05:52 AM
  newattraction's Avatar 
newattraction newattraction is offline
 

Member
  
Join Date: Oct 2006
Posts: 17
 

Smile Re: Improved minicart display

Scroll down to the bottom of "Edit languages" section, in "Add new entry" section, type "lbl_remove" in "Variable:" field, and "Remove" in "Default editor" field. Then hit "Add" button.


Please see the attached screen shot.


Good luck!


Guosheng
www.vonbell.com
Attached Thumbnails
Click image for larger version

Name:	lbl_remove.gif
Views:	203
Size:	9.5 KB
ID:	222  
__________________
www.vonbell.com
xcart v4.1.6
Reply With Quote
  #36  
Old 01-18-2007, 10:59 AM
 
Jay77 Jay77 is offline
 

Member
  
Join Date: Dec 2006
Posts: 23
 

Default Re: Improved minicart display

Hi, Thanks - I tried your suggestion but I still can't get it to work. Please take a look at my screenshots. Maybe does'nt work with my version ?. Hope you can help ?
Attached Thumbnails
Click image for larger version

Name:	lblremove.jpg
Views:	127
Size:	12.2 KB
ID:	223  Click image for larger version

Name:	cart.jpg
Views:	192
Size:	9.8 KB
ID:	224  
__________________
Version 4.1.6
Reply With Quote
  #37  
Old 01-25-2007, 05:01 AM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default Re: Improved minicart display

I was having the same problem with the "Remove" link not showing when using the above 4.1.5v code.

you'd find the lines in the above code where the remove link appears and replace it with mac's original code.
__________________
X-Cart Gold 4.4.3
--------------------------------------
Reply With Quote
  #38  
Old 01-26-2007, 07:08 AM
 
Shaun Shaun is offline
 

Senior Member
  
Join Date: Sep 2005
Location: Michigan, USA
Posts: 176
 

Default Re: Improved minicart display

Thanks, this is a nice mod. I have it working well on 4.0.15, I've just made a few tweaks to the layout thats all.

http://www.streetortrack.com/files/images/minicart.jpg

Code:
{* $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:50:"...":true}</a> </b></tr></td></table> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td align=left> {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}">Remove</a> {else} <A href="cart.php?mode=delete&productindex=`$item.cartid`"{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 align=right>{include file="currency.tpl" value=$item.display_subtotal} </td></tr> </td> </table> <HR size="1" NOSHADE class="VertMenuHr"> {/foreach} <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <TD class="ProductDetailsTitle">Shipping Cost:</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> Displayed when logged in <p> <td align="right" class="MiniCartTextSmall">{include file="currency.tpl" value=$minicart_total_cost}</td> </tr> </table> Includes tax for MI residents only {else} {$lng.lbl_cart_is_empty} {/if} <hr size="1" noshade class="VertMenuHr">

Anybody figure out how to stop the 'Remove' button directing you to the cart? As others have mentioned in this thread it would be great if by clicking 'Remove' it kept you on your current page and just removed the item from the minicart.
__________________
X-Cart 5.4.1.19
Live site - www.streetortrack.com
Reply With Quote
  #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
  #40  
Old 01-26-2007, 10:42 PM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default Re: Improved minicart display

the shipping was calculating incorrectly for me to...it was doubling it.

replace:
Code:
<table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td class="ProductPriceSmall">{$lng.lbl_total}: </td> {* calculate grand total including shipping cost*} {math assign="grandtotal" equation="minicarttotalcost+minicartshipping" minicarttotalcost=$minicart_total_cost minicartshipping=$minicart_shipping} {* end of grand total calculation *} <td align="right" class="ProductPriceSmall">{include file="currency.tpl" value=$grandtotal}</td> </tr> </table>

with
Code:
<table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td class="ProductPriceSmall">{$lng.lbl_total}: </td> {* calculate grand total including shipping cost*} {math assign="grandtotal" equation="minicarttotalcost" minicarttotalcost=$minicart_total_cost minicartshipping=$minicart_shipping} {* end of grand total calculation *} <td align="right" class="ProductPriceSmall">{include file="currency.tpl" value=$grandtotal}</td> </tr> </table>

i couldnt figure out how to code it right but in general, you don't need the equation per se b/c "minicarttotalcost" already includes shipping
__________________
X-Cart Gold 4.4.3
--------------------------------------
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 06:23 PM.

   

 
X-Cart forums © 2001-2020