This little mod, that i think should be incorperated into CS-Cart, because i hate having to go through a checkout just to find out the total cost.
Will do a bit more with this when 1.3.4 is released
include/cart_status.php
//
// $Id: cart_status.php 751 2005-10-13 11:20:41Z zeke $
//
if ( !defined('IN_CSCART') ) { die('Access denied'); }
sess_register('cart');
$cart['amount'] = @empty($cart['amount']) ? 0 : $cart['amount'];
$cart['subtotal'] = @empty($cart['subtotal']) ? 0 : $cart['subtotal'];
$cart['discount'] = @empty($cart['discount']) ? 0 : $cart['discount'];
$cart['discounted_subtotal'] = @empty($cart['discounted_subtotal']) ? 0 : $cart['discounted_subtotal'];
$cart['tax_subtotal'] = @empty($cart['tax_subtotal']) ? 0 : $cart['tax_subtotal'];
$cart['shipping_rates'] = @empty($cart['shipping_rates']) ? 0 : $cart['shipping_rates'];
$cart['total'] = @empty($cart['total']) ? 0 : $cart['total'];
$smarty->assign_by_ref('cart_amount', @$cart['amount']);
$smarty->assign_by_ref('cart_subtotal', @$cart['subtotal']);
$smarty->assign_by_ref('cart_discount', @$cart['discount']);
$smarty->assign_by_ref('cart_discounted_subtotal', @$cart['discounted_subtotal']);
$smarty->assign_by_ref('cart_tax_subtotal', @$cart['tax_subtotal']);
extract(fn_calculate_cart_content($cart, $auth, true, true, 'I'));
$smarty->assign_by_ref('cart_shipping_rates', @$cart['shipping_rates']);
$smarty->assign_by_ref('cart_total', @$cart['total']);
?>
customer/cart_pages/cart_status.tpl
```php
{* $Id: cart_status.tpl 675 2005-10-04 11:25:33Z lantan $ *}
{if $cart_amount} {else} {/if} |
{if $cart_amount} {$lang.products}: {$cart_amount} |
{else}
{$lang.cart_is_empty}
{/if}
{$lang.subtotal}: | {include file="common_templates/price.tpl" value=$cart_subtotal} | |
{$lang.discount}: | {include file="common_templates/price.tpl" value=$cart_discount} | |
{$lang.discounted_subtotal}: | {include file="common_templates/price.tpl" value=$cart_discounted_subtotal} | |
{$lang.taxed_subtotal}: | {include file="common_templates/price.tpl" value=$cart_tax_subtotal} | |
{$lang.total_cost}: | {include file="common_templates/price.tpl" value=$cart_total} |
```
include/cart.php
Find this code:
```php
if (!empty($cart)) {
extract(fn_calculate_cart_content($cart, $auth, false, false));
if ($settings['General']['images_location'] == 'filesystem') {
if (is_array($cart_products))
foreach($cart_products as $k => $v) {
// Get icon image data
$cart_products[$k]['icon'] = fn_get_image($v['product_id'], 'product', '', true, false);
}
}
if (is_array(@$cart_products)) {
foreach($cart_products as $k => $v) {
// Get product discounts
$discounts = fn_get_product_discount($v['product_id'], $v['price'], 'separate', $auth);
$discount[$k] = @$discounts;
```
Edit these lines:
```php
if (!empty($cart)) {
[COLOR=Red]extract(fn_calculate_cart_content($cart, $auth, true, true, 'I'));
// extract(fn_calculate_cart_content($cart, $auth, false, false));[/COLOR]
if ($settings['General']['images_location'] == 'filesystem') {
if (is_array($cart_products))
foreach($cart_products as $k => $v) {
// Get icon image data
$cart_products[$k]['icon'] = fn_get_image($v['product_id'], 'product', '', true, false);
}
}
```
customer/cart_pages/cart.tpl
Find this code:
```php
{if ($cart.discount|floatval)}
{$lang.discount}:
{include file="common_templates/price.tpl" value=$cart.discount}
{$lang.discounted_subtotal}:
{include file="common_templates/price.tpl" value=$cart.discounted_subtotal}
```
Add this
```php
{if ($cart.discount|floatval)}
{$lang.discount}:
{include file="common_templates/price.tpl" value=$cart.discount}
{$lang.discounted_subtotal}:
{include file="common_templates/price.tpl" value=$cart.discounted_subtotal}
[COLOR=Red]
{$lang.total_cost}:
{include file="common_templates/price.tpl" value=$cart_total}
[/COLOR]
{/if}
```