Contributions
Add Shopping Cart Info to Your Header
Simple modification to add the item count and merchandise total to your header.
Expand All / Collapse All
Updated to work with STS PLUS
This is just a little usercode to allow you to use this contribution in your STS layout.
Add this to your includes/modules/sts_inc/sts_user_code.php file, before the ?> at the end of the file is fine.
$sts->start_capture();
$productno = $cart->count_contents();
$totalprice = $currencies->format($cart->show_total());
if ($productno > 1) {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEMS;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
} elseif ($productno == 0) {
echo ENTRY_HCART_EMPTY;
} else {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEM;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
}
$sts->stop_capture ('headcart');
Add this to your includes/languages/english.php file, before the ?> at the end of the file is fine.
define('ENTRY_HCART_EMPTY', 'Your cart is empty.');
define('ENTRY_HCART_CONTAINS', 'Your cart contains:');
define('ENTRY_HCART_ITEM', 'item.');
define('ENTRY_HCART_ITEMS', 'items.');
define('ENTRY_HCART_PRICE', 'Total price:');
Thats it! Now use $headcart anywhere you want in your STS template files.
If you don't have any item in cart the script output is:
Your cart is empty.
If you have 1 item in cart the script output is:
Your cart contains: 1 item. Total price: $527.10
If you have more than 2 items in cart the script output is:
Your cart contains: 100 items. Total price: $52,710.00
Added support for languages.
Thanks Shawn Moons!
Enjoy & sorry my english.
This is just a little usercode to allow you to use this contribution in your STS layout. I used the table html from Oai C Ngu.
Credits to Kim for the great contrib :).
This is an upgraded package that has the capability of displaying the Gift Voucher balance usually displayed in the shopping cart infobox when a customer has a positive gift voucher credit. This is if you have the credit class gift voucher contribution installed - http://www.oscommerce.com/community/contributions,282/category,all/search,credit+class
You can now totally eliminate the shopping cart infobox because it displays everything you need.
NOTE: this has not been tested on a store that DOES NOT have the credit class gift voucher contribution installed.
Also changed from the previous package is updated styling (i.e. the use of the actual "checkout" button, reorganized tables, etc.)
SCREENSHOTS FROM MY SITE ARE INCLUDED - or go visit http://www.nica-pottery.com to see it in action.
v2.0 2005/2/3 by www.unique-handcrafts.com :: Oai C N
-- Updated --
Same as Cart in header , but i have modified it to show like this:
if you enter the shop, it will say:
---------------------
your cart is empty
---------------------
but when you buy or add an item , it will display the cart:´
--------------------------------------------------------------------------------------------------
Your cart contains: 1 item. Total price excl fraight: $20.00 Checkout
--------------------------------------------------------------------------------------------------
if it's 2items it will show with the "s" :D
v1.1 2004/11/07 by Carine Bruyndoncx (info@calimeross.com)
- Multi-langual
- Include links to cart contents
- Include link to checkout
As a result, you no longer need the separate shopping cart box.
Simple modification to add the item count and merchandise total to your header.
Note: Contributions are used at own risk.