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
  #41  
Old 01-27-2007, 04:23 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Default Re: Improved minicart display

Heh, I don't see the code you're speaking of in the code for minicart.tpl as I have shown above.

Also, my shipping calculates fine. I have shipping based on weight.
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
Reply With Quote
  #42  
Old 01-27-2007, 08:53 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Default Re: Improved minicart display

I found it disconcerting that the customer saw a total greater than the sum of its parts in the minicart since the total included taxes (IVA). I have now added a line for taxes to be displayed in minicart. Now the grand total adds up.

Here's the modified code:
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} <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 class="MiniCartTextSmall" 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="MiniCartTextSmall">{$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"> {if $cart.taxes and $config.Taxes.display_taxed_order_totals ne "Y"} {foreach key=tax_name item=tax from=$cart.taxes} <TR> <TD class="MiniCartTextSmall">{$tax.tax_display_name}{if $tax.rate_type eq "%"} {$tax.rate_value}%{/if}:</TD> <TD><IMG src="{$ImagesDir}/null.gif" width="5" height="1" alt=""><BR></TD> <TD class="MiniCartTextSmall" align="right">{if $login ne "" or $config.General.apply_default_country eq "Y"}{include file="currency.tpl" value=$tax.tax_cost}</TD> <TD>{/if} </TR> {/foreach} {/if} </table> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <TD class="MiniCartTextSmall">{$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>
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
Reply With Quote
  #43  
Old 01-27-2007, 01:18 PM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default Re: Improved minicart display

Quote:
Originally Posted by just_me
Heh, I don't see the code you're speaking of in the code for minicart.tpl as I have shown above.

Also, my shipping calculates fine. I have shipping based on weight.


it might be your version. the code calculates the total plus shipping and in my version, the total already includes shipping. some of the people in the previous posts were having the same issue with the price in the minicart not being the same as the "true" price. so if you adjust the code as i suggested previously, it will calculate correctly.

the only problem i have now is that it's not calculating x-special offers discounts
__________________
X-Cart Gold 4.4.3
--------------------------------------
Reply With Quote
  #44  
Old 01-28-2007, 11:45 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Default Re: Improved minicart display

Okay. guess my version doesn't have that code. It's amazing how there is always something that could be added to this.

Now I would like the customer to stay on the same page after removing soemthing fromnthe cart. I have looked through the thread and found others asking the same but no answers.

Help would be appreciated.
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
Reply With Quote
  #45  
Old 02-13-2007, 04:14 AM
 
herseyc herseyc is offline
 

Member
  
Join Date: Jun 2006
Location: Suffolk, VA
Posts: 28
 

Default Re: Improved minicart display

Great mod.

Got it working in 4.1.3 with no problems using the code here: http://forum.x-cart.com/showpost.php?p=144767&postcount=15

Thanks alot.

Take Care - Ride FREE
__________________
Hersey
http://www.chopperstickers.com/
X-Cart 4.1.3
Linux
Reply With Quote
  #46  
Old 03-09-2007, 06:00 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default Re: Improved minicart display

I dont get how the system knows to load minicart.tpl cause I dont see if referenced anywhere in minicart.php ??

Anyone?
__________________
Xcart 4.0.19
Reply With Quote
  #47  
Old 03-09-2007, 10:38 PM
  newattraction's Avatar 
newattraction newattraction is offline
 

Member
  
Join Date: Oct 2006
Posts: 17
 

Thumbs up Re: Improved minicart display

Hi pdheady:

Here's the programming logic flow chat for php files:

home.php ----- contains ----- require ".auth.php";
auth.php ----- contains ----- include $xcart_dir.DIR_CUSTOMER."/minicart.php";
So, minicart.php is included in home.php

Output from home.php is displayed through home.tpl. Connections between home.php and home.tpl can be found here:
func_display("customer/home.tpl",$smarty); (last line in home.php)

Here's the programming logic flow chat for tpl files:

/skin1/customer/home.tpl ----- contains ----- {include file="customer/menu_cart.tpl" }
/skin1/customer/menu_cart.tpl ----- contains ----- {include file="customer/main/minicart.tpl" }
So, minicart.tpl is included in home.tpl, which of course will show up as part of home.tpl output.

I hope this is helpful.

Guosheng
__________________
www.vonbell.com
xcart v4.1.6
Reply With Quote
  #48  
Old 03-09-2007, 11:03 PM
  newattraction's Avatar 
newattraction newattraction is offline
 

Member
  
Join Date: Oct 2006
Posts: 17
 

Thumbs up Re: Improved minicart display

Actually, auth.php is included in many other php files, such as product.php (for displaying product details), so that when a file such as product.php is called, it will also display minicart on the same page.


Let's use product.php as another example. The following two lines can be found in file product.php:

require "./auth.php";

and

func_display("customer/home.tpl",smarty);

So, whenever a product details page is shown, minicart will appear also.

I'm sure you can find other php files/examples which include auth.php and display through home.tpl, and therefore minicart will show up along with output from home.tpl.

Happy code tracking!

Guosheng
__________________
www.vonbell.com
xcart v4.1.6
Reply With Quote
  #49  
Old 03-14-2007, 08:00 AM
 
fanta fanta is offline
 

Newbie
  
Join Date: Sep 2004
Posts: 5
 

Default Re: Improved minicart display

Is this minicart personalization compatible with LiteCommerce 2.2?
Thank you
Gianni
__________________
xcart v3.5.11 (linux) (mac)
litecom v2.2.21 (linux) (mac)
Reply With Quote
  #50  
Old 03-14-2007, 08:53 AM
  newattraction's Avatar 
newattraction newattraction is offline
 

Member
  
Join Date: Oct 2006
Posts: 17
 

Default Re: Improved minicart display

Most likely it's not compatible with LiteCommerce 2.2.
__________________
www.vonbell.com
xcart v4.1.6
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 03:23 PM.

   

 
X-Cart forums © 2001-2020