X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   descriptive minicart (https://forum.x-cart.com/showthread.php?t=13723)

MichelleT 10-02-2006 06:19 PM

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?

jasonroy 10-16-2006 01:44 PM

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

jasonroy 10-18-2006 11:10 AM

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?

HWT 11-13-2006 07:09 AM

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. =D>

vtonya 04-29-2007 08:18 AM

COMBINED 2 carts methods from this forum
 
1 Attachment(s)
:D/ 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 :wink:
All product are linkable!

So, with this mod my shopping cart looks like this:
Attachment 348

dub713 06-13-2007 02:08 AM

Re: COMBINED 2 carts methods from this forum
 
Quote:

Originally Posted by vtonya

I've also added a DELETE button :wink:




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,

TanyaG 09-23-2008 03:25 AM

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

TanyaG 09-26-2008 08:49 AM

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

Many thanks


All times are GMT -8. The time now is 01:52 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.