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)
-   -   Advanced Cart Mod (https://forum.x-cart.com/showthread.php?t=30809)

ProMuscles 05-08-2007 03:03 AM

Re: Advanced Cart Mod
 
great mod but takes up too much space

hoosierglass 05-21-2007 06:49 AM

Re: Advanced Cart Mod
 
I have played around with this minicart and like it a little better, but I still have a problem with the total not showing the discounted total. Is there a way to get parts of /modules/Fast_Lane_Checkout/cart_subtotal.tpl to work in the minicart?

ProMuscles:
Here is a change so it would work width wise on my layout. This way only takes up the same width as the standard menu template. No more neat remove button but it does have a text remove option below each item.

Code:

{* $Id: cart_subtotal.tpl,v 1.5.2.1 2006/06/16 10:47:44 max Exp $ *}
<div align="right">
{assign var="subtotal" value=$cart.subtotal}
{assign var="discounted_subtotal" value=$cart.discounted_subtotal}

<table cellpadding="3" cellspacing="0" width="30%">

<tr>
<td nowrap="nowrap"><font class="FormButton" style="text-transform: uppercase;">{$lng.lbl_subtotal}:</font></td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right"><font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.display_subtotal}</font></td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.display_subtotal}</td>
</tr>

{if $cart.discount gt 0}
<tr>
<td nowrap="nowrap"><font class="FormButton">{$lng.lbl_discount}:</font></td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right"><font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.discount}</font></td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.discount}</td>
</tr>
{/if}

{if $cart.coupon_discount ne 0 and $cart.coupon_type ne "free_ship"}
<tr>
<td nowrap="nowrap"><font class="FormButton">{$lng.lbl_discount_coupon} <a href="cart.php?mode=unset_coupons" alt="{$lng.lbl_unset_coupon|escape}"><img src="{$ImagesDir}/clear.gif" width="11" height="11" border="0" valign="top" alt="{$lng.lbl_unset_coupon|escape}" /></a> :</font></td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right"><font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.coupon_discount}</font></td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.coupon_discount}</td>
</tr>
{/if}

{if $cart.discounted_subtotal ne $cart.subtotal}
<tr>
<td colspan="4" height="1"><img src="{$ImagesDir}/spacer_black.gif" width="100%" height="1" alt="" /><br /></td>
</tr>

<tr>
<td nowrap="nowrap"><font class="FormButton" style="text-transform: uppercase;">{$lng.lbl_discounted_subtotal}:</font></td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right"><font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.display_discounted_subtotal}</font></td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.display_discounted_subtotal}</td>
</tr>
{/if}

{if $cart.taxes and $config.Taxes.display_taxed_order_totals eq "Y"}

<tr>
<td colspan="4" align="right"><b>{$lng.lbl_including}:</b></td>
</tr>

{foreach key=tax_name item=tax from=$cart.taxes}
<tr class="TableSubHead">
<td nowrap="nowrap" align="right">{$tax.tax_display_name}:</td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right">{include file="currency.tpl" value=$tax.tax_cost_no_shipping}</td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$tax.tax_cost_no_shipping}</td>
</tr>
{/foreach}

{/if}

{if $cart.applied_giftcerts}
<tr>
<td nowrap="nowrap"><font class="FormButton">{$lng.lbl_giftcert_discount}:</font></td>
<td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td>
<td nowrap="nowrap" align="right"><font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.giftcert_discount}</font></td>
<td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.giftcert_discount}</font></td>
</tr>
{/if}

</table>

{if $cart.applied_giftcerts}
<br />
<br />
<font class="FormButton">{$lng.lbl_applied_giftcerts}:</font>
<br />
{section name=gc loop=$cart.applied_giftcerts}
{$cart.applied_giftcerts[gc].giftcert_id} <a href="cart.php?mode=unset_gc&gcid={$cart.applied_giftcerts[gc].giftcert_id}"><img src="{$ImagesDir}/clear.gif" width="11" height="11" border="0" valign="top" alt="{$lng.lbl_unset_gc|escape}" /></a> : <font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.applied_giftcerts[gc].giftcert_cost}</font><br />
{/section}
{/if}

{if $not_logged_message eq "1"}{$lng.txt_order_total_msg}{/if}

</div>
<input type="hidden" name="action" value="update" />
<hr align="left" noshade="noshade" size="1" />
{if $active_modules.Special_Offers ne ""}
{include file="modules/Special_Offers/customer/cart_bonuses.tpl"}
{/if}


hoosierglass 05-21-2007 07:57 AM

Re: Advanced Cart Mod
 
Adding to the thought process here....

instead of this in minicart.tpl:
{include file="currency.tpl" value=$minicart_total_cost}

This value is assigned through the minicart.php file via
$smarty->assign("minicart_total_cost", $MINICART["total_cost"]);

What I am needing to display is:
{include file="currency.tpl" value=$cart.display_discounted_subtotal}

This is from /modules/Fast_Lane_Checkout/cart_subtotal.tpl
But I do not know what php file assigns the cart.display_discounted_subtotal or how to incorperate it into minicart.php

hoosierglass 05-21-2007 11:23 AM

Re: Advanced Cart Mod
 
I have no idea what I did but now it is not only figuring the total correct it is adding in the shipping. Too sweet.

Thanks for this mod vtonya

hoosierglass 05-21-2007 11:56 AM

Re: Advanced Cart Mod
 
I know I am full for questions.....

On this line:
<td align="center">{$item.display_subtotal}</td>
I swithced to <td align="center">{include file="currency.tpl"} {$item.display_subtotal}</td>

Which gives me the $ before the amount, which worked great. If the amount is $39.90 or $12.00 it will display as $39.9 or $12.

I tried:
<td align="center">{include file="currency.tpl" $item.display_subtotal}</td>

But that only killed the mount and left just the $ symbol. How would I go about getting the full amount to display?

inebriate 05-25-2007 08:24 PM

Re: Advanced Cart Mod
 
{include file="currency.tpl" value=$item.display_subtotal}

hoosierglass 05-25-2007 09:56 PM

Re: Advanced Cart Mod
 
I don't know whether to offer you another drink, or feel stupid because someone called inebriate found my errors! :-P

Thanks so you very much for catching this. With that fixed I am now down to only one, pain in the neck from beating my head against the wall, screwball thing.

pinklinoleum 05-28-2007 06:28 PM

Re: Advanced Cart Mod
 
does anyone know how to modify inebriate's thumbnail tag to show up in 4.0.18? i can't get the product images to show up!

Code:

{if $item.is_pimage eq 'W' }{assign var="imageid" value=$item.variantid}{else}{assign var="imageid" value=$item.productid}{/if}
{include file="product_thumbnail.tpl" productid=$imageid image_x=100 product=$item.product tmbn_url=$item.pimage_url type=$item.is_pimage}


thanks!

vtonya 06-13-2007 05:07 PM

Re: Advanced Cart Mod
 
Replace

Quote:

<td align="right" class="MiniCartTextSmall"><strong>{include file="currency.tpl" value=$item_total_cost}</strong></td>


with

Quote:


{* 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="MiniCartTextSmall"><strong>{include file="currency.tpl" value=$grandtotal}</strong></td>



and Total will be calculated wright:D/

JeffS 09-16-2007 12:34 PM

Re: Advanced Cart Mod
 
Great mod, but how do you get the width to be smaller? In the code I think it's saying '200' px wide, but when I change it to '100' nothing happens.

Anyone know how to do this?


All times are GMT -8. The time now is 08:34 PM.

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