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
  #21  
Old 10-02-2006, 06:19 PM
 
MichelleT MichelleT is offline
 

Member
  
Join Date: Jul 2006
Posts: 10
 

Default Re: descriptive minicart

Thanks, mac, and thanks, shan, for the updated code. Would it be possible to make the mod show shipping cost as "n/a" if the user hasn't yet logged in or registered? How would I go about doing this?
__________________
XCart 4.1.10
Reply With Quote
  #22  
Old 10-16-2006, 01:44 PM
  jasonroy's Avatar 
jasonroy jasonroy is offline
 

Senior Member
  
Join Date: Sep 2006
Location: Tualatin, Oregon
Posts: 147
 

Default Re: descriptive minicart

I am having a problem with mine.

Everything looks cool, except it will not display shipping...UNTIL I click view cart, and go back, then it displays.

you can see it in action at www.rjroffroad.com

any ideas on how to fix? or maybe its just my computer

http://www.rjroffroad.com/images/cartshot.jpg
__________________
rjroffroad.com
x-cart 4.1.3
+ez checkout
+remember anonymous carts
Reply With Quote
  #23  
Old 10-18-2006, 11:10 AM
  jasonroy's Avatar 
jasonroy jasonroy is offline
 

Senior Member
  
Join Date: Sep 2006
Location: Tualatin, Oregon
Posts: 147
 

Default Re: descriptive minicart

I figured out that my problem is in the way my store calculates shipping.

90% of my items calculate shipping based on a percentage of the item. Those items do not display a shipping cost until I view the cart and then go back

The other 10% are set at a flat shipping cost in the product options. These items display in the minicart just fine right away.

Any idea how to fix this?
__________________
rjroffroad.com
x-cart 4.1.3
+ez checkout
+remember anonymous carts
Reply With Quote
  #24  
Old 11-13-2006, 07:09 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default Re: descriptive minicart

There's some really great work in this thread!! Thanks.

Another tweak to this minicart:

http://www.greatamericantoystore.com/minicart.gif

I got rid of the "Product X Qty Price" format , and went with a columnar format to clean it up a little. Also added the shipping and total tweaks. Finally, I bolded the shipping cost and Total in the css.

Make sure you add these lines to minicart.php (thanks Shan!):

Code:
$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 ?>

Make sure you add the class to your .css

Code:
.MiniCartTextSmall { FONT-SIZE: 10px;font-weight:bold }

Finally, change your customer/main/minicart.tpl to:

Code:
{* $Id: minicart.tpl,v 1.12 2004/07/06 14:00:12 svowl Exp $ *} <TABLE border="0" cellpadding="1" cellspacing="0"> <TR> <TD rowspan="2" width="23"> {if $minicart_total_items > 0}<img border="0" src="{$ImagesDir}/cart_full.gif" width="19" height="16"> {else}<img border="0" src="{$ImagesDir}/cart_empty.gif" width="19" height="16">{/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%" id="table1"> <tr><td width="65%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Item</b></td> <td style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Qty</b></td> <td align="right" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Price</b></td></tr> </table> <table width="100%"> {foreach from=$minicart_contents item=item} <tr><td width="65%">{$item.product|truncate:17:"...":true}</td> <td align="center">{$item.amount}</td><td align="right">{$item.display_subtotal}</td></tr> {/foreach} </table> {/if} <HR size="1" NOSHADE class="VertMenuHr"> {if $minicart_total_items > 0} <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <TD class="MiniCartTextSmall"><a title="{$minicart_delivery}">Shipping Cost:</a></td><td align="right" class="MiniCartTextSmall"> <a title="{$minicart_delivery}">{include file="currency.tpl" value=$minicart_shipping}</a></td> </tr> </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}{/if} <br>

My cart is ~ 200 pxl wide or so. To get the right balance for your cart, so the product name displays the most it can on 1 line, you will need to play around with the two instances of cell width [currently: <td width="65%"] and the truncated value [currently: {$item.product|truncate:17:"...":true}].

Now, to figure out how to get the product names to link to the products!!

Thanks for all who have posted about this mod. It's a great improvement, and adds a lot of value to the minicart feature for our customers.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #25  
Old 04-29-2007, 08:18 AM
  vtonya's Avatar 
vtonya vtonya is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 61
 

Thumbs up COMBINED 2 carts methods from this forum

To get the product names to link to the products just replace the body of minicart.tpl with the following code:

Quote:
{* $Id: minicart.tpl,v 1.12 2004/07/06 14:00:12 svowl Exp $ *}
<TABLE border="0" cellpadding="1" cellspacing="0">
<TR>
<TD rowspan="2" width="23">
{if $minicart_total_items > 0}<img border="0" src="{$ImagesDir}/cart_full.gif" width="19" height="16">
{else}<img border="0" src="{$ImagesDir}/cart_empty.gif" width="19" height="16">{/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>
</TABLE>
{if $minicart_total_items > 0}
<table width="200" border="0" cellpadding="2">
<tr>
<td align="center" width="65%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Item</b></td>
<td align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Qty</b></td>
<td align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Price</b></td>
<td align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"><b>Delete</b></td>
</tr>
<tr>
{foreach from=$minicart_contents item=item}
<td align="left" class="MiniCartTextTiny"><b><a href="product.php?productid={ $item.productid }" title="{$item.product}">{$item.product|truncate:47 :"...":true}</a>
</b></td>

<td align="center">{$item.amount}</td>


<td align="center">{$item.display_subtotal}</td>

<td align="center">
{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}"><img src="/skin1/images/delete.gif" width="22" height="30" alt="Remove product" /></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>{/foreach}
</table>
{/if}
<HR size="1" NOSHADE class="VertMenuHr">
{if $minicart_total_items > 0}
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<TD class="MiniCartTextSmall"><a title="{$minicart_delivery}">Shipping Cost:</a></td><td align="right" class="MiniCartTextSmall">
<a title="{$minicart_delivery}">{include file="currency.tpl" value=$minicart_shipping}</a></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<TD class="MiniCartTextSmall"><strong>{$lng.lbl_total} </strong>: </td>
<td align="right" class="MiniCartTextSmall"><strong>{include file="currency.tpl" value=$minicart_total_cost}</strong></td>
</tr>
</table>
{else}{/if}
<br>


I've also added a DELETE button
All product are linkable!

So, with this mod my shopping cart looks like this:
Click image for larger version

Name:	basket.jpg
Views:	266
Size:	26.7 KB
ID:	348
__________________
X-card Gold 4.1.7
Batch Order Mod/Order Processing
Detailed Order Management Mod
Order Audit/Profit reports
Advanced Product Search
Ajax Username Checker
Direct Product Enquiry Form
FAQ Manager
Social Bookmarking
Tabs Mod v3
MagneticOne.com All-IN-ONE X-Cart Export
Show Referrer Information on Order Details Page
www.medsmarket.net
Reply With Quote
  #26  
Old 06-13-2007, 02:08 AM
 
dub713 dub713 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 56
 

Default Re: COMBINED 2 carts methods from this forum

Quote:
Originally Posted by vtonya

I've also added a DELETE button



did you manage to get the minicart to update the total or subtotal when you click the delete button to remove an item from the cart?


I've got this working finally with linked items, a remove button, and to only display the subtotal with no shipping charges included, but when i remove an item, the subtotal remains the same. it would be nice to get this last piece of the puzzle figured out.

thanks,
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2
Reply With Quote
  #27  
Old 09-23-2008, 03:25 AM
 
TanyaG TanyaG is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 94
 

Default Re: descriptive minicart

I▓ve added {$item.display_subtotal} into my minicart but unfortunately it displays price without tax (VAT). Is anybody know how to display it with taxes included.

Many thanks
__________________
Tanya

x-cart version: 4.1.7 4.1.9. 4.2
Reply With Quote
  #28  
Old 09-26-2008, 08:49 AM
 
TanyaG TanyaG is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 94
 

Default Re: descriptive minicart

Is anybody managed to add some function to minicart which allows to change a shipping method.

Many thanks
__________________
Tanya

x-cart version: 4.1.7 4.1.9. 4.2
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 09:46 PM.

   

 
X-Cart forums © 2001-2020